From owner-svn-src-head@freebsd.org Sun May 26 12:41:04 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6D1EF15A5AF6; Sun, 26 May 2019 12:41:04 +0000 (UTC) (envelope-from danfe@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 0C7D285F3B; Sun, 26 May 2019 12:41:04 +0000 (UTC) (envelope-from danfe@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D3F241BBB9; Sun, 26 May 2019 12:41:03 +0000 (UTC) (envelope-from danfe@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x4QCf3c0086607; Sun, 26 May 2019 12:41:03 GMT (envelope-from danfe@FreeBSD.org) Received: (from danfe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4QCf3ng086605; Sun, 26 May 2019 12:41:03 GMT (envelope-from danfe@FreeBSD.org) Message-Id: <201905261241.x4QCf3ng086605@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: danfe set sender to danfe@FreeBSD.org using -f From: Alexey Dokuchaev Date: Sun, 26 May 2019 12:41:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r348286 - in head/sys/dev: ctau cxgbe X-SVN-Group: head X-SVN-Commit-Author: danfe X-SVN-Commit-Paths: in head/sys/dev: ctau cxgbe X-SVN-Commit-Revision: 348286 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 0C7D285F3B X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.98)[-0.975,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 26 May 2019 12:41:04 -0000 Author: danfe (ports committer) Date: Sun May 26 12:41:03 2019 New Revision: 348286 URL: https://svnweb.freebsd.org/changeset/base/348286 Log: Fix two errors reported by PVS Studio: V646 Consider inspecting the application's logic. It's possible that 'else' keyword is missing. Reviewed by: gallatin, np, pfg Approved by: pfg Differential Revision: https://reviews.freebsd.org/D20396 Modified: head/sys/dev/ctau/ctddk.c head/sys/dev/cxgbe/t4_main.c Modified: head/sys/dev/ctau/ctddk.c ============================================================================== --- head/sys/dev/ctau/ctddk.c Sun May 26 03:52:35 2019 (r348285) +++ head/sys/dev/ctau/ctddk.c Sun May 26 12:41:03 2019 (r348286) @@ -237,7 +237,7 @@ int ct_set_clk (ct_chan_t *c, int clk) if (c->mode == M_E1) { ct_setup_e1 (c->board); return 0; - } if (c->mode == M_G703) { + } else if (c->mode == M_G703) { ct_setup_g703 (c->board); return 0; } else Modified: head/sys/dev/cxgbe/t4_main.c ============================================================================== --- head/sys/dev/cxgbe/t4_main.c Sun May 26 03:52:35 2019 (r348285) +++ head/sys/dev/cxgbe/t4_main.c Sun May 26 12:41:03 2019 (r348286) @@ -9709,7 +9709,7 @@ set_offload_policy(struct adapter *sc, struct t4_offlo /* Delete installed policies. */ op = NULL; goto set_policy; - } if (uop->nrules > 256) { /* arbitrary */ + } else if (uop->nrules > 256) { /* arbitrary */ return (E2BIG); } From owner-svn-src-head@freebsd.org Sun May 26 14:05:24 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8D8AC15A7349; Sun, 26 May 2019 14:05:24 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: from mail-pg1-x533.google.com (mail-pg1-x533.google.com [IPv6:2607:f8b0:4864:20::533]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id F16CC88710; Sun, 26 May 2019 14:05:23 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: by mail-pg1-x533.google.com with SMTP id z3so2979819pgp.8; Sun, 26 May 2019 07:05:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=OzrS8PAszKtZa5LRtmEd5+F6MeHDkOLe2jjqa6eMGBw=; b=XtUGuUfPAk5hsDl6nK4vPQJKejk2OdBbfsSOwTcaRDXH+Y5NGvpxtv1S719p7NT6tY gy0xifZbgZMOSRxX31mUrrnKi6B8nGl4CQAFMWGGPbYIJRK4BeWMt82029Po9vAxPz1k XPol4u/0ZrhadNZx5ZwkIE6Lpuj4sAlHrK5Np5d2M1sA4yU6+nyPS7/qZOC6lKOupy5i OWdtNRrm1sG03fvytzi/pqbIJg+lCxDS6zF/061+L9IiUnLlQhtfyJxIBFCG0W0gkvyA HdqDEWAlJ+pXOx+8CpEWZtDKzXVz9Iyi2hTTLhXKm/WvpN8uflnFz+KlHara7E4r6vY6 TQjw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=OzrS8PAszKtZa5LRtmEd5+F6MeHDkOLe2jjqa6eMGBw=; b=XHlK1SqUvlex9FGvGVWI/wm8u833zauXqSE5vZsom1NNiIL/la90y+R5d8xmDSC5zi 5Sk3dK775uygHF8zl+UUQSQaK4rrGZA6dIIlbwGgVWr+J4kFcSEQEBHKSgNYYTprImm+ Ac0EJeGhdzKx+33BWE9TLVgLNq8CgDQWnCgRl737gaaQINxNIXyUqaOKIZIL28lUXU3+ ViqsjW72X/IQHBuo59bI2TfldTgYy3UvkyafupHXiLGKZ3Ik69UGWvZlzaIsw+mZ/kcu 17YITzK+3pjvLZx9GeBlAAF3+UwNf+y5i19QsrLLdFML20I+LfNfe+XXJUi9lQvG9NLk WpGA== X-Gm-Message-State: APjAAAWzIba7mVfRpzNOzKK/KKqwFWwkByRg/9MLbSc5BSDCKX01b3KE kwbiNXzfLVcPb2Eho0wsesvhw9X4Bao= X-Google-Smtp-Source: APXvYqwsMAWCbvj9N7r7VJEbPStYdxle9vVZK70HF20qOv0uDjikNqZySllzaCvXb/aSP/5lNXPLWg== X-Received: by 2002:a17:90a:d683:: with SMTP id x3mr24761773pju.42.1558879521915; Sun, 26 May 2019 07:05:21 -0700 (PDT) Received: from [192.168.20.22] (c-73-19-52-228.hsd1.wa.comcast.net. [73.19.52.228]) by smtp.gmail.com with ESMTPSA id i7sm8405741pfo.19.2019.05.26.07.05.21 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 26 May 2019 07:05:21 -0700 (PDT) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (1.0) Subject: Re: svn commit: r348286 - in head/sys/dev: ctau cxgbe From: Enji Cooper X-Mailer: iPhone Mail (16F156) In-Reply-To: <201905261241.x4QCf3ng086605@repo.freebsd.org> Date: Sun, 26 May 2019 07:05:20 -0700 Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org, gallatin@freebsd.org Content-Transfer-Encoding: quoted-printable Message-Id: <2BE2FA91-38D0-4730-8A6A-BAF5037EB24E@gmail.com> References: <201905261241.x4QCf3ng086605@repo.freebsd.org> To: Alexey Dokuchaev X-Rspamd-Queue-Id: F16CC88710 X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.98 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.98)[-0.977,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; REPLY(-4.00)[] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 26 May 2019 14:05:24 -0000 > On May 26, 2019, at 05:41, Alexey Dokuchaev wrote: >=20 > Author: danfe (ports committer) > Date: Sun May 26 12:41:03 2019 > New Revision: 348286 > URL: https://svnweb.freebsd.org/changeset/base/348286 >=20 > Log: > Fix two errors reported by PVS Studio: V646 Consider inspecting the > application's logic. It's possible that 'else' keyword is missing. >=20 > Reviewed by: gallatin, np, pfg > Approved by: pfg > Differential Revision: https://reviews.freebsd.org/D20396 >=20 > Modified: > head/sys/dev/ctau/ctddk.c > head/sys/dev/cxgbe/t4_main.c >=20 > Modified: head/sys/dev/ctau/ctddk.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/ctau/ctddk.c Sun May 26 03:52:35 2019 (r348285) > +++ head/sys/dev/ctau/ctddk.c Sun May 26 12:41:03 2019 (r348286) > @@ -237,7 +237,7 @@ int ct_set_clk (ct_chan_t *c, int clk) > if (c->mode =3D=3D M_E1) { > ct_setup_e1 (c->board); > return 0; > - } if (c->mode =3D=3D M_G703) { > + } else if (c->mode =3D=3D M_G703) { > ct_setup_g703 (c->board); > return 0; > } else This seems like a good candidate for a switch-case logical block. Cheers, -Enji= From owner-svn-src-head@freebsd.org Sun May 26 14:15:55 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AAE8715A78C5; Sun, 26 May 2019 14:15:55 +0000 (UTC) (envelope-from 0mp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 1906088C5D; Sun, 26 May 2019 14:15:55 +0000 (UTC) (envelope-from 0mp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E20121CC35; Sun, 26 May 2019 14:15:54 +0000 (UTC) (envelope-from 0mp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x4QEFs8s037025; Sun, 26 May 2019 14:15:54 GMT (envelope-from 0mp@FreeBSD.org) Received: (from 0mp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4QEFsE8037024; Sun, 26 May 2019 14:15:54 GMT (envelope-from 0mp@FreeBSD.org) Message-Id: <201905261415.x4QEFsE8037024@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: 0mp set sender to 0mp@FreeBSD.org using -f From: Mateusz Piotrowski <0mp@FreeBSD.org> Date: Sun, 26 May 2019 14:15:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r348287 - head/share/man/man4 X-SVN-Group: head X-SVN-Commit-Author: 0mp X-SVN-Commit-Paths: head/share/man/man4 X-SVN-Commit-Revision: 348287 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 1906088C5D X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.97)[-0.974,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 26 May 2019 14:15:56 -0000 Author: 0mp (ports committer) Date: Sun May 26 14:15:54 2019 New Revision: 348287 URL: https://svnweb.freebsd.org/changeset/base/348287 Log: ipheth.4: Explain how to manually configure USB tethering on Apple devices Reviewed by: danfe, hselasky Approved by: src (hselasky) Differential Revision: https://reviews.freebsd.org/D20353 Modified: head/share/man/man4/ipheth.4 Modified: head/share/man/man4/ipheth.4 ============================================================================== --- head/share/man/man4/ipheth.4 Sun May 26 12:41:03 2019 (r348286) +++ head/share/man/man4/ipheth.4 Sun May 26 14:15:54 2019 (r348287) @@ -27,7 +27,7 @@ .\" .\" $FreeBSD$ .\" -.Dd November 24, 2015 +.Dd May 26, 2019 .Dt IPHETH 4 .Os .Sh NAME @@ -75,6 +75,87 @@ Apple iPhone tethering (all models) .It Apple iPad tethering (all models) .El +.Sh EXAMPLES +.Bl -tag -width 0n +.It Sy Example 1\&: No Manual Configuration +.Pp +The following example shows how to manually configure network access on a +device that is not automatically recognized. +.Pp +First, load the driver and find out the unit and the address of the USB +Apple +device: +.Bd -literal -offset 2n +.Li # Ic kldload ipheth +.Li # Ic usbconfig | grep Apple +ugen0.2: at usbus0, cfg=0 md=HOST spd=HIGH (480Mbps) pwr=ON (500mA) +.Ed +.Pp +In this example, the unit and the address of the device is 0.2 +.Pq Dq Li ugen0.2 , +and its configuration index is 0 +.Pq Dq Li cfg=0 . +.Pp +Secondly, check what other configurations are available for the device: +.Bd -literal -offset 2n +.Li # Ic usbconfig 0.2 dump_all_config_desc | awk '/^ Conf/{print} /iConf/{print}' + Configuration index 0 + iConfiguration = 0x0005 + Configuration index 1 + iConfiguration = 0x0006 + Configuration index 2 + iConfiguration = 0x0007 + Configuration index 3 + iConfiguration = 0x0008 +.Ed +.Pp +In this example, there are 4 different configurations available. +The configuration with index 3 seems to be related to Ethernet. +It is time to configure the device: +.Bd -literal -offset 2n +.Li # Ic usbconfig 0.2 set_config 3 +.Li # Ic usbconfig | grep 'Apple.*cfg=3' +ugen0.2: at usbus0, cfg=3 md=HOST spd=HIGH (480Mbps) pwr=ON (500mA) +.Ed +.Pp +At this point the Apple device should ask whether the +.Fx +machine can be trusted +.Po Dq Mobile Data +has to be on +.Pc . +.Pp +A new +.Em ue +USB Ethernet interface should become available: +.Bd -literal -offset 2n +.Li # Ic dmesg | grep 'ue[0-9]' +ue0: on ipheth0 +ue0: bpf attached +ue0: Ethernet address: 4e:7c:5f:2c:5f:7a +.Ed +.Pp +At this point it might be necessary to run +.Xr usbmuxd 1 +.Po available in +.Xr ports 7 +at +.Pa comms/usbmuxd +.Pc : +.Bd -literal -offset 2n +.Li # Ic usbmuxd --enable-exit --foreground --user root --verbose +.Ed +.Pp +Now it is time to configure the network interface: +.Bd -literal -offset 2n +.Li # Ic sysrc ifconfig_ue0="SYNCDHCP" +ifconfig_ue0: -> SYNCDHCP +.Li # Ic service netif restart ue0 +.Ed +.Pp +That is it. +The machine should now be connected to the network via USB tethering. +.El .Sh SEE ALSO .Xr arp 4 , .Xr cdce 4 , @@ -96,12 +177,10 @@ The driver was written by .An Hans Petter Selasky Aq Mt hselasky@FreeBSD.org . .Sh BUGS -Some devices may need to be manually configured to use an alternative -configuration with the +Some devices are not recognized automatically and may need to be manually +configured to use an alternative configuration with the .Xr usbconfig 8 utility. -A command similar to -.Dl usbconfig -u 1 -a 2 set_config 3 -may be required if the device is not recognised automatically by -.Nm -after it is connected. +See +.Sx EXAMPLES +for workarounds. From owner-svn-src-head@freebsd.org Sun May 26 15:17:12 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B2AB315A9342; Sun, 26 May 2019 15:17:12 +0000 (UTC) (envelope-from danfe@freebsd.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2610:1c1:1:6074::16:84]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "freefall.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4674D8A90A; Sun, 26 May 2019 15:17:12 +0000 (UTC) (envelope-from danfe@freebsd.org) Received: by freefall.freebsd.org (Postfix, from userid 1033) id 1981AAA4B; Sun, 26 May 2019 15:17:12 +0000 (UTC) Date: Sun, 26 May 2019 15:17:12 +0000 From: Alexey Dokuchaev To: Enji Cooper Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, gallatin@freebsd.org Subject: Re: svn commit: r348286 - in head/sys/dev: ctau cxgbe Message-ID: <20190526151712.GA72802@FreeBSD.org> References: <201905261241.x4QCf3ng086605@repo.freebsd.org> <2BE2FA91-38D0-4730-8A6A-BAF5037EB24E@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <2BE2FA91-38D0-4730-8A6A-BAF5037EB24E@gmail.com> User-Agent: Mutt/1.11.4 (2019-03-13) X-Rspamd-Queue-Id: 4674D8A90A X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.92 / 15.00]; REPLY(-4.00)[]; NEURAL_HAM_SHORT(-0.93)[-0.925,0]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 26 May 2019 15:17:12 -0000 On Sun, May 26, 2019 at 07:05:20AM -0700, Enji Cooper wrote: > > On May 26, 2019, at 05:41, Alexey Dokuchaev wrote: > > New Revision: 348286 > > URL: https://svnweb.freebsd.org/changeset/base/348286 > > > > Log: > > Fix two errors reported by PVS Studio: V646 Consider inspecting the > > application's logic. It's possible that 'else' keyword is missing. > > > > ... > > Modified: head/sys/dev/ctau/ctddk.c > > --- head/sys/dev/ctau/ctddk.c Sun May 26 03:52:35 2019 (r348285) > > +++ head/sys/dev/ctau/ctddk.c Sun May 26 12:41:03 2019 (r348286) > > @@ -237,7 +237,7 @@ int ct_set_clk (ct_chan_t *c, int clk) > > if (c->mode == M_E1) { > > ct_setup_e1 (c->board); > > return 0; > > - } if (c->mode == M_G703) { > > + } else if (c->mode == M_G703) { > > ct_setup_g703 (c->board); > > return 0; > > } else > > This seems like a good candidate for a switch-case logical block. Perhaps. I'm currently doing some PVS Studio runs over our kernel and these were just some low-hanging fruit I wanted to fix. Several others had been forwarded to commit authors, and some already fixed. ./danfe From owner-svn-src-head@freebsd.org Sun May 26 15:44:59 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7FEDF15A9E27; Sun, 26 May 2019 15:44:59 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 2305C8B801; Sun, 26 May 2019 15:44:59 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id F03BE1DB6B; Sun, 26 May 2019 15:44:58 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x4QFiw9L084110; Sun, 26 May 2019 15:44:58 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4QFiw9r084109; Sun, 26 May 2019 15:44:58 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201905261544.x4QFiw9r084109@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Sun, 26 May 2019 15:44:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r348288 - head/contrib/llvm/lib/CodeGen/SelectionDAG X-SVN-Group: head X-SVN-Commit-Author: dim X-SVN-Commit-Paths: head/contrib/llvm/lib/CodeGen/SelectionDAG X-SVN-Commit-Revision: 348288 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 2305C8B801 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.97)[-0.971,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 26 May 2019 15:44:59 -0000 Author: dim Date: Sun May 26 15:44:58 2019 New Revision: 348288 URL: https://svnweb.freebsd.org/changeset/base/348288 Log: Pull in r361696 from upstream llvm trunk (by Sanjay Patel): [SelectionDAG] soften assertion when legalizing narrow vector FP ops The test based on PR42010: https://bugs.llvm.org/show_bug.cgi?id=42010 ...may show an inaccuracy for PPC's target defs, but we should not be so aggressive with an assert here. There's no telling what out-of-tree targets look like. This fixes an assertion when building the graphics/mesa-dri port for PowerPC64. Reported by: Mark Millard PR: 238082 MFC after: 3 days Modified: head/contrib/llvm/lib/CodeGen/SelectionDAG/LegalizeVectorTypes.cpp Modified: head/contrib/llvm/lib/CodeGen/SelectionDAG/LegalizeVectorTypes.cpp ============================================================================== --- head/contrib/llvm/lib/CodeGen/SelectionDAG/LegalizeVectorTypes.cpp Sun May 26 14:15:54 2019 (r348287) +++ head/contrib/llvm/lib/CodeGen/SelectionDAG/LegalizeVectorTypes.cpp Sun May 26 15:44:58 2019 (r348288) @@ -2523,13 +2523,11 @@ void DAGTypeLegalizer::WidenVectorResult(SDNode *N, un // We're going to widen this vector op to a legal type by padding with undef // elements. If the wide vector op is eventually going to be expanded to // scalar libcalls, then unroll into scalar ops now to avoid unnecessary - // libcalls on the undef elements. We are assuming that if the scalar op - // requires expanding, then the vector op needs expanding too. + // libcalls on the undef elements. EVT VT = N->getValueType(0); - if (TLI.isOperationExpand(N->getOpcode(), VT.getScalarType())) { - EVT WideVecVT = TLI.getTypeToTransformTo(*DAG.getContext(), VT); - assert(!TLI.isOperationLegalOrCustom(N->getOpcode(), WideVecVT) && - "Target supports vector op, but scalar requires expansion?"); + EVT WideVecVT = TLI.getTypeToTransformTo(*DAG.getContext(), VT); + if (!TLI.isOperationLegalOrCustom(N->getOpcode(), WideVecVT) && + TLI.isOperationExpand(N->getOpcode(), VT.getScalarType())) { Res = DAG.UnrollVectorOp(N, WideVecVT.getVectorNumElements()); break; } From owner-svn-src-head@freebsd.org Sun May 26 17:18:15 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9ECD615AB7FB; Sun, 26 May 2019 17:18:15 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 3D9AD8DF5A; Sun, 26 May 2019 17:18:15 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 07FD41EA7C; Sun, 26 May 2019 17:18:15 +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 x4QHIEW9031245; Sun, 26 May 2019 17:18:14 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4QHIENt031244; Sun, 26 May 2019 17:18:14 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201905261718.x4QHIENt031244@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Sun, 26 May 2019 17:18:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r348290 - head/sys/netinet X-SVN-Group: head X-SVN-Commit-Author: tuexen X-SVN-Commit-Paths: head/sys/netinet X-SVN-Commit-Revision: 348290 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 3D9AD8DF5A X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.97)[-0.970,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 26 May 2019 17:18:15 -0000 Author: tuexen Date: Sun May 26 17:18:14 2019 New Revision: 348290 URL: https://svnweb.freebsd.org/changeset/base/348290 Log: When an ACK segment as the third message of the three way handshake is received and support for time stamps was negotiated in the SYN/SYNACK exchange, perform the PAWS check and only expand the syn cache entry if the check is passed. Without this check, endpoints may get stuck on the incomplete queue. Reviewed by: jtl@ MFC after: 3 days Sponsored by: Netflix, Inc. Differential Revision: https://reviews.freebsd.org/D20374 Modified: head/sys/netinet/tcp_syncache.c Modified: head/sys/netinet/tcp_syncache.c ============================================================================== --- head/sys/netinet/tcp_syncache.c Sun May 26 16:43:06 2019 (r348289) +++ head/sys/netinet/tcp_syncache.c Sun May 26 17:18:14 2019 (r348290) @@ -1142,6 +1142,28 @@ syncache_expand(struct in_conninfo *inc, struct tcpopt } } #endif /* TCP_SIGNATURE */ + + /* + * RFC 7323 PAWS: If we have a timestamp on this segment and + * it's less than ts_recent, drop it. + * XXXMT: RFC 7323 also requires to send an ACK. + * In tcp_input.c this is only done for TCP segments + * with user data, so be consistent here and just drop + * the segment. + */ + if (sc->sc_flags & SCF_TIMESTAMP && to->to_flags & TOF_TS && + TSTMP_LT(to->to_tsval, sc->sc_tsreflect)) { + SCH_UNLOCK(sch); + if ((s = tcp_log_addrs(inc, th, NULL, NULL))) { + log(LOG_DEBUG, + "%s; %s: SEG.TSval %u < TS.Recent %u, " + "segment dropped\n", s, __func__, + to->to_tsval, sc->sc_tsreflect); + free(s, M_TCPLOG); + } + return (-1); /* Do not send RST */ + } + /* * Pull out the entry to unlock the bucket row. * From owner-svn-src-head@freebsd.org Sun May 26 23:04:22 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2D30615B341E; Sun, 26 May 2019 23:04:22 +0000 (UTC) (envelope-from jchandra@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id BFE5D72345; Sun, 26 May 2019 23:04:21 +0000 (UTC) (envelope-from jchandra@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 8B31C22598; Sun, 26 May 2019 23:04:21 +0000 (UTC) (envelope-from jchandra@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x4QN4Ll0015392; Sun, 26 May 2019 23:04:21 GMT (envelope-from jchandra@FreeBSD.org) Received: (from jchandra@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4QN4LsL015391; Sun, 26 May 2019 23:04:21 GMT (envelope-from jchandra@FreeBSD.org) Message-Id: <201905262304.x4QN4LsL015391@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jchandra set sender to jchandra@FreeBSD.org using -f From: "Jayachandran C." Date: Sun, 26 May 2019 23:04:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r348291 - head/sys/arm64/arm64 X-SVN-Group: head X-SVN-Commit-Author: jchandra X-SVN-Commit-Paths: head/sys/arm64/arm64 X-SVN-Commit-Revision: 348291 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: BFE5D72345 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.97)[-0.975,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 26 May 2019 23:04:22 -0000 Author: jchandra Date: Sun May 26 23:04:21 2019 New Revision: 348291 URL: https://svnweb.freebsd.org/changeset/base/348291 Log: arm64 nexus: remove incorrect warning acpi_config_intr() will be called when an arm64 system booted with ACPI. We do the interrupt mapping for ACPI interrupts in nexus_acpi_map_intr() on arm64, so acpi_config_intr() has to just return success without printing this error message. Reviewed by: andrew Differential Revision: https://reviews.freebsd.org/D19432 Modified: head/sys/arm64/arm64/nexus.c Modified: head/sys/arm64/arm64/nexus.c ============================================================================== --- head/sys/arm64/arm64/nexus.c Sun May 26 17:18:14 2019 (r348290) +++ head/sys/arm64/arm64/nexus.c Sun May 26 23:04:21 2019 (r348291) @@ -292,9 +292,11 @@ nexus_config_intr(device_t dev, int irq, enum intr_tri enum intr_polarity pol) { - /* TODO: This is wrong, it's needed for ACPI */ - device_printf(dev, "bus_config_intr is obsolete and not supported!\n"); - return (EOPNOTSUPP); + /* + * On arm64 (due to INTRNG), ACPI interrupt configuration is + * done in nexus_acpi_map_intr(). + */ + return (0); } static int From owner-svn-src-head@freebsd.org Mon May 27 00:43:44 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A464915B512F; Mon, 27 May 2019 00:43:44 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4737775228; Mon, 27 May 2019 00:43:44 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 2393C23687; Mon, 27 May 2019 00:43:44 +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 x4R0hhdc067921; Mon, 27 May 2019 00:43:43 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4R0hhml067920; Mon, 27 May 2019 00:43:43 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201905270043.x4R0hhml067920@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: Conrad Meyer Date: Mon, 27 May 2019 00:43:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r348292 - head/sys/sys X-SVN-Group: head X-SVN-Commit-Author: cem X-SVN-Commit-Paths: head/sys/sys X-SVN-Commit-Revision: 348292 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 4737775228 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.96)[-0.965,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 27 May 2019 00:43:44 -0000 Author: cem Date: Mon May 27 00:43:43 2019 New Revision: 348292 URL: https://svnweb.freebsd.org/changeset/base/348292 Log: sys/bufobj.h: Avoid using C++ reserved keyword 'private' No functional change (except for out-of-tree C++ kmods). Modified: head/sys/sys/bufobj.h Modified: head/sys/sys/bufobj.h ============================================================================== --- head/sys/sys/bufobj.h Sun May 26 23:04:21 2019 (r348291) +++ head/sys/sys/bufobj.h Mon May 27 00:43:43 2019 (r348292) @@ -127,7 +127,7 @@ struct bufobj { #define ASSERT_BO_LOCKED(bo) rw_assert(BO_LOCKPTR((bo)), RA_LOCKED) #define ASSERT_BO_UNLOCKED(bo) rw_assert(BO_LOCKPTR((bo)), RA_UNLOCKED) -void bufobj_init(struct bufobj *bo, void *private); +void bufobj_init(struct bufobj *bo, void *priv); void bufobj_wdrop(struct bufobj *bo); void bufobj_wref(struct bufobj *bo); void bufobj_wrefl(struct bufobj *bo); From owner-svn-src-head@freebsd.org Mon May 27 00:47:52 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C58DF15B5642; Mon, 27 May 2019 00:47:52 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 686BD75564; Mon, 27 May 2019 00:47:52 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 565282368A; Mon, 27 May 2019 00:47:52 +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 x4R0lqP4068166; Mon, 27 May 2019 00:47:52 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4R0lqG9068165; Mon, 27 May 2019 00:47:52 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201905270047.x4R0lqG9068165@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: Conrad Meyer Date: Mon, 27 May 2019 00:47:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r348293 - head/sys/crypto/aesni X-SVN-Group: head X-SVN-Commit-Author: cem X-SVN-Commit-Paths: head/sys/crypto/aesni X-SVN-Commit-Revision: 348293 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 686BD75564 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.96)[-0.965,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 27 May 2019 00:47:52 -0000 Author: cem Date: Mon May 27 00:47:51 2019 New Revision: 348293 URL: https://svnweb.freebsd.org/changeset/base/348293 Log: aesni(4): Fix trivial type typo This fixes the kernel build with xtoolchain-gcc (6.4.0). X-MFC-With: r348268 Modified: head/sys/crypto/aesni/aesni_ccm.c Modified: head/sys/crypto/aesni/aesni_ccm.c ============================================================================== --- head/sys/crypto/aesni/aesni_ccm.c Mon May 27 00:43:43 2019 (r348292) +++ head/sys/crypto/aesni/aesni_ccm.c Mon May 27 00:47:51 2019 (r348293) @@ -58,7 +58,7 @@ static inline __m128i xor_and_encrypt(__m128i a, __m128i b, const unsigned char *k, int nr) { - __m128 retval = _mm_xor_si128(a, b); + __m128i retval = _mm_xor_si128(a, b); retval = AESNI_ENC(retval, k, nr); return (retval); From owner-svn-src-head@freebsd.org Mon May 27 00:51:28 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B5DCB15B57B4; Mon, 27 May 2019 00:51:28 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 5478E75905; Mon, 27 May 2019 00:51:28 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 316F6236D9; Mon, 27 May 2019 00:51:28 +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 x4R0pRnN071367; Mon, 27 May 2019 00:51:27 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4R0pRvm071366; Mon, 27 May 2019 00:51:27 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201905270051.x4R0pRvm071366@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: Conrad Meyer Date: Mon, 27 May 2019 00:51:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r348294 - head/share/man/man4 X-SVN-Group: head X-SVN-Commit-Author: cem X-SVN-Commit-Paths: head/share/man/man4 X-SVN-Commit-Revision: 348294 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 5478E75905 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.96)[-0.965,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 27 May 2019 00:51:28 -0000 Author: cem Date: Mon May 27 00:51:27 2019 New Revision: 348294 URL: https://svnweb.freebsd.org/changeset/base/348294 Log: virtio.4: Add missing devices and Xr This page could probably use further improvement. Modified: head/share/man/man4/virtio.4 Modified: head/share/man/man4/virtio.4 ============================================================================== --- head/share/man/man4/virtio.4 Mon May 27 00:47:51 2019 (r348293) +++ head/share/man/man4/virtio.4 Mon May 27 00:51:27 2019 (r348294) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd January 22, 2012 +.Dd May 26, 2019 .Dt VIRTIO 4 .Os .Sh NAME @@ -64,28 +64,37 @@ interrupt notifications needed to interact with the hy .Fx supports the following VirtIO devices: .Bl -hang -offset indent -width xxxxxxxx -.It Nm Ethernet +.It Sy Ethernet An emulated Ethernet device is provided by the .Xr vtnet 4 device driver. -.It Nm Block +.It Sy Block An emulated disk controller is provided by the .Xr virtio_blk 4 device driver. -.It Nm SCSI -An emulated SCSI HBA is provided by the -.Xr virtio_scsi 4 -device driver. -.It Nm Balloon +.It Sy Console +Provided by the +.Xr virtio_console 4 +driver. +.It Sy Entropy +Provided by the +.Xr virtio_random 4 +driver. +.It Sy Balloon A pseudo-device to allow the VM to release memory back to the hypervisor is provided by the .Xr virtio_balloon 4 device driver. +.It Sy SCSI +An emulated SCSI HBA is provided by the +.Xr virtio_scsi 4 +device driver. .El .Sh SEE ALSO .Xr virtio_balloon 4 , .Xr virtio_blk 4 , .Xr virtio_console 4 , +.Xr virtio_random 4 , .Xr virtio_scsi 4 , .Xr vtnet 4 .Sh HISTORY From owner-svn-src-head@freebsd.org Mon May 27 00:55:47 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5145615B59AC; Mon, 27 May 2019 00:55:47 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id EC3DC75B21; Mon, 27 May 2019 00:55:46 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id DB2F423840; Mon, 27 May 2019 00:55:46 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x4R0tk3T073403; Mon, 27 May 2019 00:55:46 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4R0tklp073402; Mon, 27 May 2019 00:55:46 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201905270055.x4R0tklp073402@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: Conrad Meyer Date: Mon, 27 May 2019 00:55:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r348295 - head/sys/dev/virtio/random X-SVN-Group: head X-SVN-Commit-Author: cem X-SVN-Commit-Paths: head/sys/dev/virtio/random X-SVN-Commit-Revision: 348295 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: EC3DC75B21 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.96)[-0.965,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 27 May 2019 00:55:47 -0000 Author: cem Date: Mon May 27 00:55:46 2019 New Revision: 348295 URL: https://svnweb.freebsd.org/changeset/base/348295 Log: virtio_random(4): Remove unneeded reference to device The device_t always references the softc, so we can pass the device and obtain the softc instead of the other way around. Modified: head/sys/dev/virtio/random/virtio_random.c Modified: head/sys/dev/virtio/random/virtio_random.c ============================================================================== --- head/sys/dev/virtio/random/virtio_random.c Mon May 27 00:51:27 2019 (r348294) +++ head/sys/dev/virtio/random/virtio_random.c Mon May 27 00:55:46 2019 (r348295) @@ -46,7 +46,6 @@ __FBSDID("$FreeBSD$"); #include struct vtrnd_softc { - device_t vtrnd_dev; uint64_t vtrnd_features; struct callout vtrnd_callout; struct virtqueue *vtrnd_vq; @@ -58,8 +57,8 @@ static int vtrnd_probe(device_t); static int vtrnd_attach(device_t); static int vtrnd_detach(device_t); -static void vtrnd_negotiate_features(struct vtrnd_softc *); -static int vtrnd_alloc_virtqueue(struct vtrnd_softc *); +static void vtrnd_negotiate_features(device_t); +static int vtrnd_alloc_virtqueue(device_t); static void vtrnd_harvest(struct vtrnd_softc *); static void vtrnd_timer(void *); @@ -129,14 +128,13 @@ vtrnd_attach(device_t dev) int error; sc = device_get_softc(dev); - sc->vtrnd_dev = dev; callout_init(&sc->vtrnd_callout, 1); virtio_set_feature_desc(dev, vtrnd_feature_desc); - vtrnd_negotiate_features(sc); + vtrnd_negotiate_features(dev); - error = vtrnd_alloc_virtqueue(sc); + error = vtrnd_alloc_virtqueue(dev); if (error) { device_printf(dev, "cannot allocate virtqueue\n"); goto fail; @@ -164,24 +162,21 @@ vtrnd_detach(device_t dev) } static void -vtrnd_negotiate_features(struct vtrnd_softc *sc) +vtrnd_negotiate_features(device_t dev) { - device_t dev; - uint64_t features; + struct vtrnd_softc *sc; - dev = sc->vtrnd_dev; - features = VTRND_FEATURES; - - sc->vtrnd_features = virtio_negotiate_features(dev, features); + sc = device_get_softc(dev); + sc->vtrnd_features = virtio_negotiate_features(dev, VTRND_FEATURES); } static int -vtrnd_alloc_virtqueue(struct vtrnd_softc *sc) +vtrnd_alloc_virtqueue(device_t dev) { - device_t dev; + struct vtrnd_softc *sc; struct vq_alloc_info vq_info; - dev = sc->vtrnd_dev; + sc = device_get_softc(dev); VQ_ALLOC_INFO_INIT(&vq_info, 0, NULL, sc, &sc->vtrnd_vq, "%s request", device_get_nameunit(dev)); From owner-svn-src-head@freebsd.org Mon May 27 03:18:57 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5530115B82BD; Mon, 27 May 2019 03:18:57 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id DAD02818BD; Mon, 27 May 2019 03:18:56 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id BF59C2504B; Mon, 27 May 2019 03:18:56 +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 x4R3Iuui048311; Mon, 27 May 2019 03:18:56 GMT (envelope-from jhibbits@FreeBSD.org) Received: (from jhibbits@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4R3IuGw048310; Mon, 27 May 2019 03:18:56 GMT (envelope-from jhibbits@FreeBSD.org) Message-Id: <201905270318.x4R3IuGw048310@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhibbits set sender to jhibbits@FreeBSD.org using -f From: Justin Hibbits Date: Mon, 27 May 2019 03:18:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r348298 - head/sys/cddl/dev/fbt/powerpc X-SVN-Group: head X-SVN-Commit-Author: jhibbits X-SVN-Commit-Paths: head/sys/cddl/dev/fbt/powerpc X-SVN-Commit-Revision: 348298 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: DAD02818BD X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.97)[-0.967,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 27 May 2019 03:18:57 -0000 Author: jhibbits Date: Mon May 27 03:18:56 2019 New Revision: 348298 URL: https://svnweb.freebsd.org/changeset/base/348298 Log: powerpc/dtrace: Fix fbt function probing for ELFv2 '.' function names exist only in ELFv1. ELFv2 does away with function descriptors, and look more like they do on powerpc(32) and most other platforms, as direct function pointers. Stop blacklisting regular function names in ELFv2. Submitted by: Brandon Bergren Differential Revision: https://reviews.freebsd.org/D20346 Modified: head/sys/cddl/dev/fbt/powerpc/fbt_isa.c Modified: head/sys/cddl/dev/fbt/powerpc/fbt_isa.c ============================================================================== --- head/sys/cddl/dev/fbt/powerpc/fbt_isa.c Mon May 27 02:18:33 2019 (r348297) +++ head/sys/cddl/dev/fbt/powerpc/fbt_isa.c Mon May 27 03:18:56 2019 (r348298) @@ -116,6 +116,7 @@ fbt_provide_module_function(linker_file_t lf, int symi uint32_t *instr, *limit; #ifdef __powerpc64__ +#if !defined(_CALL_ELF) || _CALL_ELF == 1 /* * PowerPC64 uses '.' prefixes on symbol names, ignore it, but only * allow symbols with the '.' prefix, so that we don't get the function @@ -125,6 +126,7 @@ fbt_provide_module_function(linker_file_t lf, int symi name++; else return (0); +#endif #endif if (fbt_excluded(name)) From owner-svn-src-head@freebsd.org Mon May 27 04:20:33 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0E15415B939E; Mon, 27 May 2019 04:20:33 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id A850F834F6; Mon, 27 May 2019 04:20:32 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 8178F25A35; Mon, 27 May 2019 04:20:32 +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 x4R4KWsh080150; Mon, 27 May 2019 04:20:32 GMT (envelope-from jhibbits@FreeBSD.org) Received: (from jhibbits@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4R4KWOF080149; Mon, 27 May 2019 04:20:32 GMT (envelope-from jhibbits@FreeBSD.org) Message-Id: <201905270420.x4R4KWOF080149@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhibbits set sender to jhibbits@FreeBSD.org using -f From: Justin Hibbits Date: Mon, 27 May 2019 04:20:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r348299 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: jhibbits X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 348299 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: A850F834F6 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.97)[-0.968,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 27 May 2019 04:20:33 -0000 Author: jhibbits Date: Mon May 27 04:20:31 2019 New Revision: 348299 URL: https://svnweb.freebsd.org/changeset/base/348299 Log: kern/CTF: link_elf_ctf_get() on big endian platforms Check the CTF magic number in big endian platforms. This lets DTrace FBT handle types correctly on these platforms. Submitted by: Brandon Bergren MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D20413 Modified: head/sys/kern/kern_ctf.c Modified: head/sys/kern/kern_ctf.c ============================================================================== --- head/sys/kern/kern_ctf.c Mon May 27 03:18:56 2019 (r348298) +++ head/sys/kern/kern_ctf.c Mon May 27 04:20:31 2019 (r348299) @@ -193,8 +193,12 @@ link_elf_ctf_get(linker_file_t lf, linker_ctf_t *lc) NOCRED, NULL, td)) != 0) goto out; - /* Check the CTF magic number. (XXX check for big endian!) */ + /* Check the CTF magic number. */ +#ifdef __LITTLE_ENDIAN__ if (ctf_hdr[0] != 0xf1 || ctf_hdr[1] != 0xcf) { +#else + if (ctf_hdr[0] != 0xcf || ctf_hdr[1] != 0xf1) { +#endif printf("%s(%d): module %s has invalid format\n", __func__, __LINE__, lf->pathname); error = EFTYPE; From owner-svn-src-head@freebsd.org Mon May 27 06:22:45 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D241615BAF8B; Mon, 27 May 2019 06:22:44 +0000 (UTC) (envelope-from mckusick@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 6FB3F8640A; Mon, 27 May 2019 06:22:44 +0000 (UTC) (envelope-from mckusick@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 603A22702B; Mon, 27 May 2019 06:22:44 +0000 (UTC) (envelope-from mckusick@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x4R6MinV047707; Mon, 27 May 2019 06:22:44 GMT (envelope-from mckusick@FreeBSD.org) Received: (from mckusick@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4R6MiP3047706; Mon, 27 May 2019 06:22:44 GMT (envelope-from mckusick@FreeBSD.org) Message-Id: <201905270622.x4R6MiP3047706@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mckusick set sender to mckusick@FreeBSD.org using -f From: Kirk McKusick Date: Mon, 27 May 2019 06:22:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r348300 - head/sys/ufs/ffs X-SVN-Group: head X-SVN-Commit-Author: mckusick X-SVN-Commit-Paths: head/sys/ufs/ffs X-SVN-Commit-Revision: 348300 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 6FB3F8640A X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.96)[-0.957,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 27 May 2019 06:22:45 -0000 Author: mckusick Date: Mon May 27 06:22:43 2019 New Revision: 348300 URL: https://svnweb.freebsd.org/changeset/base/348300 Log: Add function name and line number debugging information to softupdates worklist structures to help track their movement between work lists. No functional change to the operation of soft updates intended. Modified: head/sys/ufs/ffs/ffs_softdep.c head/sys/ufs/ffs/softdep.h Modified: head/sys/ufs/ffs/ffs_softdep.c ============================================================================== --- head/sys/ufs/ffs/ffs_softdep.c Mon May 27 04:20:31 2019 (r348299) +++ head/sys/ufs/ffs/ffs_softdep.c Mon May 27 06:22:43 2019 (r348300) @@ -1011,42 +1011,59 @@ MTX_SYSINIT(softdep_lock, &lk, "Global Softdep Lock", #define WORKLIST_REMOVE_UNLOCKED WORKLIST_REMOVE #else /* DEBUG */ -static void worklist_insert(struct workhead *, struct worklist *, int); -static void worklist_remove(struct worklist *, int); +static void worklist_insert(struct workhead *, struct worklist *, int, + const char *, int); +static void worklist_remove(struct worklist *, int, const char *, int); -#define WORKLIST_INSERT(head, item) worklist_insert(head, item, 1) -#define WORKLIST_INSERT_UNLOCKED(head, item) worklist_insert(head, item, 0) -#define WORKLIST_REMOVE(item) worklist_remove(item, 1) -#define WORKLIST_REMOVE_UNLOCKED(item) worklist_remove(item, 0) +#define WORKLIST_INSERT(head, item) \ + worklist_insert(head, item, 1, __func__, __LINE__) +#define WORKLIST_INSERT_UNLOCKED(head, item)\ + worklist_insert(head, item, 0, __func__, __LINE__) +#define WORKLIST_REMOVE(item)\ + worklist_remove(item, 1, __func__, __LINE__) +#define WORKLIST_REMOVE_UNLOCKED(item)\ + worklist_remove(item, 0, __func__, __LINE__) static void -worklist_insert(head, item, locked) +worklist_insert(head, item, locked, func, line) struct workhead *head; struct worklist *item; int locked; + const char *func; + int line; { if (locked) LOCK_OWNED(VFSTOUFS(item->wk_mp)); if (item->wk_state & ONWORKLIST) - panic("worklist_insert: %p %s(0x%X) already on list", - item, TYPENAME(item->wk_type), item->wk_state); + panic("worklist_insert: %p %s(0x%X) already on list, " + "added in function %s at line %d", + item, TYPENAME(item->wk_type), item->wk_state, + item->wk_func, item->wk_line); item->wk_state |= ONWORKLIST; + item->wk_func = func; + item->wk_line = line; LIST_INSERT_HEAD(head, item, wk_list); } static void -worklist_remove(item, locked) +worklist_remove(item, locked, func, line) struct worklist *item; int locked; + const char *func; + int line; { if (locked) LOCK_OWNED(VFSTOUFS(item->wk_mp)); if ((item->wk_state & ONWORKLIST) == 0) - panic("worklist_remove: %p %s(0x%X) not on list", - item, TYPENAME(item->wk_type), item->wk_state); + panic("worklist_remove: %p %s(0x%X) not on list, " + "removed in function %s at line %d", + item, TYPENAME(item->wk_type), item->wk_state, + item->wk_func, item->wk_line); item->wk_state &= ~ONWORKLIST; + item->wk_func = func; + item->wk_line = line; LIST_REMOVE(item, wk_list); } #endif /* DEBUG */ @@ -1172,8 +1189,10 @@ workitem_free(item, type) #ifdef DEBUG if (item->wk_state & ONWORKLIST) - panic("workitem_free: %s(0x%X) still on list", - TYPENAME(item->wk_type), item->wk_state); + panic("workitem_free: %s(0x%X) still on list, " + "added in function %s at line %d", + TYPENAME(item->wk_type), item->wk_state, + item->wk_func, item->wk_line); if (item->wk_type != type && type != D_NEWBLK) panic("workitem_free: type mismatch %s != %s", TYPENAME(item->wk_type), TYPENAME(type)); Modified: head/sys/ufs/ffs/softdep.h ============================================================================== --- head/sys/ufs/ffs/softdep.h Mon May 27 04:20:31 2019 (r348299) +++ head/sys/ufs/ffs/softdep.h Mon May 27 06:22:43 2019 (r348300) @@ -213,6 +213,10 @@ struct worklist { struct mount *wk_mp; /* Mount we live in */ unsigned int wk_type:8, /* type of request */ wk_state:24; /* state flags */ +#ifdef DEBUG + const char *wk_func; /* func where added / removed */ + int wk_line; /* line where added / removed */ +#endif }; #define WK_DATA(wk) ((void *)(wk)) #define WK_PAGEDEP(wk) ((struct pagedep *)(wk)) From owner-svn-src-head@freebsd.org Mon May 27 06:34:37 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DE7EE15BB350; Mon, 27 May 2019 06:34:37 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 819F286A5D; Mon, 27 May 2019 06:34:37 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 5172E271CE; Mon, 27 May 2019 06:34:37 +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 x4R6YbdO052883; Mon, 27 May 2019 06:34:37 GMT (envelope-from ae@FreeBSD.org) Received: (from ae@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4R6YbQJ052882; Mon, 27 May 2019 06:34:37 GMT (envelope-from ae@FreeBSD.org) Message-Id: <201905270634.x4R6YbQJ052882@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ae set sender to ae@FreeBSD.org using -f From: "Andrey V. Elsukov" Date: Mon, 27 May 2019 06:34:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r348301 - head/sbin/ipfw X-SVN-Group: head X-SVN-Commit-Author: ae X-SVN-Commit-Paths: head/sbin/ipfw X-SVN-Commit-Revision: 348301 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 819F286A5D X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_SHORT(-0.95)[-0.952,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 27 May 2019 06:34:38 -0000 Author: ae Date: Mon May 27 06:34:36 2019 New Revision: 348301 URL: https://svnweb.freebsd.org/changeset/base/348301 Log: Remove unused token that was added in r348235. MFC after: 2 weeks Modified: head/sbin/ipfw/ipfw2.h Modified: head/sbin/ipfw/ipfw2.h ============================================================================== --- head/sbin/ipfw/ipfw2.h Mon May 27 06:22:43 2019 (r348300) +++ head/sbin/ipfw/ipfw2.h Mon May 27 06:34:36 2019 (r348301) @@ -266,7 +266,6 @@ enum tokens { TOK_OLIST, TOK_MISSING, TOK_ORFLUSH, - TOK_OPTIONAL, /* NAT64 tokens */ TOK_NAT64STL, From owner-svn-src-head@freebsd.org Mon May 27 06:37:24 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D856715BB3F5; Mon, 27 May 2019 06:37:24 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 7D90286BD5; Mon, 27 May 2019 06:37:24 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4FB71271CF; Mon, 27 May 2019 06:37:24 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x4R6bO0Y053045; Mon, 27 May 2019 06:37:24 GMT (envelope-from delphij@FreeBSD.org) Received: (from delphij@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4R6bO9Y053044; Mon, 27 May 2019 06:37:24 GMT (envelope-from delphij@FreeBSD.org) Message-Id: <201905270637.x4R6bO9Y053044@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: delphij set sender to delphij@FreeBSD.org using -f From: Xin LI Date: Mon, 27 May 2019 06:37:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r348302 - head/lib/libcrypt X-SVN-Group: head X-SVN-Commit-Author: delphij X-SVN-Commit-Paths: head/lib/libcrypt X-SVN-Commit-Revision: 348302 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 7D90286BD5 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.95)[-0.955,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 27 May 2019 06:37:25 -0000 Author: delphij Date: Mon May 27 06:37:23 2019 New Revision: 348302 URL: https://svnweb.freebsd.org/changeset/base/348302 Log: Chase r261913: hardcoded default crypt(3) algorithm is SHA-512 when DES is not available. Submitted by: Ali Mashtizadeh MFC after: 3 days Modified: head/lib/libcrypt/crypt.3 Modified: head/lib/libcrypt/crypt.3 ============================================================================== --- head/lib/libcrypt/crypt.3 Mon May 27 06:34:36 2019 (r348301) +++ head/lib/libcrypt/crypt.3 Mon May 27 06:37:23 2019 (r348302) @@ -29,7 +29,7 @@ .\" .\" $FreeBSD$ .\" -.Dd August 10, 2016 +.Dd May 26, 2019 .Dt CRYPT 3 .Os .Sh NAME @@ -222,7 +222,7 @@ This is currently .\" NOTICE: Also make sure to update this .\" DES -if it is available, or MD5 if not. +if it is available, or SHA-512 if not. .Pp How the salt is used will depend upon the algorithm for the hash. For From owner-svn-src-head@freebsd.org Mon May 27 09:52:56 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9D29B15BEAD5; Mon, 27 May 2019 09:52:56 +0000 (UTC) (envelope-from danfe@freebsd.org) Received: from freefall.freebsd.org (freefall.freebsd.org [96.47.72.132]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "freefall.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 3ED818CBDD; Mon, 27 May 2019 09:52:56 +0000 (UTC) (envelope-from danfe@freebsd.org) Received: by freefall.freebsd.org (Postfix, from userid 1033) id 137B715805; Mon, 27 May 2019 09:52:56 +0000 (UTC) Date: Mon, 27 May 2019 09:52:56 +0000 From: Alexey Dokuchaev To: Konstantin Belousov Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r232071 - head/sys/vm Message-ID: <20190527095256.GA52203@FreeBSD.org> References: <201202232107.q1NL7GHi023139@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201202232107.q1NL7GHi023139@svn.freebsd.org> User-Agent: Mutt/1.11.4 (2019-03-13) X-Rspamd-Queue-Id: 3ED818CBDD X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[freebsd.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.96)[-0.961,0]; ASN(0.00)[asn:11403, ipnet:96.47.64.0/20, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 27 May 2019 09:52:56 -0000 On Thu, Feb 23, 2012 at 09:07:16PM +0000, Konstantin Belousov wrote: > New Revision: 232071 > URL: http://svn.freebsd.org/changeset/base/232071 > > Log: > Account the writeable shared mappings backed by file in the vnode > v_writecount. Keep the amount of the virtual address space used by > the mappings in the new vm_object un_pager.vnp.writemappings > counter. The vnode v_writecount is incremented when writemappings gets > non-zero value, and decremented when writemappings is returned to > zero. > > Writeable shared vnode-backed mappings are accounted for in vm_mmap(), > and vm_map_insert() is instructed to set MAP_ENTRY_VN_WRITECNT flag on > the created map entry. During deferred map entry deallocation, > vm_map_process_deferred() checks for MAP_ENTRY_VN_WRITECOUNT and > decrements writemappings for the vm object. > > Now, the writeable mount cannot be demoted to read-only while > writeable shared mappings of the vnodes from the mount point > exist. Also, execve(2) fails for such files with ETXTBUSY, as it > should be. > > ... > Modified: head/sys/vm/vnode_pager.c > ============================================================================== > --- head/sys/vm/vnode_pager.c Thu Feb 23 20:58:52 2012 (r232070) > +++ head/sys/vm/vnode_pager.c Thu Feb 23 21:07:16 2012 (r232071) > @@ -1215,3 +1222,81 @@ vnode_pager_undirty_pages(vm_page_t *ma, > } > VM_OBJECT_UNLOCK(obj); > } > + > +void > +vnode_pager_update_writecount(vm_object_t object, vm_offset_t start, > + vm_offset_t end) So, it is first `start, then `end', but below... > +{ > + struct vnode *vp; > + vm_ooffset_t old_wm; > + > + ... > +} > + > +void > +vnode_pager_release_writecount(vm_object_t object, vm_offset_t start, > + vm_offset_t end) > +{ > + struct vnode *vp; > + struct mount *mp; > + vm_offset_t inc; > + int vfslocked; > + > + VM_OBJECT_LOCK(object); > + > + /* > + * First, recheck the object type to account for the race when > + * the vnode is reclaimed. > + */ > + if (object->type != OBJT_VNODE) { > + VM_OBJECT_UNLOCK(object); > + return; > + } > + > + /* > + * Optimize for the case when writemappings is not going to > + * zero. > + */ > + inc = end - start; > + if (object->un_pager.vnp.writemappings != inc) { > + object->un_pager.vnp.writemappings -= inc; > + VM_OBJECT_UNLOCK(object); > + return; > + } > + > + vp = object->handle; > + vhold(vp); > + VM_OBJECT_UNLOCK(object); > + vfslocked = VFS_LOCK_GIANT(vp->v_mount); > + mp = NULL; > + vn_start_write(vp, &mp, V_WAIT); > + vn_lock(vp, LK_EXCLUSIVE | LK_RETRY); > + > + /* > + * Decrement the object's writemappings, by swapping the start > + * and end arguments for vnode_pager_update_writecount(). If > + * there was not a race with vnode reclaimation, then the > + * vnode's v_writecount is decremented. > + */ > + vnode_pager_update_writecount(object, end, start); ... here, first `end' is passed, then `start'. Is this intentional? PVS Studio complains: /usr/src/sys/vm/vnode_pager.c:1584:1: warning: V764 Possible incorrect order of arguments passed to 'vnode_pager_update_writecount' function: 'end' and 'start'. > + VOP_UNLOCK(vp, 0); > + vdrop(vp); > + if (mp != NULL) > + vn_finished_write(mp); > + VFS_UNLOCK_GIANT(vfslocked); > +} From owner-svn-src-head@freebsd.org Mon May 27 10:54:02 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9E3D115BFB6A; Mon, 27 May 2019 10:54:02 +0000 (UTC) (envelope-from chagin.dmitry@gmail.com) Received: from mail-it1-f195.google.com (mail-it1-f195.google.com [209.85.166.195]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id ACE8C8E9D0; Mon, 27 May 2019 10:54:01 +0000 (UTC) (envelope-from chagin.dmitry@gmail.com) Received: by mail-it1-f195.google.com with SMTP id t184so8878617itf.2; Mon, 27 May 2019 03:54:01 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=oKxhPvtIIAts7oGzaaiuGmrcny7FPYEUcDVBQ22kxiE=; b=jUETK4OH2AyT1iiN2FwL62feyNCieYfZd4DDx/4l9IeB1Y6zHQnbGgBHo4Bm6g1Ulm VLXDkOETyyN61tkTthirkktjRlJP4cGEIUsLsjONjJPheWdDCpcuKecRemAsPKUuXRUY DjVhndz0uVi8SgIAywGA6WHzZFnyRKT2WLppDZH+EcycOkER+rrym4dv1l7esdi5b5HI v49mtEM7+4VRNtDCptPwKwACbOY0iycmoq0f96yYpE4/4IJcP7foUvd4iEMO9G/VpzoU 5cm/PFwksxcmhP6pTTEuaw+bbjCzSPme+T/Jj9OB0xmFyfqM1X6mrbvyWDpZxwZvp49T E3JQ== X-Gm-Message-State: APjAAAWdCUNgCE/tb8/ffFexzsSWfl1uJfhxHkW8jN3vyJBVDOvjU4L6 xZ7w1pxJmD3KmUxFHV2YBmyilo1LAzB6RZtRVnde/cjE X-Google-Smtp-Source: APXvYqxbPJ9Dz/QU7XrX2fscUGBupQyMoUrPsFWOBPfO/OlGXPBM8OPCfiq1DAPGnpO1yJ+C9iCvtm+Z7mQfHRXTgmg= X-Received: by 2002:a24:4608:: with SMTP id j8mr27291131itb.2.1558954434705; Mon, 27 May 2019 03:53:54 -0700 (PDT) MIME-Version: 1.0 References: <201805091847.w49IlPPa014617@repo.freebsd.org> In-Reply-To: From: Dmitry Chagin Date: Mon, 27 May 2019 13:53:43 +0300 Message-ID: Subject: Re: svn commit: r333425 - in head/sys: cddl/compat/opensolaris/sys cddl/contrib/opensolaris/uts/common/fs/zfs compat/cloudabi compat/linux compat/linuxkpi/common/include/linux dev/filemon dev/hwpmc fs/... To: Matthew Macy Cc: Mateusz Guzik , Ilya Bakulin , manu@freebsd.org, Warner Losh , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org X-Rspamd-Queue-Id: ACE8C8E9D0 X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; spf=pass (mx1.freebsd.org: domain of chagindmitry@gmail.com designates 209.85.166.195 as permitted sender) smtp.mailfrom=chagindmitry@gmail.com X-Spamd-Result: default: False [-4.16 / 15.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; RCVD_COUNT_TWO(0.00)[2]; TAGGED_FROM(0.00)[]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; R_SPF_ALLOW(-0.20)[+ip4:209.85.128.0/17]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; MIME_GOOD(-0.10)[multipart/alternative,text/plain]; RCVD_TLS_LAST(0.00)[]; DMARC_NA(0.00)[freebsd.org]; TO_MATCH_ENVRCPT_SOME(0.00)[]; MX_GOOD(-0.01)[cached: alt3.gmail-smtp-in.l.google.com]; NEURAL_HAM_SHORT(-0.87)[-0.867,0]; RCPT_COUNT_SEVEN(0.00)[8]; RCVD_IN_DNSWL_NONE(0.00)[195.166.85.209.list.dnswl.org : 127.0.5.0]; IP_SCORE(-1.29)[ip: (-0.68), ipnet: 209.85.128.0/17(-3.40), asn: 15169(-2.29), country: US(-0.06)]; FORGED_SENDER(0.30)[dchagin@freebsd.org,chagindmitry@gmail.com]; RWL_MAILSPIKE_POSSIBLE(0.00)[195.166.85.209.rep.mailspike.net : 127.0.0.17]; MIME_TRACE(0.00)[0:+,1:+]; R_DKIM_NA(0.00)[]; FREEMAIL_ENVFROM(0.00)[gmail.com]; ASN(0.00)[asn:15169, ipnet:209.85.128.0/17, country:US]; FROM_NEQ_ENVFROM(0.00)[dchagin@freebsd.org,chagindmitry@gmail.com]; FREEMAIL_CC(0.00)[gmail.com] Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.29 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 27 May 2019 10:54:02 -0000 =D1=81=D0=B1, 19 =D0=BC=D0=B0=D1=8F 2018 =D0=B3. =D0=B2 10:31, Matthew Macy= : > r333874 > > > Hi, is it possible to merge r333425, r333874, r333813, r334118 and related revs to the stable/11? From owner-svn-src-head@freebsd.org Mon May 27 11:22:05 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 199CF15C02BD; Mon, 27 May 2019 11:22:05 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 49C008F6C7; Mon, 27 May 2019 11:22:04 +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 x4RBLtZV043479 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NO); Mon, 27 May 2019 14:21:58 +0300 (EEST) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua x4RBLtZV043479 Received: (from kostik@localhost) by tom.home (8.15.2/8.15.2/Submit) id x4RBLtxk043478; Mon, 27 May 2019 14:21:55 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Mon, 27 May 2019 14:21:55 +0300 From: Konstantin Belousov To: Alexey Dokuchaev Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r232071 - head/sys/vm Message-ID: <20190527112155.GZ2748@kib.kiev.ua> References: <201202232107.q1NL7GHi023139@svn.freebsd.org> <20190527095256.GA52203@FreeBSD.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190527095256.GA52203@FreeBSD.org> User-Agent: Mutt/1.11.4 (2019-03-13) X-Spam-Status: No, score=-1.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FORGED_GMAIL_RCVD,FREEMAIL_FROM, NML_ADSP_CUSTOM_MED autolearn=no autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on tom.home X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 27 May 2019 11:22:05 -0000 On Mon, May 27, 2019 at 09:52:56AM +0000, Alexey Dokuchaev wrote: > On Thu, Feb 23, 2012 at 09:07:16PM +0000, Konstantin Belousov wrote: > > New Revision: 232071 > > URL: http://svn.freebsd.org/changeset/base/232071 > > > > Log: > > Account the writeable shared mappings backed by file in the vnode > > v_writecount. Keep the amount of the virtual address space used by > > the mappings in the new vm_object un_pager.vnp.writemappings > > counter. The vnode v_writecount is incremented when writemappings gets > > non-zero value, and decremented when writemappings is returned to > > zero. > > > > Writeable shared vnode-backed mappings are accounted for in vm_mmap(), > > and vm_map_insert() is instructed to set MAP_ENTRY_VN_WRITECNT flag on > > the created map entry. During deferred map entry deallocation, > > vm_map_process_deferred() checks for MAP_ENTRY_VN_WRITECOUNT and > > decrements writemappings for the vm object. > > > > Now, the writeable mount cannot be demoted to read-only while > > writeable shared mappings of the vnodes from the mount point > > exist. Also, execve(2) fails for such files with ETXTBUSY, as it > > should be. > > > > ... > > Modified: head/sys/vm/vnode_pager.c > > ============================================================================== > > --- head/sys/vm/vnode_pager.c Thu Feb 23 20:58:52 2012 (r232070) > > +++ head/sys/vm/vnode_pager.c Thu Feb 23 21:07:16 2012 (r232071) > > @@ -1215,3 +1222,81 @@ vnode_pager_undirty_pages(vm_page_t *ma, > > } > > VM_OBJECT_UNLOCK(obj); > > } > > + > > +void > > +vnode_pager_update_writecount(vm_object_t object, vm_offset_t start, > > + vm_offset_t end) > > So, it is first `start, then `end', but below... > > > +{ > > + struct vnode *vp; > > + vm_ooffset_t old_wm; > > + > > + ... > > +} > > + > > +void > > +vnode_pager_release_writecount(vm_object_t object, vm_offset_t start, > > + vm_offset_t end) > > +{ > > + struct vnode *vp; > > + struct mount *mp; > > + vm_offset_t inc; > > + int vfslocked; > > + > > + VM_OBJECT_LOCK(object); > > + > > + /* > > + * First, recheck the object type to account for the race when > > + * the vnode is reclaimed. > > + */ > > + if (object->type != OBJT_VNODE) { > > + VM_OBJECT_UNLOCK(object); > > + return; > > + } > > + > > + /* > > + * Optimize for the case when writemappings is not going to > > + * zero. > > + */ > > + inc = end - start; > > + if (object->un_pager.vnp.writemappings != inc) { > > + object->un_pager.vnp.writemappings -= inc; > > + VM_OBJECT_UNLOCK(object); > > + return; > > + } > > + > > + vp = object->handle; > > + vhold(vp); > > + VM_OBJECT_UNLOCK(object); > > + vfslocked = VFS_LOCK_GIANT(vp->v_mount); > > + mp = NULL; > > + vn_start_write(vp, &mp, V_WAIT); > > + vn_lock(vp, LK_EXCLUSIVE | LK_RETRY); > > + > > + /* > > + * Decrement the object's writemappings, by swapping the start > > + * and end arguments for vnode_pager_update_writecount(). If > > + * there was not a race with vnode reclaimation, then the > > + * vnode's v_writecount is decremented. > > + */ > > + vnode_pager_update_writecount(object, end, start); > > ... here, first `end' is passed, then `start'. Is this intentional? Did you read the comment right before the call ? > > PVS Studio complains: > > /usr/src/sys/vm/vnode_pager.c:1584:1: warning: V764 Possible > incorrect order of arguments passed to 'vnode_pager_update_writecount' > function: 'end' and 'start'. > > > + VOP_UNLOCK(vp, 0); > > + vdrop(vp); > > + if (mp != NULL) > > + vn_finished_write(mp); > > + VFS_UNLOCK_GIANT(vfslocked); > > +} From owner-svn-src-head@freebsd.org Mon May 27 12:41:42 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6B31B15813E6; Mon, 27 May 2019 12:41:42 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 0E0556B7FE; Mon, 27 May 2019 12:41:42 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D7701301D; Mon, 27 May 2019 12:41:41 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x4RCfflf047129; Mon, 27 May 2019 12:41:41 GMT (envelope-from ae@FreeBSD.org) Received: (from ae@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4RCffTm047128; Mon, 27 May 2019 12:41:41 GMT (envelope-from ae@FreeBSD.org) Message-Id: <201905271241.x4RCffTm047128@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ae set sender to ae@FreeBSD.org using -f From: "Andrey V. Elsukov" Date: Mon, 27 May 2019 12:41:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r348303 - head/sys/net X-SVN-Group: head X-SVN-Commit-Author: ae X-SVN-Commit-Paths: head/sys/net X-SVN-Commit-Revision: 348303 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 0E0556B7FE X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.96)[-0.955,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 27 May 2019 12:41:42 -0000 Author: ae Date: Mon May 27 12:41:41 2019 New Revision: 348303 URL: https://svnweb.freebsd.org/changeset/base/348303 Log: Fix possible NULL pointer dereference. bpf_mtap() can invoke catchpacket() for already detached descriptor. And this can lead to NULL pointer dereference, since bd_bif pointer was reset to NULL in bpf_detachd_locked(). To avoid this, use NET_EPOCH_WAIT() when descriptor is removed from interface's descriptors list. After the wait it is safe to modify descriptor's content. Submitted by: kib Reported by: slavash MFC after: 1 week Modified: head/sys/net/bpf.c Modified: head/sys/net/bpf.c ============================================================================== --- head/sys/net/bpf.c Mon May 27 06:37:23 2019 (r348302) +++ head/sys/net/bpf.c Mon May 27 12:41:41 2019 (r348303) @@ -850,10 +850,15 @@ bpf_detachd_locked(struct bpf_d *d, bool detached_ifp) /* Check if descriptor is attached */ if ((bp = d->bd_bif) == NULL) return; + /* + * Remove d from the interface's descriptor list. + * And wait until bpf_[m]tap*() will finish their possible work + * with descriptor. + */ + CK_LIST_REMOVE(d, bd_next); + NET_EPOCH_WAIT(); BPFD_LOCK(d); - /* Remove d from the interface's descriptor list. */ - CK_LIST_REMOVE(d, bd_next); /* Save bd_writer value */ error = d->bd_writer; ifp = bp->bif_ifp; From owner-svn-src-head@freebsd.org Mon May 27 14:21:33 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 769241597DB4; Mon, 27 May 2019 14:21:33 +0000 (UTC) (envelope-from freebsd@gndrsh.dnsmgr.net) Received: from gndrsh.dnsmgr.net (br1.CN84in.dnsmgr.net [69.59.192.140]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id F037E6ED3D; Mon, 27 May 2019 14:21:32 +0000 (UTC) (envelope-from freebsd@gndrsh.dnsmgr.net) Received: from gndrsh.dnsmgr.net (localhost [127.0.0.1]) by gndrsh.dnsmgr.net (8.13.3/8.13.3) with ESMTP id x4RELOjI011065; Mon, 27 May 2019 07:21:24 -0700 (PDT) (envelope-from freebsd@gndrsh.dnsmgr.net) Received: (from freebsd@localhost) by gndrsh.dnsmgr.net (8.13.3/8.13.3/Submit) id x4RELOfH011064; Mon, 27 May 2019 07:21:24 -0700 (PDT) (envelope-from freebsd) From: "Rodney W. Grimes" Message-Id: <201905271421.x4RELOfH011064@gndrsh.dnsmgr.net> Subject: Re: svn commit: r232071 - head/sys/vm In-Reply-To: <20190527112155.GZ2748@kib.kiev.ua> To: Konstantin Belousov Date: Mon, 27 May 2019 07:21:24 -0700 (PDT) CC: Alexey Dokuchaev , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Reply-To: rgrimes@freebsd.org X-Mailer: ELM [version 2.4ME+ PL121h (25)] MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII X-Rspamd-Queue-Id: F037E6ED3D X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.98 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.98)[-0.980,0]; REPLY(-4.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 27 May 2019 14:21:33 -0000 > On Mon, May 27, 2019 at 09:52:56AM +0000, Alexey Dokuchaev wrote: > > On Thu, Feb 23, 2012 at 09:07:16PM +0000, Konstantin Belousov wrote: > > > New Revision: 232071 > > > URL: http://svn.freebsd.org/changeset/base/232071 > > > > > > Log: > > > Account the writeable shared mappings backed by file in the vnode > > > v_writecount. Keep the amount of the virtual address space used by > > > the mappings in the new vm_object un_pager.vnp.writemappings > > > counter. The vnode v_writecount is incremented when writemappings gets > > > non-zero value, and decremented when writemappings is returned to > > > zero. > > > > > > Writeable shared vnode-backed mappings are accounted for in vm_mmap(), > > > and vm_map_insert() is instructed to set MAP_ENTRY_VN_WRITECNT flag on > > > the created map entry. During deferred map entry deallocation, > > > vm_map_process_deferred() checks for MAP_ENTRY_VN_WRITECOUNT and > > > decrements writemappings for the vm object. > > > > > > Now, the writeable mount cannot be demoted to read-only while > > > writeable shared mappings of the vnodes from the mount point > > > exist. Also, execve(2) fails for such files with ETXTBUSY, as it > > > should be. > > > > > > ... > > > Modified: head/sys/vm/vnode_pager.c > > > ============================================================================== > > > --- head/sys/vm/vnode_pager.c Thu Feb 23 20:58:52 2012 (r232070) > > > +++ head/sys/vm/vnode_pager.c Thu Feb 23 21:07:16 2012 (r232071) > > > @@ -1215,3 +1222,81 @@ vnode_pager_undirty_pages(vm_page_t *ma, > > > } > > > VM_OBJECT_UNLOCK(obj); > > > } > > > + > > > +void > > > +vnode_pager_update_writecount(vm_object_t object, vm_offset_t start, > > > + vm_offset_t end) > > > > So, it is first `start, then `end', but below... > > > > > +{ > > > + struct vnode *vp; > > > + vm_ooffset_t old_wm; > > > + > > > + ... > > > +} > > > + > > > +void > > > +vnode_pager_release_writecount(vm_object_t object, vm_offset_t start, > > > + vm_offset_t end) > > > +{ > > > + struct vnode *vp; > > > + struct mount *mp; > > > + vm_offset_t inc; > > > + int vfslocked; > > > + > > > + VM_OBJECT_LOCK(object); > > > + > > > + /* > > > + * First, recheck the object type to account for the race when > > > + * the vnode is reclaimed. > > > + */ > > > + if (object->type != OBJT_VNODE) { > > > + VM_OBJECT_UNLOCK(object); > > > + return; > > > + } > > > + > > > + /* > > > + * Optimize for the case when writemappings is not going to > > > + * zero. > > > + */ > > > + inc = end - start; > > > + if (object->un_pager.vnp.writemappings != inc) { > > > + object->un_pager.vnp.writemappings -= inc; > > > + VM_OBJECT_UNLOCK(object); > > > + return; > > > + } > > > + > > > + vp = object->handle; > > > + vhold(vp); > > > + VM_OBJECT_UNLOCK(object); > > > + vfslocked = VFS_LOCK_GIANT(vp->v_mount); > > > + mp = NULL; > > > + vn_start_write(vp, &mp, V_WAIT); > > > + vn_lock(vp, LK_EXCLUSIVE | LK_RETRY); > > > + > > > + /* > > > + * Decrement the object's writemappings, by swapping the start > > > + * and end arguments for vnode_pager_update_writecount(). If > > > + * there was not a race with vnode reclaimation, then the > > > + * vnode's v_writecount is decremented. > > > + */ > > > + vnode_pager_update_writecount(object, end, start); > > > > ... here, first `end' is passed, then `start'. Is this intentional? > Did you read the comment right before the call ? I wish to assert again that all changes based on static analysis tools require a formal code review by at minimum: a) An expert in static analysis tools or a group of people selected who we consider language experts. b) An area expert from the area that is being affected We as a project look bad by not having this minimal set of code reviews in place for things that are coming from a source that is frought with introducing bad change. Regards, Rod > > PVS Studio complains: > > > > /usr/src/sys/vm/vnode_pager.c:1584:1: warning: V764 Possible > > incorrect order of arguments passed to 'vnode_pager_update_writecount' > > function: 'end' and 'start'. > > > > > + VOP_UNLOCK(vp, 0); > > > + vdrop(vp); > > > + if (mp != NULL) > > > + vn_finished_write(mp); > > > + VFS_UNLOCK_GIANT(vfslocked); > > > +} > > -- Rod Grimes rgrimes@freebsd.org From owner-svn-src-head@freebsd.org Mon May 27 14:26:23 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 473EF1597F76; Mon, 27 May 2019 14:26:23 +0000 (UTC) (envelope-from danfe@freebsd.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2610:1c1:1:6074::16:84]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "freefall.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id D95516F1E2; Mon, 27 May 2019 14:26:22 +0000 (UTC) (envelope-from danfe@freebsd.org) Received: by freefall.freebsd.org (Postfix, from userid 1033) id AF7C9192C6; Mon, 27 May 2019 14:26:22 +0000 (UTC) Date: Mon, 27 May 2019 14:26:22 +0000 From: Alexey Dokuchaev To: Konstantin Belousov Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r232071 - head/sys/vm Message-ID: <20190527142622.GA4921@FreeBSD.org> References: <201202232107.q1NL7GHi023139@svn.freebsd.org> <20190527095256.GA52203@FreeBSD.org> <20190527112155.GZ2748@kib.kiev.ua> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190527112155.GZ2748@kib.kiev.ua> User-Agent: Mutt/1.11.4 (2019-03-13) X-Rspamd-Queue-Id: D95516F1E2 X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.98 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; REPLY(-4.00)[]; NEURAL_HAM_SHORT(-0.98)[-0.978,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 27 May 2019 14:26:23 -0000 On Mon, May 27, 2019 at 02:21:55PM +0300, Konstantin Belousov wrote: > On Mon, May 27, 2019 at 09:52:56AM +0000, Alexey Dokuchaev wrote: > > On Thu, Feb 23, 2012 at 09:07:16PM +0000, Konstantin Belousov wrote: > > > ... > > > + /* > > > + * Decrement the object's writemappings, by swapping the start > > > + * and end arguments for vnode_pager_update_writecount(). If > > > + * there was not a race with vnode reclaimation, then the > > > + * vnode's v_writecount is decremented. > > > + */ > > > + vnode_pager_update_writecount(object, end, start); > > > > ... here, first `end' is passed, then `start'. Is this intentional? > Did you read the comment right before the call ? I did, as I thought that explanation might be there, but it evaded me (also, I was subconsciously expecting it near the end of the comment), thanks for bring it to my attention and sorry for the noise. ./danfe From owner-svn-src-head@freebsd.org Mon May 27 15:21:27 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8DBB8159FE81; Mon, 27 May 2019 15:21:27 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 2CC4671540; Mon, 27 May 2019 15:21:27 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 060D74E34; Mon, 27 May 2019 15:21:27 +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 x4RFLQVH035757; Mon, 27 May 2019 15:21:26 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4RFLQUX035756; Mon, 27 May 2019 15:21:26 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201905271521.x4RFLQUX035756@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Mon, 27 May 2019 15:21:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r348306 - head/sys/amd64/amd64 X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: head/sys/amd64/amd64 X-SVN-Commit-Revision: 348306 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 2CC4671540 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.97)[-0.966,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 27 May 2019 15:21:27 -0000 Author: kib Date: Mon May 27 15:21:26 2019 New Revision: 348306 URL: https://svnweb.freebsd.org/changeset/base/348306 Log: Correct some inconsistencies in the earliest created kernel page tables which affect demotion. The last last-level page table under 2M mappings below KERNend was only partially initialized. When that page was used as the hardware page table for demotion of the 2M mapping, the result was not consistent. Since pmap_demote_pde() is switched to use PG_PROMOTED as the test for the validity of the saved last level page table page, we can keep page table pages zero-initialized instead. Demotion would fill them as needed. Only map the created page tables beyond KERNend, there is no need to pre-promote PTmap after KERNend, because the extra mapping is not used. Only round up *firstaddr to 2M boundary when it is below rounded KERNend. Sometimes the allocpages() calls advance *firstaddr past the end of the last 2MB page mapping. In that case, this conditional avoids wasting an average of 1MB of physical memory. Update comments to explain action in more clean and direct language. Reported and tested by: pho In collaboration with: alc Sponsored by: The FreeBSD Foundation (kib) MFC after: 1 week Differential revision: https://reviews.freebsd.org/D20380 Modified: head/sys/amd64/amd64/pmap.c Modified: head/sys/amd64/amd64/pmap.c ============================================================================== --- head/sys/amd64/amd64/pmap.c Mon May 27 13:14:22 2019 (r348305) +++ head/sys/amd64/amd64/pmap.c Mon May 27 15:21:26 2019 (r348306) @@ -1338,7 +1338,6 @@ static void create_pagetables(vm_paddr_t *firstaddr) { int i, j, ndm1g, nkpdpe, nkdmpde; - pt_entry_t *pt_p; pd_entry_t *pd_p; pdp_entry_t *pdp_p; pml4_entry_t *p4_p; @@ -1399,20 +1398,21 @@ create_pagetables(vm_paddr_t *firstaddr) KPTphys = allocpages(firstaddr, nkpt); KPDphys = allocpages(firstaddr, nkpdpe); - /* Fill in the underlying page table pages */ - /* XXX not fully used, underneath 2M pages */ - pt_p = (pt_entry_t *)KPTphys; - for (i = 0; ptoa(i) < *firstaddr; i++) - pt_p[i] = ptoa(i) | X86_PG_V | pg_g | bootaddr_rwx(ptoa(i)); - - /* Now map the page tables at their location within PTmap */ + /* + * Connect the zero-filled PT pages to their PD entries. This + * implicitly maps the PT pages at their correct locations within + * the PTmap. + */ pd_p = (pd_entry_t *)KPDphys; for (i = 0; i < nkpt; i++) pd_p[i] = (KPTphys + ptoa(i)) | X86_PG_RW | X86_PG_V; - /* Map from zero to end of allocations under 2M pages */ - /* This replaces some of the KPTphys entries above */ - for (i = 0; (i << PDRSHIFT) < *firstaddr; i++) + /* + * Map from physical address zero to the end of loader preallocated + * memory using 2MB pages. This replaces some of the PD entries + * created above. + */ + for (i = 0; (i << PDRSHIFT) < KERNend; i++) /* Preset PG_M and PG_A because demotion expects it. */ pd_p[i] = (i << PDRSHIFT) | X86_PG_V | PG_PS | pg_g | X86_PG_M | X86_PG_A | bootaddr_rwx(i << PDRSHIFT); @@ -1422,7 +1422,8 @@ create_pagetables(vm_paddr_t *firstaddr) * to record the physical blocks we've actually mapped into kernel * virtual address space. */ - *firstaddr = round_2mpage(*firstaddr); + if (*firstaddr < round_2mpage(KERNend)) + *firstaddr = round_2mpage(KERNend); /* And connect up the PD to the PDP (leaving room for L4 pages) */ pdp_p = (pdp_entry_t *)(KPDPphys + ptoa(KPML4I - KPML4BASE)); @@ -1529,7 +1530,10 @@ pmap_bootstrap(vm_paddr_t *firstaddr) */ vm_phys_add_seg(KPTphys, KPTphys + ptoa(nkpt)); - virtual_avail = (vm_offset_t) KERNBASE + *firstaddr; + /* + * Account for the virtual addresses mapped by create_pagetables(). + */ + virtual_avail = (vm_offset_t)KERNBASE + round_2mpage(KERNend); virtual_end = VM_MAX_KERNEL_ADDRESS; /* From owner-svn-src-head@freebsd.org Mon May 27 16:40:56 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DE2CD15A5270; Mon, 27 May 2019 16:40:56 +0000 (UTC) (envelope-from danfe@freebsd.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2610:1c1:1:6074::16:84]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "freefall.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 8077E7451C; Mon, 27 May 2019 16:40:56 +0000 (UTC) (envelope-from danfe@freebsd.org) Received: by freefall.freebsd.org (Postfix, from userid 1033) id 2B2DD1AEE1; Mon, 27 May 2019 16:40:56 +0000 (UTC) Date: Mon, 27 May 2019 16:40:56 +0000 From: Alexey Dokuchaev To: rgrimes@freebsd.org Cc: Konstantin Belousov , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r232071 - head/sys/vm Message-ID: <20190527164056.GA17917@FreeBSD.org> References: <20190527112155.GZ2748@kib.kiev.ua> <201905271421.x4RELOfH011064@gndrsh.dnsmgr.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201905271421.x4RELOfH011064@gndrsh.dnsmgr.net> User-Agent: Mutt/1.11.4 (2019-03-13) X-Rspamd-Queue-Id: 8077E7451C X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.95 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.95)[-0.954,0]; REPLY(-4.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 27 May 2019 16:40:57 -0000 On Mon, May 27, 2019 at 07:21:24AM -0700, Rodney W. Grimes wrote: > I wish to assert again that all changes based on static > analysis tools require a formal code review by at minimum: > a) An expert in static analysis tools or a group of people > selected who we consider language experts. > b) An area expert from the area that is being affected > > We as a project look bad by not having this minimal > set of code reviews in place for things that are coming > from a source that is frought with introducing bad > change. Perhaps I should've just uploaded the log to let anyone interested have a look themselves. I've been only checking the kernel so far, but plan to cover userland as well later. freefall:/home/danfe/pvs-studio-2019-05-27.log.xz ./danfe From owner-svn-src-head@freebsd.org Mon May 27 17:33:21 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 785D615A6941; Mon, 27 May 2019 17:33:21 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 1A0BB767F3; Mon, 27 May 2019 17:33:21 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E8102641B; Mon, 27 May 2019 17:33: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 x4RHXKSa005786; Mon, 27 May 2019 17:33:20 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4RHXKTP005785; Mon, 27 May 2019 17:33:20 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201905271733.x4RHXKTP005785@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: Conrad Meyer Date: Mon, 27 May 2019 17:33:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r348309 - head/usr.sbin/kldxref X-SVN-Group: head X-SVN-Commit-Author: cem X-SVN-Commit-Paths: head/usr.sbin/kldxref X-SVN-Commit-Revision: 348309 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 1A0BB767F3 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.96)[-0.960,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 27 May 2019 17:33:21 -0000 Author: cem Date: Mon May 27 17:33:20 2019 New Revision: 348309 URL: https://svnweb.freebsd.org/changeset/base/348309 Log: kldxref(8): Sort MDT_MODULE info first in linker.hints output MDT_MODULE info is required to be ordered before any other MDT metadata for a given kld because it serves as an implicit record boundary between distinct klds for linker.hints consumers. kldxref(8) has previously relied on the assumption that MDT_MODULE was ordered relative to other module metadata in kld objects by source code ordering. However, C does not require implementations to emit file scope objects in any particular order, and it seems that GCC 6.4.0 and/or binutils 2.32 ld may reorder emitted objects with respect to source code ordering. So: just take two passes over a given .ko's module metadata, scanning for the MDT_MODULE on the first pass and the other metadata on subsequent passes. It's not super expensive and not exactly a performance-critical piece of code. This ensures MDT_MODULE is always ordered before MDT_PNP_INFO and other MDTs, regardless of compiler/linker movement. As a fringe benefit, it removes the requirement that care be taken to always order MODULE_PNP_INFO after DRIVER_MODULE in source code. Reviewed by: emaste, imp Differential Revision: https://reviews.freebsd.org/D20405 Modified: head/usr.sbin/kldxref/kldxref.c Modified: head/usr.sbin/kldxref/kldxref.c ============================================================================== --- head/usr.sbin/kldxref/kldxref.c Mon May 27 17:14:46 2019 (r348308) +++ head/usr.sbin/kldxref/kldxref.c Mon May 27 17:33:20 2019 (r348309) @@ -549,9 +549,9 @@ read_kld(char *filename, char *kldname) { struct mod_metadata md; struct elf_file ef; - void **p, **orgp; + void **p; int error, eftype; - long start, finish, entries; + long start, finish, entries, i; char cval[MAXMODNAME + 1]; if (verbose || dflag) @@ -575,18 +575,53 @@ read_kld(char *filename, char *kldname) &entries)); check(EF_SEG_READ_ENTRY_REL(&ef, start, sizeof(*p) * entries, (void *)&p)); - orgp = p; - while(entries--) { - check(EF_SEG_READ_REL(&ef, (Elf_Off)*p, sizeof(md), + /* + * Do a first pass to find MDT_MODULE. It is required to be + * ordered first in the output linker.hints stream because it + * serves as an implicit record boundary between distinct klds + * in the stream. Other MDTs only make sense in the context of + * a specific MDT_MODULE. + * + * Some compilers (e.g., GCC 6.4.0 xtoolchain) or binutils + * (e.g., GNU binutils 2.32 objcopy/ld.bfd) can reorder + * MODULE_METADATA set entries relative to the source ordering. + * This is permitted by the C standard; memory layout of + * file-scope objects is left implementation-defined. There is + * no requirement that source code ordering is retained. + * + * Handle that here by taking two passes to ensure MDT_MODULE + * records are emitted to linker.hints before other MDT records + * in the same kld. + */ + for (i = 0; i < entries; i++) { + check(EF_SEG_READ_REL(&ef, (Elf_Off)p[i], sizeof(md), &md)); - p++; check(EF_SEG_READ_STRING(&ef, (Elf_Off)md.md_cval, sizeof(cval), cval)); - parse_entry(&md, cval, &ef, kldname); + if (md.md_type == MDT_MODULE) { + parse_entry(&md, cval, &ef, kldname); + break; + } } + if (error != 0) { + warnc(error, "error while reading %s", filename); + break; + } + + /* + * Second pass for all !MDT_MODULE entries. + */ + for (i = 0; i < entries; i++) { + check(EF_SEG_READ_REL(&ef, (Elf_Off)p[i], sizeof(md), + &md)); + check(EF_SEG_READ_STRING(&ef, (Elf_Off)md.md_cval, + sizeof(cval), cval)); + if (md.md_type != MDT_MODULE) + parse_entry(&md, cval, &ef, kldname); + } if (error != 0) warnc(error, "error while reading %s", filename); - free(orgp); + free(p); } while(0); EF_CLOSE(&ef); return (error); From owner-svn-src-head@freebsd.org Mon May 27 19:57:26 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DFB7C15A97FC; Mon, 27 May 2019 19:57:25 +0000 (UTC) (envelope-from danfe@freebsd.org) Received: from freefall.freebsd.org (freefall.freebsd.org [96.47.72.132]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "freefall.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 847C88358E; Mon, 27 May 2019 19:57:25 +0000 (UTC) (envelope-from danfe@freebsd.org) Received: by freefall.freebsd.org (Postfix, from userid 1033) id 75BA61DFB9; Mon, 27 May 2019 19:57:25 +0000 (UTC) Date: Mon, 27 May 2019 19:57:25 +0000 From: Alexey Dokuchaev To: rgrimes@freebsd.org Cc: Konstantin Belousov , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r232071 - head/sys/vm Message-ID: <20190527195725.GA80681@FreeBSD.org> References: <20190527112155.GZ2748@kib.kiev.ua> <201905271421.x4RELOfH011064@gndrsh.dnsmgr.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201905271421.x4RELOfH011064@gndrsh.dnsmgr.net> User-Agent: Mutt/1.11.4 (2019-03-13) X-Rspamd-Queue-Id: 847C88358E X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.81 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.81)[-0.815,0]; REPLY(-4.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 27 May 2019 19:57:26 -0000 On Mon, May 27, 2019 at 07:21:24AM -0700, Rodney W. Grimes wrote: > ... > We as a project look bad by not having this minimal set of code > reviews in place for things that are coming from a source that is > frought with introducing bad change. We do *not* look bad because none of those warnings and errors suggested by (any) static analysis tools were ever passed without all the due checks by either the original committer, the last committer who touched the files, or opening a PR in less straight-forward cases. I have several potential issues in my queue from the last run which I might submit for the further analysis (via email or PR), but for now since I've published the full log (very noisy), let's see if it gets any traction on its own. Some people had contacted me off-the-list and expressed their interest. I'll revisit it in a few weeks to see if nagging developers and opening PRs is still needed, or the bugs are being voluntarily squished by responsible (and having proper domain-knowledge) parties. ./danfe From owner-svn-src-head@freebsd.org Mon May 27 20:15:05 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 204CC15A9E74; Mon, 27 May 2019 20:15:05 +0000 (UTC) (envelope-from markjdb@gmail.com) Received: from mail-vk1-xa32.google.com (mail-vk1-xa32.google.com [IPv6:2607:f8b0:4864:20::a32]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id A15CC84022; Mon, 27 May 2019 20:15:04 +0000 (UTC) (envelope-from markjdb@gmail.com) Received: by mail-vk1-xa32.google.com with SMTP id j124so4108209vkb.4; Mon, 27 May 2019 13:15:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=52Xo2NyJ03917p4ZCq6/SWuI+8bl5q8FD1FTExY5fgo=; b=vAf4//hTD9rLZtXoCMtYzVrKWESpw81PE+EYfn6UJ8nH70Up5+oQDmluZhVfGdAyjt FL+eL8tQcBHVxdMdRklJ8tqwFcifIwOpvQzgEkCe6EYcSZg3fk0wTn2oDd5HDg3R0mKf JGAFnNnGmb0NSP8rbT+81lEXC68AhGaPRmP9O2r4pgjHKazemhTbTlhzhUKK/kFTw8Ul BOMwJtIkZQWoBwZop6ZQGgcWQ/clcd2eb19Ggyh4QlKeN5Q4XvqcPZtpBkx4czxLZAKh uCDezDCvsfpfi9F4tWYzBOtsmFGTUlHvwWLBJsQSt2w59NZbmUfh0LKiDBESF7tAi1/X 14Bg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:date:from:to:cc:subject:message-id :references:mime-version:content-disposition:in-reply-to:user-agent; bh=52Xo2NyJ03917p4ZCq6/SWuI+8bl5q8FD1FTExY5fgo=; b=OBoXNTN0SuwjpRTcw1ZVvaYY8DnET84WmZrHIOvfkzO27KUQ/USGwING4BJAqeYsJR 0FgJi/tUeGnUEWaLpTUOtVJfiKbBZR9SnHBHweoloUFJEJfPbCk/mUnMlT/5AY/hwyln Sx8Jgd1suOu48Ulq0eTdsv3JUW8SeyFXhlx4ckns5PiFkQ0+IxVQWLsPnA9EohEIRA+2 evJkIyS+W84Lnp6HfgBSmIOG/ZUkCD3swMDV32xKo7C2XIwVPN/6UKLEMB1M8EqTYw9+ 4jRi1LIU7Y+npsU52uH9zyPUYNv4BEuWAeZhIPDQ+BUr9lZJC+ZTOjgG2s8R7/3sp3QR HyIA== X-Gm-Message-State: APjAAAWz2/SgSLk5Fb71YIxKji7H6Wjqr0C3rL6SMjt1hbfLvzk50eJ5 8t6SRkjVQZcVqOnGSY5DnMhgwsFK X-Google-Smtp-Source: APXvYqzARvxEKaL03Rntx3yp2UN8hCSyt3lQsvj0Llh+NYjqzuRLrd+fyIFZi2YFy8Amyt1PKmK2Vg== X-Received: by 2002:a1f:8146:: with SMTP id c67mr16347609vkd.30.1558988103543; Mon, 27 May 2019 13:15:03 -0700 (PDT) Received: from raichu (toroon0560w-lp130-12-70-50-22-99.dsl.bell.ca. [70.50.22.99]) by smtp.gmail.com with ESMTPSA id o66sm6436843vke.17.2019.05.27.13.15.02 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Mon, 27 May 2019 13:15:02 -0700 (PDT) Sender: Mark Johnston Date: Mon, 27 May 2019 16:15:00 -0400 From: Mark Johnston To: Kirk McKusick Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r348300 - head/sys/ufs/ffs Message-ID: <20190527201500.GE82831@raichu> References: <201905270622.x4R6MiP3047706@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201905270622.x4R6MiP3047706@repo.freebsd.org> User-Agent: Mutt/1.11.4 (2019-03-13) X-Rspamd-Queue-Id: A15CC84022 X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.99 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; REPLY(-4.00)[]; NEURAL_HAM_SHORT(-0.99)[-0.986,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 27 May 2019 20:15:05 -0000 On Mon, May 27, 2019 at 06:22:44AM +0000, Kirk McKusick wrote: > Author: mckusick > Date: Mon May 27 06:22:43 2019 > New Revision: 348300 > URL: https://svnweb.freebsd.org/changeset/base/348300 > > Log: > Add function name and line number debugging information to softupdates > worklist structures to help track their movement between work lists. > No functional change to the operation of soft updates intended. > > Modified: > head/sys/ufs/ffs/ffs_softdep.c > head/sys/ufs/ffs/softdep.h > > [...] > Modified: head/sys/ufs/ffs/softdep.h > ============================================================================== > --- head/sys/ufs/ffs/softdep.h Mon May 27 04:20:31 2019 (r348299) > +++ head/sys/ufs/ffs/softdep.h Mon May 27 06:22:43 2019 (r348300) > @@ -213,6 +213,10 @@ struct worklist { > struct mount *wk_mp; /* Mount we live in */ > unsigned int wk_type:8, /* type of request */ > wk_state:24; /* state flags */ > +#ifdef DEBUG > + const char *wk_func; /* func where added / removed */ > + int wk_line; /* line where added / removed */ > +#endif > }; > #define WK_DATA(wk) ((void *)(wk)) > #define WK_PAGEDEP(wk) ((struct pagedep *)(wk)) ffs_softdep.c defines DEBUG, while ffs_alloc.c (which includes softdep.h) does not. A result of this is that the kernel's type info used by DTrace contains two different definitions of struct worklist, which has a sort of snowball effect since we end up with two definitions of each structure containing a struct worklist *, and so on. Could we turn DEBUG into a proper kernel configuration option so that it's defined consistently everywhere, or just use INVARIANTS/DIAGNOSTIC instead? I am happy to do the work if we can agree on a direction. DEBUG is used only in the SU, snapshot and the block allocation code. In ffs_alloc.c it is used to enable some debug printfs (which are themselves conditionalized on a sysctl var). It is used similarly in ffs_snapshot.c. In ffs_softdep.c (which also has SUJ_DEBUG) it enables some consistency checking. INVARIANTS seems to me like a reasonable option to use in ffs_softdep.c, and perhaps the others as well. From owner-svn-src-head@freebsd.org Mon May 27 20:22:49 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 637DC15AA155; Mon, 27 May 2019 20:22:49 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 058A084565; Mon, 27 May 2019 20:22:49 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id CEF3480FA; Mon, 27 May 2019 20:22:48 +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 x4RKMmWE097569; Mon, 27 May 2019 20:22:48 GMT (envelope-from cy@FreeBSD.org) Received: (from cy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4RKMmRF097568; Mon, 27 May 2019 20:22:48 GMT (envelope-from cy@FreeBSD.org) Message-Id: <201905272022.x4RKMmRF097568@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cy set sender to cy@FreeBSD.org using -f From: Cy Schubert Date: Mon, 27 May 2019 20:22:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r348310 - head/sys/contrib/ipfilter/netinet X-SVN-Group: head X-SVN-Commit-Author: cy X-SVN-Commit-Paths: head/sys/contrib/ipfilter/netinet X-SVN-Commit-Revision: 348310 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 058A084565 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.99 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.99)[-0.987,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 27 May 2019 20:22:49 -0000 Author: cy Date: Mon May 27 20:22:48 2019 New Revision: 348310 URL: https://svnweb.freebsd.org/changeset/base/348310 Log: Remove compile-time tests for unsupported versions of FreeBSD. MFC after: 1 week Modified: head/sys/contrib/ipfilter/netinet/ip_rules.c Modified: head/sys/contrib/ipfilter/netinet/ip_rules.c ============================================================================== --- head/sys/contrib/ipfilter/netinet/ip_rules.c Mon May 27 17:33:20 2019 (r348309) +++ head/sys/contrib/ipfilter/netinet/ip_rules.c Mon May 27 20:22:48 2019 (r348310) @@ -30,9 +30,9 @@ #if !defined(__SVR4) && !defined(__svr4__) && !defined(__hpux) # include #endif -#if defined(__FreeBSD__) && (__FreeBSD_version > 220000) +#if defined(__FreeBSD__) # include -#if defined(__FreeBSD_version) && (__FreeBSD_version >= 800000) && defined(_KERNEL) +#if defined(_KERNEL) #include #else #define CURVNET_SET(arg) From owner-svn-src-head@freebsd.org Mon May 27 20:22:52 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CF47F15AA17A; Mon, 27 May 2019 20:22:52 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 6F9068456E; Mon, 27 May 2019 20:22:52 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 48BE880FB; Mon, 27 May 2019 20:22:52 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x4RKMqQf097618; Mon, 27 May 2019 20:22:52 GMT (envelope-from cy@FreeBSD.org) Received: (from cy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4RKMqSV097617; Mon, 27 May 2019 20:22:52 GMT (envelope-from cy@FreeBSD.org) Message-Id: <201905272022.x4RKMqSV097617@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cy set sender to cy@FreeBSD.org using -f From: Cy Schubert Date: Mon, 27 May 2019 20:22:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r348311 - head/sys/contrib/ipfilter/netinet X-SVN-Group: head X-SVN-Commit-Author: cy X-SVN-Commit-Paths: head/sys/contrib/ipfilter/netinet X-SVN-Commit-Revision: 348311 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 6F9068456E X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.99 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.99)[-0.987,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 27 May 2019 20:22:53 -0000 Author: cy Date: Mon May 27 20:22:51 2019 New Revision: 348311 URL: https://svnweb.freebsd.org/changeset/base/348311 Log: Fix indentation and while at it simplfy the code. Reported by: lwhsu@ MFC after: 1 week Modified: head/sys/contrib/ipfilter/netinet/fil.c Modified: head/sys/contrib/ipfilter/netinet/fil.c ============================================================================== --- head/sys/contrib/ipfilter/netinet/fil.c Mon May 27 20:22:48 2019 (r348310) +++ head/sys/contrib/ipfilter/netinet/fil.c Mon May 27 20:22:51 2019 (r348311) @@ -4982,16 +4982,16 @@ frrequest(softc, unit, req, data, set, makecopy) error = ipf_outobj(softc, data, fp, IPFOBJ_FRENTRY); if (error == 0) { - if ((f->fr_dsize != 0) && (uptr != NULL)) + if ((f->fr_dsize != 0) && (uptr != NULL)) { error = COPYOUT(f->fr_data, uptr, f->fr_dsize); - if (error != 0) { + if (error == 0) { + f->fr_hits = 0; + f->fr_bytes = 0; + } else { IPFERROR(28); error = EFAULT; } - if (error == 0) { - f->fr_hits = 0; - f->fr_bytes = 0; } } } From owner-svn-src-head@freebsd.org Mon May 27 20:22:57 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9521715AA1A5; Mon, 27 May 2019 20:22:57 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 2BD9B845F3; Mon, 27 May 2019 20:22:57 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 649DD80FC; Mon, 27 May 2019 20:22:55 +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 x4RKMtnW097663; Mon, 27 May 2019 20:22:55 GMT (envelope-from cy@FreeBSD.org) Received: (from cy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4RKMt1x097662; Mon, 27 May 2019 20:22:55 GMT (envelope-from cy@FreeBSD.org) Message-Id: <201905272022.x4RKMt1x097662@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cy set sender to cy@FreeBSD.org using -f From: Cy Schubert Date: Mon, 27 May 2019 20:22:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r348312 - head/sys/contrib/ipfilter/netinet X-SVN-Group: head X-SVN-Commit-Author: cy X-SVN-Commit-Paths: head/sys/contrib/ipfilter/netinet X-SVN-Commit-Revision: 348312 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 2BD9B845F3 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.99 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.99)[-0.987,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 27 May 2019 20:22:57 -0000 Author: cy Date: Mon May 27 20:22:54 2019 New Revision: 348312 URL: https://svnweb.freebsd.org/changeset/base/348312 Log: style(9) MFC after: 1 week Modified: head/sys/contrib/ipfilter/netinet/fil.c Modified: head/sys/contrib/ipfilter/netinet/fil.c ============================================================================== --- head/sys/contrib/ipfilter/netinet/fil.c Mon May 27 20:22:51 2019 (r348311) +++ head/sys/contrib/ipfilter/netinet/fil.c Mon May 27 20:22:54 2019 (r348312) @@ -3913,7 +3913,7 @@ ipf_fixskip(listp, rp, addremove) for (fp = *listp; (fp != NULL) && (fp != rp); fp = fp->fr_next) rules++; - if (!fp) + if (fp == NULL) return; for (rn = 0, fp = *listp; fp && (fp != rp); fp = fp->fr_next, rn++) @@ -5006,7 +5006,7 @@ frrequest(softc, unit, req, data, set, makecopy) return error; } - if (!f) { + if (f == NULL) { /* * At the end of this, ftail must point to the place where the * new rule is to be saved/inserted/added. @@ -5052,7 +5052,7 @@ frrequest(softc, unit, req, data, set, makecopy) * Request to remove a rule. */ if (addrem == 1) { - if (!f) { + if (f == NULL) { IPFERROR(29); error = ESRCH; } else { From owner-svn-src-head@freebsd.org Mon May 27 21:34:13 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CDA0515AB883; Mon, 27 May 2019 21:34:13 +0000 (UTC) (envelope-from freebsd@gndrsh.dnsmgr.net) Received: from gndrsh.dnsmgr.net (br1.CN84in.dnsmgr.net [69.59.192.140]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2EE48874F1; Mon, 27 May 2019 21:34:12 +0000 (UTC) (envelope-from freebsd@gndrsh.dnsmgr.net) Received: from gndrsh.dnsmgr.net (localhost [127.0.0.1]) by gndrsh.dnsmgr.net (8.13.3/8.13.3) with ESMTP id x4RLY9PD012474; Mon, 27 May 2019 14:34:09 -0700 (PDT) (envelope-from freebsd@gndrsh.dnsmgr.net) Received: (from freebsd@localhost) by gndrsh.dnsmgr.net (8.13.3/8.13.3/Submit) id x4RLY9oO012473; Mon, 27 May 2019 14:34:09 -0700 (PDT) (envelope-from freebsd) From: "Rodney W. Grimes" Message-Id: <201905272134.x4RLY9oO012473@gndrsh.dnsmgr.net> Subject: Re: svn commit: r232071 - head/sys/vm In-Reply-To: <20190527164056.GA17917@FreeBSD.org> To: Alexey Dokuchaev Date: Mon, 27 May 2019 14:34:09 -0700 (PDT) CC: rgrimes@freebsd.org, Konstantin Belousov , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Reply-To: rgrimes@freebsd.org X-Mailer: ELM [version 2.4ME+ PL121h (25)] MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII X-Rspamd-Queue-Id: 2EE48874F1 X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.96 / 15.00]; REPLY(-4.00)[]; NEURAL_HAM_SHORT(-0.96)[-0.965,0]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 27 May 2019 21:34:14 -0000 > On Mon, May 27, 2019 at 07:21:24AM -0700, Rodney W. Grimes wrote: > > I wish to assert again that all changes based on static > > analysis tools require a formal code review by at minimum: > > a) An expert in static analysis tools or a group of people > > selected who we consider language experts. > > b) An area expert from the area that is being affected > > > > We as a project look bad by not having this minimal > > set of code reviews in place for things that are coming > > from a source that is frought with introducing bad > > change. > > Perhaps I should've just uploaded the log to let anyone interested > have a look themselves. I've been only checking the kernel so far, > but plan to cover userland as well later. I do not at all mean to discourage what you are doing, it is good to go over static analysis reports, the problem is that there are often many false positives, and also subtle things that need extreme caution when making repairs. I just ask that before a change be made that starts from some static analysis tool that a formal code review occur before the change is committed. > freefall:/home/danfe/pvs-studio-2019-05-27.log.xz It would be nice if we had a "team" that looked at all the coverity data, and any other data like what you have offered up here. Part of the problem is that few want to do that work, or those that do want to think it is low hanging fruit that anyone can do. I would suggest the opposite, some times it might be low hanging fruit but often it is not, it needs expertise or mistakes are going to happen, and often those mistakes go un caught for some time. Recently a change was made based on a coverity report about not freeing something, some free's got added, one of our downsteam consumers caught this change on import and reported it as a multiple free situation, which was caused by pointer aliasing, something that most static analyzers are horrible at. This self induced bug was in tree for ~2 months and iirc made it in a release. I know I personally saw the original commit, and it looked ok to my un trained eyes, only upon the aliasing being pointed out did my light bulb go off that this was a mistake to have changed the code in the way it was changed. Can I get a hands up for team "Static Blue"? > ./danfe -- Rod Grimes rgrimes@freebsd.org From owner-svn-src-head@freebsd.org Mon May 27 22:34:50 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A62F015ACFAF for ; Mon, 27 May 2019 22:34:50 +0000 (UTC) (envelope-from ian@freebsd.org) Received: from outbound1.eu.mailhop.org (outbound1.eu.mailhop.org [52.28.251.132]) (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 0F1E089BA9 for ; Mon, 27 May 2019 22:34:49 +0000 (UTC) (envelope-from ian@freebsd.org) ARC-Seal: i=1; a=rsa-sha256; t=1558996479; cv=none; d=outbound.mailhop.org; s=arc-outbound20181012; b=ZBld/4gmOF2g3eMnUME5eFhl9aAVFy20WYBRZ03JGsPnCOStRg2CeJnPeiNTCxCLAs2//cYCoYECo xaqkZVWQVopfF4qVqf8By94twc7QmR6e+ipD/4apLk2LE8bo+R7rlzJaZgqK9f79hi6eS+dgIOIz0y o/evAUV8ubt86jhposmZMcZFRulgIG+ZHV0w63dRuuLzq2y5BAGF1gqhKIJ2GDkVN+jAiBnQo+IT4O dq50Y0cH++iwn+i+7TvUYAb1Eaiw7fPB3pHvJExYs+xLepuG+KDI6AWPySHs7xrI8J102mk5/IX3hf 0o138+HhaqNNJNe7FG6NsI3P3xkkZGA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=outbound.mailhop.org; s=arc-outbound20181012; h=content-transfer-encoding:mime-version:content-type:references:in-reply-to: date:cc:to:from:subject:message-id:dkim-signature:from; bh=z8H68u9UtwRqTRHsj2ravb+n6HaWN/sesibtKqgH6+s=; b=AjtU5DwPneHrsFe5VmcMPJtuGKGRh17JBgkXgfor8X5AhOwUc5Wg/77bqI6KDllQFysnd+LmKjvFS QkDVMzOJOw53JedYnnt15mE0bqfbnkOcGry7VhAOZhv6rknUItjdk02e1zpFIPc8PwIooWIQjZWCR3 zdURra3VH/3jwsChNAbCTVvLvfiR57ACrRY2Ps4zy6ImlA1sKY7QRHnI1A9ENzeui2BcM1NvfVIswt Pugf522YVH4MR4w8K+TwPQPTfGMKIGa5i/zNsOx7XwB8etmuP5a/Hb96vsvPzIBDULsPaeyxUZyHJ3 EmAAdQEZTvVVug2uuBHF/k93HZyzfiQ== ARC-Authentication-Results: i=1; outbound3.eu.mailhop.org; spf=softfail smtp.mailfrom=freebsd.org smtp.remote-ip=67.177.211.60; dmarc=none header.from=freebsd.org; arc=none header.oldest-pass=0; DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=outbound.mailhop.org; s=dkim-high; h=content-transfer-encoding:mime-version:content-type:references:in-reply-to: date:cc:to:from:subject:message-id:from; bh=z8H68u9UtwRqTRHsj2ravb+n6HaWN/sesibtKqgH6+s=; b=M1GEu7ftWGIIXvf02H8vXcIG78M6Zwjm4EdV7DCQWI+vEBxKc62+JyjC2rBHbuyWasSYZwT+/0kfa PWYwsKcHfguM9+/MRwPBxMI1dYG44QN4qOsOBONTY78K3HS3fKI7oH66zGj8J02LPa+JV6DmqsCs7W Sco0dOncuRjFKk5wohzIIw+hO7nehrRR9kcNB4w8ZUHXD9eRZKG+zKbJoCucDYVEJEHDDNGSnjNf16 sCZXQD1e9sNYNNiS0LGbnjMzC77/fpTO3fHaQVBatTJRTguVjnhL5wKDuTLwLMnPH9AtkntD0iieR7 gXCd73Eg2FoshlnFVJLXV+uUNdd1gxA== X-MHO-RoutePath: aGlwcGll X-MHO-User: 9abfe2cf-80cf-11e9-91aa-b56e4e6b5865 X-Report-Abuse-To: https://support.duocircle.com/support/solutions/articles/5000540958-duocircle-standard-smtp-abuse-information X-Originating-IP: 67.177.211.60 X-Mail-Handler: DuoCircle Outbound SMTP Received: from ilsoft.org (unknown [67.177.211.60]) by outbound3.eu.mailhop.org (Halon) with ESMTPSA id 9abfe2cf-80cf-11e9-91aa-b56e4e6b5865; Mon, 27 May 2019 22:34:37 +0000 (UTC) Received: from rev (rev [172.22.42.240]) by ilsoft.org (8.15.2/8.15.2) with ESMTP id x4RMYZUJ028394; Mon, 27 May 2019 16:34:35 -0600 (MDT) (envelope-from ian@freebsd.org) Message-ID: Subject: Re: svn commit: r232071 - head/sys/vm From: Ian Lepore To: rgrimes@freebsd.org, Alexey Dokuchaev Cc: Konstantin Belousov , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Date: Mon, 27 May 2019 16:34:34 -0600 In-Reply-To: <201905272134.x4RLY9oO012473@gndrsh.dnsmgr.net> References: <201905272134.x4RLY9oO012473@gndrsh.dnsmgr.net> Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.28.5 FreeBSD GNOME Team Mime-Version: 1.0 Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: 0F1E089BA9 X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.98 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.98)[-0.979,0]; REPLY(-4.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 27 May 2019 22:34:50 -0000 On Mon, 2019-05-27 at 14:34 -0700, Rodney W. Grimes wrote: > I just ask that before a change be made that starts from some > static analysis tool that a formal code review occur before > the change is committed. In a word: No. We're not talking about some inexperienced coder committing dumb fixes to silence warnings here. What I've seen so far is that fixes are being committed by the people who originally wrote or currently maintain the code in question. Nothing bad is happening, so nothing about the process needs to be fixed or changed in any way. Process for process' sake is just obstruction. -- Ian From owner-svn-src-head@freebsd.org Mon May 27 22:47:15 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5711615AD1F1; Mon, 27 May 2019 22:47:15 +0000 (UTC) (envelope-from freebsd@gndrsh.dnsmgr.net) Received: from gndrsh.dnsmgr.net (br1.CN84in.dnsmgr.net [69.59.192.140]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C617A8A169; Mon, 27 May 2019 22:47:14 +0000 (UTC) (envelope-from freebsd@gndrsh.dnsmgr.net) Received: from gndrsh.dnsmgr.net (localhost [127.0.0.1]) by gndrsh.dnsmgr.net (8.13.3/8.13.3) with ESMTP id x4RMlB5j012882; Mon, 27 May 2019 15:47:11 -0700 (PDT) (envelope-from freebsd@gndrsh.dnsmgr.net) Received: (from freebsd@localhost) by gndrsh.dnsmgr.net (8.13.3/8.13.3/Submit) id x4RMlBer012881; Mon, 27 May 2019 15:47:11 -0700 (PDT) (envelope-from freebsd) From: "Rodney W. Grimes" Message-Id: <201905272247.x4RMlBer012881@gndrsh.dnsmgr.net> Subject: Re: svn commit: r232071 - head/sys/vm In-Reply-To: To: Ian Lepore Date: Mon, 27 May 2019 15:47:11 -0700 (PDT) CC: rgrimes@freebsd.org, Alexey Dokuchaev , Konstantin Belousov , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Reply-To: rgrimes@freebsd.org X-Mailer: ELM [version 2.4ME+ PL121h (25)] MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII X-Rspamd-Queue-Id: C617A8A169 X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.95 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.95)[-0.946,0]; REPLY(-4.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 27 May 2019 22:47:15 -0000 > On Mon, 2019-05-27 at 14:34 -0700, Rodney W. Grimes wrote: > > I just ask that before a change be made that starts from some > > static analysis tool that a formal code review occur before > > the change is committed. > > In a word: No. > > We're not talking about some inexperienced coder committing dumb fixes > to silence warnings here. In this specific instance perhaps not so, but unless I am miss remebering the thread either a change was suggested that came from a static analysis tool that an area expert vetoed. That is ineffect what I advocated, so you can say No, but that is not what actually occurred. Furthermore we have had "inexperienced coder's" commit dumb fixes to silence a wwarning that later had to be reverted and cleaned up properly. So again, you can say No, but your basis is wrong. > What I've seen so far is that fixes are > being committed by the people who originally wrote or currently > maintain the code in question. Nothing bad is happening, so nothing > about the process needs to be fixed or changed in any way. This is not what is going on. > Process for process' sake is just obstruction. This is not process for process sake, this is process to stop bad code changes, and you can not say it is not happening, because it is. > -- Ian -- Rod Grimes rgrimes@freebsd.org From owner-svn-src-head@freebsd.org Mon May 27 23:25:20 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0A46215ADF8C; Mon, 27 May 2019 23:25:20 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 965628B39E; Mon, 27 May 2019 23:25:19 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 852769F19; Mon, 27 May 2019 23:25:19 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x4RNPJPU093549; Mon, 27 May 2019 23:25:19 GMT (envelope-from asomers@FreeBSD.org) Received: (from asomers@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4RNPJVh093548; Mon, 27 May 2019 23:25:19 GMT (envelope-from asomers@FreeBSD.org) Message-Id: <201905272325.x4RNPJVh093548@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: asomers set sender to asomers@FreeBSD.org using -f From: Alan Somers Date: Mon, 27 May 2019 23:25:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r348316 - head/share/man/man9 X-SVN-Group: head X-SVN-Commit-Author: asomers X-SVN-Commit-Paths: head/share/man/man9 X-SVN-Commit-Revision: 348316 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 965628B39E X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.98 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.98)[-0.977,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 27 May 2019 23:25:20 -0000 Author: asomers Date: Mon May 27 23:25:19 2019 New Revision: 348316 URL: https://svnweb.freebsd.org/changeset/base/348316 Log: VOP_ADVLOCK.9: fix description of flags * F_RDLCK, F_UNLCK, and F_WRLCK aren't flags. They're stored in the fl.l_type field. * Add F_REMOTE, added in r177633 * Add F_NOINTR, added in r180025 MFC after: 2 weeks Sponsored by: The FreeBSD Foundation Modified: head/share/man/man9/VOP_ADVLOCK.9 Modified: head/share/man/man9/VOP_ADVLOCK.9 ============================================================================== --- head/share/man/man9/VOP_ADVLOCK.9 Mon May 27 22:25:39 2019 (r348315) +++ head/share/man/man9/VOP_ADVLOCK.9 Mon May 27 23:25:19 2019 (r348316) @@ -28,7 +28,7 @@ .\" .\" $FreeBSD$ .\" -.Dd June 30, 1999 +.Dd May 27, 2019 .Dt VOP_ADVLOCK 9 .Os .Sh NAME @@ -56,13 +56,7 @@ Description of the lock. .It Fa flags One of more of the following: .Pp -.Bl -tag -width ".Dv F_UNLCK" -offset indent -compact -.It Dv F_RDLCK -Shared or read lock. -.It Dv F_UNLCK -Unlock. -.It Dv F_WRLCK -Exclusive or write lock. +.Bl -tag -width ".Dv F_REMOTE" -offset indent -compact .It Dv F_WAIT Wait until lock is granted. .It Dv F_FLOCK @@ -71,6 +65,10 @@ Use semantics for lock. .It Dv F_POSIX Use POSIX semantics for lock. +.It Dv F_REMOTE +Lock owner is remote NFS client. +.It Dv F_NOINTR +Mask signals while waiting for the lock. .El .El .Pp From owner-svn-src-head@freebsd.org Tue May 28 00:51:24 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9282615AFDDB; Tue, 28 May 2019 00:51:24 +0000 (UTC) (envelope-from dougm@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 328978DFBD; Tue, 28 May 2019 00:51:24 +0000 (UTC) (envelope-from dougm@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 09F2CACAD; Tue, 28 May 2019 00:51:24 +0000 (UTC) (envelope-from dougm@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x4S0pNVf037777; Tue, 28 May 2019 00:51:23 GMT (envelope-from dougm@FreeBSD.org) Received: (from dougm@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4S0pNAe037776; Tue, 28 May 2019 00:51:23 GMT (envelope-from dougm@FreeBSD.org) Message-Id: <201905280051.x4S0pNAe037776@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dougm set sender to dougm@FreeBSD.org using -f From: Doug Moore Date: Tue, 28 May 2019 00:51:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r348318 - head/sys/vm X-SVN-Group: head X-SVN-Commit-Author: dougm X-SVN-Commit-Paths: head/sys/vm X-SVN-Commit-Revision: 348318 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 328978DFBD X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.96)[-0.963,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 28 May 2019 00:51:24 -0000 Author: dougm Date: Tue May 28 00:51:23 2019 New Revision: 348318 URL: https://svnweb.freebsd.org/changeset/base/348318 Log: Reduce the code size and number of ffsl calls in vm_reserv_break. Use xor to find where free ranges begin and end. Tested by: pho Reviewed by:alc Approved by:markj, kib (mentors) Differential Revision: https://reviews.freebsd.org/D20256 Modified: head/sys/vm/vm_reserv.c Modified: head/sys/vm/vm_reserv.c ============================================================================== --- head/sys/vm/vm_reserv.c Tue May 28 00:03:46 2019 (r348317) +++ head/sys/vm/vm_reserv.c Tue May 28 00:51:23 2019 (r348318) @@ -1030,56 +1030,49 @@ vm_reserv_alloc_page(int req, vm_object_t object, vm_p static void vm_reserv_break(vm_reserv_t rv) { - int begin_zeroes, hi, i, lo; + u_long changes; + int bitpos, hi, i, lo; vm_reserv_assert_locked(rv); CTR5(KTR_VM, "%s: rv %p object %p popcnt %d inpartpop %d", __FUNCTION__, rv, rv->object, rv->popcnt, rv->inpartpopq); vm_reserv_remove(rv); rv->pages->psind = 0; - i = hi = 0; - do { - /* Find the next 0 bit. Any previous 0 bits are < "hi". */ - lo = ffsl(~(((1UL << hi) - 1) | rv->popmap[i])); - if (lo == 0) { - /* Redundantly clears bits < "hi". */ + hi = lo = -1; + for (i = 0; i <= NPOPMAP; i++) { + /* + * "changes" is a bitmask that marks where a new sequence of + * 0s or 1s begins in popmap[i], with last bit in popmap[i-1] + * considered to be 1 if and only if lo == hi. The bits of + * popmap[-1] and popmap[NPOPMAP] are considered all 1s. + */ + if (i == NPOPMAP) + changes = lo != hi; + else { + changes = rv->popmap[i]; + changes ^= (changes << 1) | (lo == hi); rv->popmap[i] = 0; - rv->popcnt -= NBPOPMAP - hi; - while (++i < NPOPMAP) { - lo = ffsl(~rv->popmap[i]); - if (lo == 0) { - rv->popmap[i] = 0; - rv->popcnt -= NBPOPMAP; - } else - break; + } + while (changes != 0) { + /* + * If the next change marked begins a run of 0s, set + * lo to mark that position. Otherwise set hi and + * free pages from lo up to hi. + */ + bitpos = ffsl(changes) - 1; + changes ^= 1UL << bitpos; + if (lo == hi) + lo = NBPOPMAP * i + bitpos; + else { + hi = NBPOPMAP * i + bitpos; + vm_domain_free_lock(VM_DOMAIN(rv->domain)); + vm_phys_free_contig(&rv->pages[lo], hi - lo); + vm_domain_free_unlock(VM_DOMAIN(rv->domain)); + lo = hi; } - if (i == NPOPMAP) - break; - hi = 0; } - KASSERT(lo > 0, ("vm_reserv_break: lo is %d", lo)); - /* Convert from ffsl() to ordinary bit numbering. */ - lo--; - if (lo > 0) { - /* Redundantly clears bits < "hi". */ - rv->popmap[i] &= ~((1UL << lo) - 1); - rv->popcnt -= lo - hi; - } - begin_zeroes = NBPOPMAP * i + lo; - /* Find the next 1 bit. */ - do - hi = ffsl(rv->popmap[i]); - while (hi == 0 && ++i < NPOPMAP); - if (i != NPOPMAP) - /* Convert from ffsl() to ordinary bit numbering. */ - hi--; - vm_domain_free_lock(VM_DOMAIN(rv->domain)); - vm_phys_free_contig(&rv->pages[begin_zeroes], NBPOPMAP * i + - hi - begin_zeroes); - vm_domain_free_unlock(VM_DOMAIN(rv->domain)); - } while (i < NPOPMAP); - KASSERT(rv->popcnt == 0, - ("vm_reserv_break: reserv %p's popcnt is corrupted", rv)); + } + rv->popcnt = 0; counter_u64_add(vm_reserv_broken, 1); } From owner-svn-src-head@freebsd.org Tue May 28 01:41:09 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9185515B15F6; Tue, 28 May 2019 01:41:09 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 35F778FB3F; Tue, 28 May 2019 01:41:09 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id DF76DB51F; Tue, 28 May 2019 01:41:08 +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 x4S1f8Ss063172; Tue, 28 May 2019 01:41:08 GMT (envelope-from cy@FreeBSD.org) Received: (from cy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4S1f8oN063170; Tue, 28 May 2019 01:41:08 GMT (envelope-from cy@FreeBSD.org) Message-Id: <201905280141.x4S1f8oN063170@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cy set sender to cy@FreeBSD.org using -f From: Cy Schubert Date: Tue, 28 May 2019 01:41:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r348320 - head/sys/contrib/ipfilter/netinet X-SVN-Group: head X-SVN-Commit-Author: cy X-SVN-Commit-Paths: head/sys/contrib/ipfilter/netinet X-SVN-Commit-Revision: 348320 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 35F778FB3F X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.97)[-0.974,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 28 May 2019 01:41:09 -0000 Author: cy Date: Tue May 28 01:41:08 2019 New Revision: 348320 URL: https://svnweb.freebsd.org/changeset/base/348320 Log: Contuation of r343701, removal of irrelevant #ifdefs. MFC after: 1 week Modified: head/sys/contrib/ipfilter/netinet/ip_frag.c head/sys/contrib/ipfilter/netinet/ip_proxy.h head/sys/contrib/ipfilter/netinet/ip_rules.c Modified: head/sys/contrib/ipfilter/netinet/ip_frag.c ============================================================================== --- head/sys/contrib/ipfilter/netinet/ip_frag.c Tue May 28 01:09:19 2019 (r348319) +++ head/sys/contrib/ipfilter/netinet/ip_frag.c Tue May 28 01:41:08 2019 (r348320) @@ -34,11 +34,11 @@ #include #if defined(_KERNEL) # include -# if !defined(__SVR4) && !defined(__svr4__) +# if !defined(__SVR4) # include # endif #endif -#if !defined(__SVR4) && !defined(__svr4__) +#if !defined(__SVR4) # if defined(_KERNEL) # include # endif Modified: head/sys/contrib/ipfilter/netinet/ip_proxy.h ============================================================================== --- head/sys/contrib/ipfilter/netinet/ip_proxy.h Tue May 28 01:09:19 2019 (r348319) +++ head/sys/contrib/ipfilter/netinet/ip_proxy.h Tue May 28 01:41:08 2019 (r348320) @@ -13,14 +13,14 @@ #define __IP_PROXY_H__ #ifndef SOLARIS -# if defined(sun) && (defined(__svr4__) || defined(__SVR4)) +# if defined(sun) && defined(__SVR4)) # define SOLARIS 1 # else # define SOLARIS 0 # endif #endif -#if defined(__STDC__) || defined(__GNUC__) || defined(_AIX51) +#if defined(__STDC__) || defined(__GNUC__) #define SIOCPROXY _IOWR('r', 64, struct ap_control) #else #define SIOCPROXY _IOWR(r, 64, struct ap_control) Modified: head/sys/contrib/ipfilter/netinet/ip_rules.c ============================================================================== --- head/sys/contrib/ipfilter/netinet/ip_rules.c Tue May 28 01:09:19 2019 (r348319) +++ head/sys/contrib/ipfilter/netinet/ip_rules.c Tue May 28 01:41:08 2019 (r348320) @@ -12,22 +12,18 @@ #include #include #include -#if defined(__FreeBSD_version) && (__FreeBSD_version >= 40000) +#if defined(__FreeBSD_version) # if defined(_KERNEL) # include # else # include # endif -#endif -#if defined(__NetBSD_Version__) && (__NetBSD_Version__ >= 399000000) #else -# if !defined(__FreeBSD__) && !defined(__OpenBSD__) && !defined(__sgi) -# include -# endif +# include #endif #include #include -#if !defined(__SVR4) && !defined(__svr4__) && !defined(__hpux) +#if !defined(__SVR4) # include #endif #if defined(__FreeBSD__) From owner-svn-src-head@freebsd.org Tue May 28 09:12:16 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 64F7F15BBC86; Tue, 28 May 2019 09:12:16 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 05BBF6F61F; Tue, 28 May 2019 09:12:16 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id AAD58184FF; Tue, 28 May 2019 09:12:15 +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 x4S9CFV3012134; Tue, 28 May 2019 09:12:15 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4S9CFB3012133; Tue, 28 May 2019 09:12:15 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201905280912.x4S9CFB3012133@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Tue, 28 May 2019 09:12:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r348322 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: andrew X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 348322 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 05BBF6F61F X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.96)[-0.965,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 28 May 2019 09:12:16 -0000 Author: andrew Date: Tue May 28 09:12:15 2019 New Revision: 348322 URL: https://svnweb.freebsd.org/changeset/base/348322 Log: Teach the kernel KUBSAN runtime about alignment_assumption This checks the alignment of a given pointer is sufficient for the requested alignment asked for. This fixes the build with a recent llvm/clang. Sponsored by: DARPA, AFRL Modified: head/sys/kern/kern_ubsan.c Modified: head/sys/kern/kern_ubsan.c ============================================================================== --- head/sys/kern/kern_ubsan.c Tue May 28 02:00:09 2019 (r348321) +++ head/sys/kern/kern_ubsan.c Tue May 28 09:12:15 2019 (r348322) @@ -244,6 +244,12 @@ struct CFloatCastOverflowData { struct CTypeDescriptor *mToType; }; +struct CAlignmentAssumptionData { + struct CSourceLocation mLocation; + struct CSourceLocation mAssumptionLocation; + struct CTypeDescriptor *mType; +}; + /* Local utility functions */ static void Report(bool isFatal, const char *pFormat, ...) __printflike(2, 3); static bool isAlreadyReported(struct CSourceLocation *pLocation); @@ -276,6 +282,8 @@ intptr_t __ubsan_vptr_type_cache[128]; /* Public symbols used in the instrumentation of the code generation part */ void __ubsan_handle_add_overflow(struct COverflowData *pData, unsigned long ulLHS, unsigned long ulRHS); void __ubsan_handle_add_overflow_abort(struct COverflowData *pData, unsigned long ulLHS, unsigned long ulRHS); +void __ubsan_handle_alignment_assumption(struct CAlignmentAssumptionData *pData, unsigned long ulPointer, unsigned long ulAlignment, unsigned long ulOffset); +void __ubsan_handle_alignment_assumption_abort(struct CAlignmentAssumptionData *pData, unsigned long ulPointer, unsigned long ulAlignment, unsigned long ulOffset); void __ubsan_handle_builtin_unreachable(struct CUnreachableData *pData); void __ubsan_handle_cfi_bad_type(struct CCFICheckFailData *pData, unsigned long ulVtable, bool bValidVtable, bool FromUnrecoverableHandler, unsigned long ProgramCounter, unsigned long FramePointer); void __ubsan_handle_cfi_check_fail(struct CCFICheckFailData *pData, unsigned long ulValue, unsigned long ulValidVtable); @@ -338,6 +346,7 @@ static void HandleMissingReturn(bool isFatal, struct C static void HandleNonnullArg(bool isFatal, struct CNonNullArgData *pData); static void HandleNonnullReturn(bool isFatal, struct CNonNullReturnData *pData, struct CSourceLocation *pLocationPointer); static void HandlePointerOverflow(bool isFatal, struct CPointerOverflowData *pData, unsigned long ulBase, unsigned long ulResult); +static void HandleAlignmentAssumption(bool isFatal, struct CAlignmentAssumptionData *pData, unsigned long ulPointer, unsigned long ulAlignment, unsigned long ulOffset); static void HandleOverflow(bool isFatal, struct COverflowData *pData, unsigned long ulLHS, unsigned long ulRHS, const char *szOperation) @@ -690,6 +699,34 @@ HandlePointerOverflow(bool isFatal, struct CPointerOve szLocation, ulBase, ulResult); } +static void +HandleAlignmentAssumption(bool isFatal, struct CAlignmentAssumptionData *pData, unsigned long ulPointer, unsigned long ulAlignment, unsigned long ulOffset) +{ + char szLocation[LOCATION_MAXLEN]; + char szAssumptionLocation[LOCATION_MAXLEN]; + unsigned long ulRealPointer; + + ASSERT(pData); + + if (isAlreadyReported(&pData->mLocation)) + return; + + DeserializeLocation(szLocation, LOCATION_MAXLEN, &pData->mLocation); + + ulRealPointer = ulPointer - ulOffset; + + if (pData->mAssumptionLocation.mFilename != NULL) { + DeserializeLocation(szAssumptionLocation, LOCATION_MAXLEN, + &pData->mAssumptionLocation); + Report(isFatal, "UBSan: Undefined Behavior in %s, alignment assumption of %#lx for pointer %#lx (offset %#lx), asumption made in %s\n", + szLocation, ulAlignment, ulRealPointer, ulOffset, + szAssumptionLocation); + } else { + Report(isFatal, "UBSan: Undefined Behavior in %s, alignment assumption of %#lx for pointer %#lx (offset %#lx)\n", + szLocation, ulAlignment, ulRealPointer, ulOffset); + } +} + /* Definions of public symbols emitted by the instrumentation code */ void __ubsan_handle_add_overflow(struct COverflowData *pData, unsigned long ulLHS, unsigned long ulRHS) @@ -707,6 +744,24 @@ __ubsan_handle_add_overflow_abort(struct COverflowData ASSERT(pData); HandleOverflow(true, pData, ulLHS, ulRHS, PLUS_STRING); +} + +void +__ubsan_handle_alignment_assumption(struct CAlignmentAssumptionData *pData, unsigned long ulPointer, unsigned long ulAlignment, unsigned long ulOffset) +{ + + ASSERT(pData); + + HandleAlignmentAssumption(false, pData, ulPointer, ulAlignment, ulOffset); +} + +void +__ubsan_handle_alignment_assumption_abort(struct CAlignmentAssumptionData *pData, unsigned long ulPointer, unsigned long ulAlignment, unsigned long ulOffset) +{ + + ASSERT(pData); + + HandleAlignmentAssumption(true, pData, ulPointer, ulAlignment, ulOffset); } void From owner-svn-src-head@freebsd.org Tue May 28 10:56:00 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 163FA15BE17E; Tue, 28 May 2019 10:56:00 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id B11FF736B3; Tue, 28 May 2019 10:55:59 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 8BD16195F0; Tue, 28 May 2019 10:55:59 +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 x4SAtxD1068040; Tue, 28 May 2019 10:55:59 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4SAtx9s068039; Tue, 28 May 2019 10:55:59 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201905281055.x4SAtx9s068039@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Tue, 28 May 2019 10:55:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r348323 - head/sys/sys X-SVN-Group: head X-SVN-Commit-Author: andrew X-SVN-Commit-Paths: head/sys/sys X-SVN-Commit-Revision: 348323 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: B11FF736B3 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.95)[-0.947,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 28 May 2019 10:56:00 -0000 Author: andrew Date: Tue May 28 10:55:59 2019 New Revision: 348323 URL: https://svnweb.freebsd.org/changeset/base/348323 Log: The alignment is passed into contigmalloc_domainset in the 7th argument. KUBSAN was complaining the pointer contigmalloc_domainset returned was misaligned. Fix this by using the correct argument to find the alignment in the function signature. Reported by: KUBSAN MFC after: 2 weeks Sponsored by: DARPA, AFRL Modified: head/sys/sys/malloc.h Modified: head/sys/sys/malloc.h ============================================================================== --- head/sys/sys/malloc.h Tue May 28 09:12:15 2019 (r348322) +++ head/sys/sys/malloc.h Tue May 28 10:55:59 2019 (r348323) @@ -177,7 +177,7 @@ void *contigmalloc(unsigned long size, struct malloc_t void *contigmalloc_domainset(unsigned long size, struct malloc_type *type, struct domainset *ds, int flags, vm_paddr_t low, vm_paddr_t high, unsigned long alignment, vm_paddr_t boundary) - __malloc_like __result_use_check __alloc_size(1) __alloc_align(6); + __malloc_like __result_use_check __alloc_size(1) __alloc_align(7); void free(void *addr, struct malloc_type *type); void free_domain(void *addr, struct malloc_type *type); void *malloc(size_t size, struct malloc_type *type, int flags) __malloc_like From owner-svn-src-head@freebsd.org Tue May 28 11:45:01 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7274915BF4C5; Tue, 28 May 2019 11:45:01 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 0B7CB75A6B; Tue, 28 May 2019 11:45:01 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B665D19E3B; Tue, 28 May 2019 11:45:00 +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 x4SBj0mo094549; Tue, 28 May 2019 11:45:00 GMT (envelope-from ae@FreeBSD.org) Received: (from ae@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4SBj0Yj094548; Tue, 28 May 2019 11:45:00 GMT (envelope-from ae@FreeBSD.org) Message-Id: <201905281145.x4SBj0Yj094548@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ae set sender to ae@FreeBSD.org using -f From: "Andrey V. Elsukov" Date: Tue, 28 May 2019 11:45:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r348324 - head/sys/net X-SVN-Group: head X-SVN-Commit-Author: ae X-SVN-Commit-Paths: head/sys/net X-SVN-Commit-Revision: 348324 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 0B7CB75A6B X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.95)[-0.948,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 28 May 2019 11:45:01 -0000 Author: ae Date: Tue May 28 11:45:00 2019 New Revision: 348324 URL: https://svnweb.freebsd.org/changeset/base/348324 Log: Rework r348303 to reduce the time of holding global BPF lock. It appeared that using NET_EPOCH_WAIT() while holding global BPF lock can lead to another panic: spin lock 0xfffff800183c9840 (turnstile lock) held by 0xfffff80018e2c5a0 (tid 100325) too long panic: spin lock held too long ... #0 sched_switch (td=0xfffff80018e2c5a0, newtd=0xfffff8000389e000, flags=) at /usr/src/sys/kern/sched_ule.c:2133 #1 0xffffffff80bf9912 in mi_switch (flags=256, newtd=0x0) at /usr/src/sys/kern/kern_synch.c:439 #2 0xffffffff80c21db7 in sched_bind (td=, cpu=) at /usr/src/sys/kern/sched_ule.c:2704 #3 0xffffffff80c34c33 in epoch_block_handler_preempt (global=, cr=0xfffffe00005a1a00, arg=) at /usr/src/sys/kern/subr_epoch.c:394 #4 0xffffffff803c741b in epoch_block (global=, cr=, cb=, ct=) at /usr/src/sys/contrib/ck/src/ck_epoch.c:416 #5 ck_epoch_synchronize_wait (global=0xfffff8000380cd80, cb=, ct=) at /usr/src/sys/contrib/ck/src/ck_epoch.c:465 #6 0xffffffff80c3475e in epoch_wait_preempt (epoch=0xfffff8000380cd80) at /usr/src/sys/kern/subr_epoch.c:513 #7 0xffffffff80ce970b in bpf_detachd_locked (d=0xfffff801d309cc00, detached_ifp=) at /usr/src/sys/net/bpf.c:856 #8 0xffffffff80ced166 in bpf_detachd (d=) at /usr/src/sys/net/bpf.c:836 #9 bpf_dtor (data=0xfffff801d309cc00) at /usr/src/sys/net/bpf.c:914 To fix this add the check to the catchpacket() that BPF descriptor was not detached just before we acquired BPFD_LOCK(). Reported by: slavash Tested by: slavash MFC after: 1 week Modified: head/sys/net/bpf.c Modified: head/sys/net/bpf.c ============================================================================== --- head/sys/net/bpf.c Tue May 28 10:55:59 2019 (r348323) +++ head/sys/net/bpf.c Tue May 28 11:45:00 2019 (r348324) @@ -850,15 +850,10 @@ bpf_detachd_locked(struct bpf_d *d, bool detached_ifp) /* Check if descriptor is attached */ if ((bp = d->bd_bif) == NULL) return; - /* - * Remove d from the interface's descriptor list. - * And wait until bpf_[m]tap*() will finish their possible work - * with descriptor. - */ - CK_LIST_REMOVE(d, bd_next); - NET_EPOCH_WAIT(); BPFD_LOCK(d); + /* Remove d from the interface's descriptor list. */ + CK_LIST_REMOVE(d, bd_next); /* Save bd_writer value */ error = d->bd_writer; ifp = bp->bif_ifp; @@ -2494,6 +2489,11 @@ catchpacket(struct bpf_d *d, u_char *pkt, u_int pktlen int tstype; BPFD_LOCK_ASSERT(d); + if (d->bd_bif == NULL) { + /* Descriptor was detached in concurrent thread */ + counter_u64_add(d->bd_dcount, 1); + return; + } /* * Detect whether user space has released a buffer back to us, and if From owner-svn-src-head@freebsd.org Tue May 28 14:34:19 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E503E159E9FC; Tue, 28 May 2019 14:34:18 +0000 (UTC) (envelope-from danfe@freebsd.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2610:1c1:1:6074::16:84]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "freefall.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 85F2383D5C; Tue, 28 May 2019 14:34:18 +0000 (UTC) (envelope-from danfe@freebsd.org) Received: by freefall.freebsd.org (Postfix, from userid 1033) id 5AE1ADD04; Tue, 28 May 2019 14:34:18 +0000 (UTC) Date: Tue, 28 May 2019 14:34:18 +0000 From: Alexey Dokuchaev To: rgrimes@freebsd.org Cc: Konstantin Belousov , svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r232071 - head/sys/vm Message-ID: <20190528143418.GA86669@FreeBSD.org> References: <20190527164056.GA17917@FreeBSD.org> <201905272134.x4RLY9oO012473@gndrsh.dnsmgr.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201905272134.x4RLY9oO012473@gndrsh.dnsmgr.net> User-Agent: Mutt/1.11.4 (2019-03-13) X-Rspamd-Queue-Id: 85F2383D5C X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.92 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; REPLY(-4.00)[]; NEURAL_HAM_SHORT(-0.92)[-0.925,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 28 May 2019 14:34:19 -0000 On Mon, May 27, 2019 at 02:34:09PM -0700, Rodney W. Grimes wrote: > I do not at all mean to discourage what you are doing, it is good to go > over static analysis reports, the problem is that there are often many > false positives, There are tons of them indeed, but that's normal for any static analysis tool. I've attempted to clean up the original log by ignoring the most noisy and dubious diagnostics and maintaining false positives list, starting with the ones pointed out by kib@. > It would be nice if we had a "team" that looked at all the Coverity > data, and any other data like what you have offered up here. Part of > the problem is that few want to do that work, or those that do want to > think it is low hanging fruit that anyone can do. That's exactly right, generating the check log is easy, finding people motivated enough to triage it (or finding the motivation within oneself) is tough. Maybe this ~2.4k line log would attract more interest than the first raw, full >16k line one: freefall:/home/danfe/pvs-kernel-filtered-2019-05-28.log.xz I'd appreciate if experts in their areas (cam/scsi, dev drivers, geom, kern, netinet, nfs, etc.) glanced over and see if they might help with anything there. If you find a false positive, please tell me so I can add it to the ignore list. Thanks! ./danfe From owner-svn-src-head@freebsd.org Tue May 28 15:47:01 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4F67815A3C1D; Tue, 28 May 2019 15:47:01 +0000 (UTC) (envelope-from dougm@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id D9604861B5; Tue, 28 May 2019 15:47:00 +0000 (UTC) (envelope-from dougm@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B46AE1C6CE; Tue, 28 May 2019 15:47:00 +0000 (UTC) (envelope-from dougm@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x4SFl0FP019476; Tue, 28 May 2019 15:47:00 GMT (envelope-from dougm@FreeBSD.org) Received: (from dougm@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4SFl0uD019474; Tue, 28 May 2019 15:47:00 GMT (envelope-from dougm@FreeBSD.org) Message-Id: <201905281547.x4SFl0uD019474@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dougm set sender to dougm@FreeBSD.org using -f From: Doug Moore Date: Tue, 28 May 2019 15:47:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r348327 - in head/sys: arm/include conf X-SVN-Group: head X-SVN-Commit-Author: dougm X-SVN-Commit-Paths: in head/sys: arm/include conf X-SVN-Commit-Revision: 348327 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: D9604861B5 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.97)[-0.965,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 28 May 2019 15:47:01 -0000 Author: dougm Date: Tue May 28 15:47:00 2019 New Revision: 348327 URL: https://svnweb.freebsd.org/changeset/base/348327 Log: Implement the ffs and fls functions, and their longer counterparts, in cpufunc, in terms of __builtin_ffs and the like, for arm32 v6 and v7 architectures, and use those, rather than the simple libkern implementations, in building arm32 kernels. Reviewed by: manu Approved by: kib, markj (mentors) Tested by: iz-rpi03_hs-karlsruhe.de, mikael.urankar_gmail.com, ian Differential Revision: https://reviews.freebsd.org/D20412 Modified: head/sys/arm/include/cpufunc.h head/sys/conf/files.arm Modified: head/sys/arm/include/cpufunc.h ============================================================================== --- head/sys/arm/include/cpufunc.h Tue May 28 14:17:03 2019 (r348326) +++ head/sys/arm/include/cpufunc.h Tue May 28 15:47:00 2019 (r348327) @@ -359,6 +359,64 @@ extern u_int arm_cache_level; extern u_int arm_cache_loc; extern u_int arm_cache_type[14]; +#if __ARM_ARCH >= 6 +#define HAVE_INLINE_FFS + +static __inline __pure2 int +ffs(int mask) +{ + + return (__builtin_ffs(mask)); +} + +#define HAVE_INLINE_FFSL + +static __inline __pure2 int +ffsl(long mask) +{ + + return (__builtin_ffsl(mask)); +} + +#define HAVE_INLINE_FFSLL + +static __inline __pure2 int +ffsll(long long mask) +{ + + return (__builtin_ffsll(mask)); +} + +#define HAVE_INLINE_FLS + +static __inline __pure2 int +fls(int mask) +{ + + return (mask == 0 ? 0 : + 8 * sizeof(mask) - __builtin_clz((u_int)mask)); +} + +#define HAVE_INLINE_FLSL + +static __inline __pure2 int +flsl(long mask) +{ + + return (mask == 0 ? 0 : + 8 * sizeof(mask) - __builtin_clzl((u_long)mask)); +} + +#define HAVE_INLINE_FLSLL + +static __inline __pure2 int +flsll(long long mask) +{ + + return (mask == 0 ? 0 : + 8 * sizeof(mask) - __builtin_clzll((unsigned long long)mask)); +} +#endif #else /* !_KERNEL */ static __inline void Modified: head/sys/conf/files.arm ============================================================================== --- head/sys/conf/files.arm Tue May 28 14:17:03 2019 (r348326) +++ head/sys/conf/files.arm Tue May 28 15:47:00 2019 (r348327) @@ -129,7 +129,7 @@ kern/subr_devmap.c standard kern/subr_sfbuf.c standard libkern/arm/aeabi_unwind.c standard libkern/arm/divsi3.S standard -libkern/arm/ffs.S standard +libkern/arm/ffs.S optional !armv7 !armv6 libkern/arm/ldivmod.S standard libkern/arm/ldivmod_helper.c standard libkern/arm/memclr.S standard @@ -139,11 +139,11 @@ libkern/arm/muldi3.c standard libkern/ashldi3.c standard libkern/ashrdi3.c standard libkern/divdi3.c standard -libkern/ffsl.c standard -libkern/ffsll.c standard -libkern/fls.c standard -libkern/flsl.c standard -libkern/flsll.c standard +libkern/ffsl.c optional !armv7 !armv6 +libkern/ffsll.c optional !armv7 !armv6 +libkern/fls.c optional !armv7 !armv6 +libkern/flsl.c optional !armv7 !armv6 +libkern/flsll.c optional !armv7 !armv6 libkern/lshrdi3.c standard libkern/memcmp.c standard libkern/moddi3.c standard From owner-svn-src-head@freebsd.org Tue May 28 16:12:17 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D34C215A4A7B; Tue, 28 May 2019 16:12:17 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 72B6D87524; Tue, 28 May 2019 16:12:17 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 51F651CBE1; Tue, 28 May 2019 16:12:17 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x4SGCHUb035971; Tue, 28 May 2019 16:12:17 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4SGCHhY035970; Tue, 28 May 2019 16:12:17 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201905281612.x4SGCHhY035970@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Tue, 28 May 2019 16:12:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r348328 - head/sbin/bectl X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/sbin/bectl X-SVN-Commit-Revision: 348328 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 72B6D87524 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.95)[-0.946,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 28 May 2019 16:12:18 -0000 Author: kevans Date: Tue May 28 16:12:16 2019 New Revision: 348328 URL: https://svnweb.freebsd.org/changeset/base/348328 Log: bectl(8): Address Coverity complaints CID 1400451: case 0 is missing a break/return and falling through to the default case. waitpid(0, ...) makes little sense in the child, we likely wanted to terminate immediately. CID 1400453: size argument uses sizeof(char **) instead of sizeof(char *) and is assigned to a char **; sizeof's match but "this isn't a portable assumption". CID: 1400451, 1400453 MFC after: 3 days Modified: head/sbin/bectl/bectl_jail.c Modified: head/sbin/bectl/bectl_jail.c ============================================================================== --- head/sbin/bectl/bectl_jail.c Tue May 28 15:47:00 2019 (r348327) +++ head/sbin/bectl/bectl_jail.c Tue May 28 16:12:16 2019 (r348328) @@ -155,7 +155,7 @@ build_jailcmd(char ***argvp, bool interactive, int arg nargv += argc; } - jargv = *argvp = calloc(nargv, sizeof(jargv)); + jargv = *argvp = calloc(nargv, sizeof(*jargv)); if (jargv == NULL) err(2, "calloc"); @@ -346,6 +346,7 @@ bectl_cmd_jail(int argc, char *argv[]) case 0: execv("/usr/sbin/jail", jargv); fprintf(stderr, "bectl jail: failed to execute\n"); + return (1); default: waitpid(pid, NULL, 0); } From owner-svn-src-head@freebsd.org Tue May 28 16:32:06 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DF94D15A51A1; Tue, 28 May 2019 16:32:05 +0000 (UTC) (envelope-from mckusick@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 5EFD5881BA; Tue, 28 May 2019 16:32:05 +0000 (UTC) (envelope-from mckusick@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 2D03A1CF48; Tue, 28 May 2019 16:32:05 +0000 (UTC) (envelope-from mckusick@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x4SGW53t046669; Tue, 28 May 2019 16:32:05 GMT (envelope-from mckusick@FreeBSD.org) Received: (from mckusick@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4SGW4vf046666; Tue, 28 May 2019 16:32:04 GMT (envelope-from mckusick@FreeBSD.org) Message-Id: <201905281632.x4SGW4vf046666@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mckusick set sender to mckusick@FreeBSD.org using -f From: Kirk McKusick Date: Tue, 28 May 2019 16:32:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r348329 - head/sys/ufs/ffs X-SVN-Group: head X-SVN-Commit-Author: mckusick X-SVN-Commit-Paths: head/sys/ufs/ffs X-SVN-Commit-Revision: 348329 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 5EFD5881BA X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.95)[-0.948,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 28 May 2019 16:32:06 -0000 Author: mckusick Date: Tue May 28 16:32:04 2019 New Revision: 348329 URL: https://svnweb.freebsd.org/changeset/base/348329 Log: Convert use of UFS-specific #ifdef DEBUG to DIAGNOSTIC or INVARIANTS as appropriate. No functional change intended. Suggested-by: markj Modified: head/sys/ufs/ffs/ffs_alloc.c head/sys/ufs/ffs/ffs_snapshot.c head/sys/ufs/ffs/ffs_softdep.c head/sys/ufs/ffs/softdep.h Modified: head/sys/ufs/ffs/ffs_alloc.c ============================================================================== --- head/sys/ufs/ffs/ffs_alloc.c Tue May 28 16:12:16 2019 (r348328) +++ head/sys/ufs/ffs/ffs_alloc.c Tue May 28 16:32:04 2019 (r348329) @@ -492,8 +492,10 @@ static int maxclustersearch = 10; SYSCTL_INT(_vfs_ffs, OID_AUTO, maxclustersearch, CTLFLAG_RW, &maxclustersearch, 0, "max number of cylinder group to search for contigous blocks"); -#ifdef DEBUG -static volatile int prtrealloc = 0; +#ifdef DIAGNOSTIC +static int prtrealloc = 0; +SYSCTL_INT(_debug, OID_AUTO, ffs_prtrealloc, CTLFLAG_RW, &prtrealloc, 0, + "print out FFS filesystem block reallocation operations"); #endif int @@ -684,7 +686,7 @@ ffs_reallocblks_ufs1(ap) * block pointers in the inode and indirect blocks associated * with the file. */ -#ifdef DEBUG +#ifdef DIAGNOSTIC if (prtrealloc) printf("realloc: ino %ju, lbns %jd-%jd\n\told:", (uintmax_t)ip->i_number, @@ -703,7 +705,7 @@ ffs_reallocblks_ufs1(ap) if (dbtofsb(fs, buflist->bs_children[i]->b_blkno) != *bap) panic("ffs_reallocblks: alloc mismatch"); #endif -#ifdef DEBUG +#ifdef DIAGNOSTIC if (prtrealloc) printf(" %d,", *bap); #endif @@ -752,7 +754,7 @@ ffs_reallocblks_ufs1(ap) /* * Last, free the old blocks and assign the new blocks to the buffers. */ -#ifdef DEBUG +#ifdef DIAGNOSTIC if (prtrealloc) printf("\n\tnew:"); #endif @@ -783,12 +785,12 @@ ffs_reallocblks_ufs1(ap) if (!ffs_checkblk(ip, dbtofsb(fs, bp->b_blkno), fs->fs_bsize)) panic("ffs_reallocblks: unallocated block 3"); #endif -#ifdef DEBUG +#ifdef DIAGNOSTIC if (prtrealloc) printf(" %d,", blkno); #endif } -#ifdef DEBUG +#ifdef DIAGNOSTIC if (prtrealloc) { prtrealloc--; printf("\n"); @@ -949,7 +951,7 @@ ffs_reallocblks_ufs2(ap) * block pointers in the inode and indirect blocks associated * with the file. */ -#ifdef DEBUG +#ifdef DIAGNOSTIC if (prtrealloc) printf("realloc: ino %ju, lbns %jd-%jd\n\told:", (uintmax_t)ip->i_number, (intmax_t)start_lbn, (intmax_t)end_lbn); @@ -967,7 +969,7 @@ ffs_reallocblks_ufs2(ap) if (dbtofsb(fs, buflist->bs_children[i]->b_blkno) != *bap) panic("ffs_reallocblks: alloc mismatch"); #endif -#ifdef DEBUG +#ifdef DIAGNOSTIC if (prtrealloc) printf(" %jd,", (intmax_t)*bap); #endif @@ -1016,7 +1018,7 @@ ffs_reallocblks_ufs2(ap) /* * Last, free the old blocks and assign the new blocks to the buffers. */ -#ifdef DEBUG +#ifdef DIAGNOSTIC if (prtrealloc) printf("\n\tnew:"); #endif @@ -1047,12 +1049,12 @@ ffs_reallocblks_ufs2(ap) if (!ffs_checkblk(ip, dbtofsb(fs, bp->b_blkno), fs->fs_bsize)) panic("ffs_reallocblks: unallocated block 3"); #endif -#ifdef DEBUG +#ifdef DIAGNOSTIC if (prtrealloc) printf(" %jd,", (intmax_t)blkno); #endif } -#ifdef DEBUG +#ifdef DIAGNOSTIC if (prtrealloc) { prtrealloc--; printf("\n"); @@ -3125,11 +3127,11 @@ static SYSCTL_NODE(_vfs_ffs, FFS_SET_INODE, setinode, static SYSCTL_NODE(_vfs_ffs, FFS_SET_BUFOUTPUT, setbufoutput, CTLFLAG_WR, sysctl_ffs_fsck, "Set Buffered Writing for Descriptor"); -#define DEBUG 1 -#ifdef DEBUG +#ifdef DIAGNOSTIC static int fsckcmds = 0; -SYSCTL_INT(_debug, OID_AUTO, fsckcmds, CTLFLAG_RW, &fsckcmds, 0, ""); -#endif /* DEBUG */ +SYSCTL_INT(_debug, OID_AUTO, ffs_fsckcmds, CTLFLAG_RW, &fsckcmds, 0, + "print out fsck_ffs-based filesystem update commands"); +#endif /* DIAGNOSTIC */ static int buffered_write(struct file *, struct uio *, struct ucred *, int, struct thread *); @@ -3186,11 +3188,11 @@ sysctl_ffs_fsck(SYSCTL_HANDLER_ARGS) switch (oidp->oid_number) { case FFS_SET_FLAGS: -#ifdef DEBUG +#ifdef DIAGNOSTIC if (fsckcmds) printf("%s: %s flags\n", mp->mnt_stat.f_mntonname, cmd.size > 0 ? "set" : "clear"); -#endif /* DEBUG */ +#endif /* DIAGNOSTIC */ if (cmd.size > 0) fs->fs_flags |= (long)cmd.value; else @@ -3198,13 +3200,13 @@ sysctl_ffs_fsck(SYSCTL_HANDLER_ARGS) break; case FFS_ADJ_REFCNT: -#ifdef DEBUG +#ifdef DIAGNOSTIC if (fsckcmds) { printf("%s: adjust inode %jd link count by %jd\n", mp->mnt_stat.f_mntonname, (intmax_t)cmd.value, (intmax_t)cmd.size); } -#endif /* DEBUG */ +#endif /* DIAGNOSTIC */ if ((error = ffs_vget(mp, (ino_t)cmd.value, LK_EXCLUSIVE, &vp))) break; ip = VTOI(vp); @@ -3219,13 +3221,13 @@ sysctl_ffs_fsck(SYSCTL_HANDLER_ARGS) break; case FFS_ADJ_BLKCNT: -#ifdef DEBUG +#ifdef DIAGNOSTIC if (fsckcmds) { printf("%s: adjust inode %jd block count by %jd\n", mp->mnt_stat.f_mntonname, (intmax_t)cmd.value, (intmax_t)cmd.size); } -#endif /* DEBUG */ +#endif /* DIAGNOSTIC */ if ((error = ffs_vget(mp, (ino_t)cmd.value, LK_EXCLUSIVE, &vp))) break; ip = VTOI(vp); @@ -3236,13 +3238,13 @@ sysctl_ffs_fsck(SYSCTL_HANDLER_ARGS) break; case FFS_SET_SIZE: -#ifdef DEBUG +#ifdef DIAGNOSTIC if (fsckcmds) { printf("%s: set inode %jd size to %jd\n", mp->mnt_stat.f_mntonname, (intmax_t)cmd.value, (intmax_t)cmd.size); } -#endif /* DEBUG */ +#endif /* DIAGNOSTIC */ if ((error = ffs_vget(mp, (ino_t)cmd.value, LK_EXCLUSIVE, &vp))) break; ip = VTOI(vp); @@ -3257,7 +3259,7 @@ sysctl_ffs_fsck(SYSCTL_HANDLER_ARGS) /* fall through */ case FFS_FILE_FREE: -#ifdef DEBUG +#ifdef DIAGNOSTIC if (fsckcmds) { if (cmd.size == 1) printf("%s: free %s inode %ju\n", @@ -3271,7 +3273,7 @@ sysctl_ffs_fsck(SYSCTL_HANDLER_ARGS) (uintmax_t)cmd.value, (uintmax_t)(cmd.value + cmd.size - 1)); } -#endif /* DEBUG */ +#endif /* DIAGNOSTIC */ while (cmd.size > 0) { if ((error = ffs_freefile(ump, fs, ump->um_devvp, cmd.value, filetype, NULL))) @@ -3282,7 +3284,7 @@ sysctl_ffs_fsck(SYSCTL_HANDLER_ARGS) break; case FFS_BLK_FREE: -#ifdef DEBUG +#ifdef DIAGNOSTIC if (fsckcmds) { if (cmd.size == 1) printf("%s: free block %jd\n", @@ -3294,7 +3296,7 @@ sysctl_ffs_fsck(SYSCTL_HANDLER_ARGS) (intmax_t)cmd.value, (intmax_t)cmd.value + cmd.size - 1); } -#endif /* DEBUG */ +#endif /* DIAGNOSTIC */ blkno = cmd.value; blkcnt = cmd.size; blksize = fs->fs_frag - (blkno % fs->fs_frag); @@ -3317,62 +3319,62 @@ sysctl_ffs_fsck(SYSCTL_HANDLER_ARGS) * submit deltas when necessary. */ case FFS_ADJ_NDIR: -#ifdef DEBUG +#ifdef DIAGNOSTIC if (fsckcmds) { printf("%s: adjust number of directories by %jd\n", mp->mnt_stat.f_mntonname, (intmax_t)cmd.value); } -#endif /* DEBUG */ +#endif /* DIAGNOSTIC */ fs->fs_cstotal.cs_ndir += cmd.value; break; case FFS_ADJ_NBFREE: -#ifdef DEBUG +#ifdef DIAGNOSTIC if (fsckcmds) { printf("%s: adjust number of free blocks by %+jd\n", mp->mnt_stat.f_mntonname, (intmax_t)cmd.value); } -#endif /* DEBUG */ +#endif /* DIAGNOSTIC */ fs->fs_cstotal.cs_nbfree += cmd.value; break; case FFS_ADJ_NIFREE: -#ifdef DEBUG +#ifdef DIAGNOSTIC if (fsckcmds) { printf("%s: adjust number of free inodes by %+jd\n", mp->mnt_stat.f_mntonname, (intmax_t)cmd.value); } -#endif /* DEBUG */ +#endif /* DIAGNOSTIC */ fs->fs_cstotal.cs_nifree += cmd.value; break; case FFS_ADJ_NFFREE: -#ifdef DEBUG +#ifdef DIAGNOSTIC if (fsckcmds) { printf("%s: adjust number of free frags by %+jd\n", mp->mnt_stat.f_mntonname, (intmax_t)cmd.value); } -#endif /* DEBUG */ +#endif /* DIAGNOSTIC */ fs->fs_cstotal.cs_nffree += cmd.value; break; case FFS_ADJ_NUMCLUSTERS: -#ifdef DEBUG +#ifdef DIAGNOSTIC if (fsckcmds) { printf("%s: adjust number of free clusters by %+jd\n", mp->mnt_stat.f_mntonname, (intmax_t)cmd.value); } -#endif /* DEBUG */ +#endif /* DIAGNOSTIC */ fs->fs_cstotal.cs_numclusters += cmd.value; break; case FFS_SET_CWD: -#ifdef DEBUG +#ifdef DIAGNOSTIC if (fsckcmds) { printf("%s: set current directory to inode %jd\n", mp->mnt_stat.f_mntonname, (intmax_t)cmd.value); } -#endif /* DEBUG */ +#endif /* DIAGNOSTIC */ if ((error = ffs_vget(mp, (ino_t)cmd.value, LK_SHARED, &vp))) break; AUDIT_ARG_VNODE1(vp); @@ -3385,13 +3387,13 @@ sysctl_ffs_fsck(SYSCTL_HANDLER_ARGS) break; case FFS_SET_DOTDOT: -#ifdef DEBUG +#ifdef DIAGNOSTIC if (fsckcmds) { printf("%s: change .. in cwd from %jd to %jd\n", mp->mnt_stat.f_mntonname, (intmax_t)cmd.value, (intmax_t)cmd.size); } -#endif /* DEBUG */ +#endif /* DIAGNOSTIC */ /* * First we have to get and lock the parent directory * to which ".." points. @@ -3420,7 +3422,7 @@ sysctl_ffs_fsck(SYSCTL_HANDLER_ARGS) break; case FFS_UNLINK: -#ifdef DEBUG +#ifdef DIAGNOSTIC if (fsckcmds) { char buf[32]; @@ -3429,7 +3431,7 @@ sysctl_ffs_fsck(SYSCTL_HANDLER_ARGS) printf("%s: unlink %s (inode %jd)\n", mp->mnt_stat.f_mntonname, buf, (intmax_t)cmd.size); } -#endif /* DEBUG */ +#endif /* DIAGNOSTIC */ /* * kern_funlinkat will do its own start/finish writes and * they do not nest, so drop ours here. Setting mp == NULL @@ -3447,12 +3449,12 @@ sysctl_ffs_fsck(SYSCTL_HANDLER_ARGS) error = EPERM; break; } -#ifdef DEBUG +#ifdef DIAGNOSTIC if (fsckcmds) { printf("%s: update inode %jd\n", mp->mnt_stat.f_mntonname, (intmax_t)cmd.value); } -#endif /* DEBUG */ +#endif /* DIAGNOSTIC */ if ((error = ffs_vget(mp, (ino_t)cmd.value, LK_EXCLUSIVE, &vp))) break; AUDIT_ARG_VNODE1(vp); @@ -3481,14 +3483,14 @@ sysctl_ffs_fsck(SYSCTL_HANDLER_ARGS) error = EINVAL; break; } -#ifdef DEBUG +#ifdef DIAGNOSTIC if (fsckcmds) { printf("%s: %s buffered output for descriptor %jd\n", mp->mnt_stat.f_mntonname, cmd.size == 1 ? "enable" : "disable", (intmax_t)cmd.value); } -#endif /* DEBUG */ +#endif /* DIAGNOSTIC */ if ((error = getvnode(td, cmd.value, cap_rights_init(&rights, CAP_FSCK), &vfp)) != 0) break; @@ -3513,12 +3515,12 @@ sysctl_ffs_fsck(SYSCTL_HANDLER_ARGS) break; default: -#ifdef DEBUG +#ifdef DIAGNOSTIC if (fsckcmds) { printf("Invalid request %d from fsck\n", oidp->oid_number); } -#endif /* DEBUG */ +#endif /* DIAGNOSTIC */ error = EINVAL; break; @@ -3582,12 +3584,12 @@ buffered_write(fp, uio, active_cred, flags, td) vput(vp); foffset_lock_uio(fp, uio, flags); vn_lock(devvp, LK_EXCLUSIVE | LK_RETRY); -#ifdef DEBUG +#ifdef DIAGNOSTIC if (fsckcmds) { printf("%s: buffered write for block %jd\n", fs->fs_fsmnt, (intmax_t)btodb(uio->uio_offset)); } -#endif /* DEBUG */ +#endif /* DIAGNOSTIC */ /* * All I/O must be contained within a filesystem block, start on * a fragment boundary, and be a multiple of fragments in length. Modified: head/sys/ufs/ffs/ffs_snapshot.c ============================================================================== --- head/sys/ufs/ffs/ffs_snapshot.c Tue May 28 16:12:16 2019 (r348328) +++ head/sys/ufs/ffs/ffs_snapshot.c Tue May 28 16:32:04 2019 (r348329) @@ -70,7 +70,6 @@ __FBSDID("$FreeBSD$"); #include #define KERNCRED thread0.td_ucred -#define DEBUG 1 #include "opt_ffs.h" @@ -185,7 +184,7 @@ static int ffs_bp_snapblk(struct vnode *, struct buf * */ int dopersistence = 0; -#ifdef DEBUG +#ifdef DIAGNOSTIC #include SYSCTL_INT(_debug, OID_AUTO, dopersistence, CTLFLAG_RW, &dopersistence, 0, ""); static int snapdebug = 0; @@ -193,7 +192,7 @@ SYSCTL_INT(_debug, OID_AUTO, snapdebug, CTLFLAG_RW, &s int collectsnapstats = 0; SYSCTL_INT(_debug, OID_AUTO, collectsnapstats, CTLFLAG_RW, &collectsnapstats, 0, ""); -#endif /* DEBUG */ +#endif /* DIAGNOSTIC */ /* * Create a snapshot file and initialize it for the filesystem. @@ -208,7 +207,6 @@ ffs_snapshot(mp, snapfile) int i, size, len, loc; ufs2_daddr_t blockno; uint64_t flag; - struct timespec starttime = {0, 0}, endtime; char saved_nice = 0; long redo = 0, snaplistsize = 0; int32_t *lp; @@ -225,6 +223,9 @@ ffs_snapshot(mp, snapfile) struct iovec aiov; struct snapdata *sn; struct ufsmount *ump; +#ifdef DIAGNOSTIC + struct timespec starttime = {0, 0}, endtime; +#endif ump = VFSTOUFS(mp); fs = ump->um_fs; @@ -441,8 +442,10 @@ restart: error = ENOENT; /* Snapshot file unlinked */ goto out1; } +#ifdef DIAGNOSTIC if (collectsnapstats) nanotime(&starttime); +#endif /* The last block might have changed. Copy it again to be sure. */ error = UFS_BALLOC(vp, lblktosize(fs, (off_t)(numblks - 1)), @@ -560,8 +563,10 @@ loop: continue; } VI_UNLOCK(xvp); +#ifdef DIAGNOSTIC if (snapdebug) vn_printf(xvp, "ffs_snapshot: busy vnode "); +#endif if (VOP_GETATTR(xvp, &vat, td->td_ucred) == 0 && vat.va_nlink > 0) { VOP_UNLOCK(xvp, 0); @@ -693,6 +698,7 @@ out1: * Resume operation on filesystem. */ vfs_write_resume(vp->v_mount, VR_START_WRITE | VR_NO_SUSPCLR); +#ifdef DIAGNOSTIC if (collectsnapstats && starttime.tv_sec > 0) { nanotime(&endtime); timespecsub(&endtime, &starttime, &endtime); @@ -700,6 +706,7 @@ out1: vp->v_mount->mnt_stat.f_mntonname, (long)endtime.tv_sec, endtime.tv_nsec / 1000000, redo, fs->fs_ncg); } +#endif if (copy_fs == NULL) goto out; /* @@ -1583,9 +1590,11 @@ ffs_snapgone(ip) break; if (xp != NULL) vrele(ITOV(ip)); +#ifdef DIAGNOSTIC else if (snapdebug) printf("ffs_snapgone: lost snapshot vnode %ju\n", (uintmax_t)ip->i_number); +#endif /* * Delete snapshot inode from superblock. Keep list dense. */ @@ -1849,7 +1858,7 @@ retry: * claim this block. */ if (size == fs->fs_bsize) { -#ifdef DEBUG +#ifdef DIAGNOSTIC if (snapdebug) printf("%s %ju lbn %jd from inum %ju\n", "Grabonremove: snapino", @@ -1894,7 +1903,7 @@ retry: td->td_pflags &= ~TDP_COWINPROGRESS; if (error) break; -#ifdef DEBUG +#ifdef DIAGNOSTIC if (snapdebug) printf("%s%ju lbn %jd %s %ju size %ld to blkno %jd\n", "Copyonremove: snapino ", (uintmax_t)ip->i_number, @@ -2384,7 +2393,7 @@ ffs_copyonwrite(devvp, bp) td->td_pflags &= ~TDP_COWINPROGRESS; if (error) break; -#ifdef DEBUG +#ifdef DIAGNOSTIC if (snapdebug) { printf("Copyonwrite: snapino %ju lbn %jd for ", (uintmax_t)ip->i_number, (intmax_t)lbn); Modified: head/sys/ufs/ffs/ffs_softdep.c ============================================================================== --- head/sys/ufs/ffs/ffs_softdep.c Tue May 28 16:12:16 2019 (r348328) +++ head/sys/ufs/ffs/ffs_softdep.c Tue May 28 16:32:04 2019 (r348329) @@ -48,13 +48,6 @@ __FBSDID("$FreeBSD$"); #include "opt_quota.h" #include "opt_ddb.h" -/* - * For now we want the safety net that the DEBUG flag provides. - */ -#ifndef DEBUG -#define DEBUG -#endif - #include #include #include @@ -998,7 +991,7 @@ MTX_SYSINIT(softdep_lock, &lk, "Global Softdep Lock", * Worklist queue management. * These routines require that the lock be held. */ -#ifndef /* NOT */ DEBUG +#ifndef /* NOT */ INVARIANTS #define WORKLIST_INSERT(head, item) do { \ (item)->wk_state |= ONWORKLIST; \ LIST_INSERT_HEAD(head, item, wk_list); \ @@ -1010,7 +1003,7 @@ MTX_SYSINIT(softdep_lock, &lk, "Global Softdep Lock", #define WORKLIST_INSERT_UNLOCKED WORKLIST_INSERT #define WORKLIST_REMOVE_UNLOCKED WORKLIST_REMOVE -#else /* DEBUG */ +#else /* INVARIANTS */ static void worklist_insert(struct workhead *, struct worklist *, int, const char *, int); static void worklist_remove(struct worklist *, int, const char *, int); @@ -1066,7 +1059,7 @@ worklist_remove(item, locked, func, line) item->wk_line = line; LIST_REMOVE(item, wk_list); } -#endif /* DEBUG */ +#endif /* INVARIANTS */ /* * Merge two jsegdeps keeping only the oldest one as newer references @@ -1187,7 +1180,7 @@ workitem_free(item, type) { struct ufsmount *ump; -#ifdef DEBUG +#ifdef INVARIANTS if (item->wk_state & ONWORKLIST) panic("workitem_free: %s(0x%X) still on list, " "added in function %s at line %d", @@ -2577,7 +2570,7 @@ softdep_mount(devvp, mp, fs, cred) fs->fs_cs(fs, cyl) = cgp->cg_cs; brelse(bp); } -#ifdef DEBUG +#ifdef INVARIANTS if (bcmp(&cstotal, &fs->fs_cstotal, sizeof cstotal)) printf("%s: superblock summary recomputed\n", fs->fs_fsmnt); #endif @@ -2899,7 +2892,7 @@ remove_from_journal(wk) ump = VFSTOUFS(wk->wk_mp); LOCK_OWNED(ump); -#ifdef SUJ_DEBUG +#ifdef INVARIANTS { struct worklist *wkn; @@ -5121,7 +5114,7 @@ softdep_setup_blkmapdep(bp, mp, newblkno, frags, oldfr jnewblk->jn_blkno = newblkno; jnewblk->jn_frags = frags; jnewblk->jn_oldfrags = oldfrags; -#ifdef SUJ_DEBUG +#ifdef INVARIANTS { struct cg *cgp; uint8_t *blksfree; @@ -8583,7 +8576,7 @@ softdep_setup_directory_add(bp, dp, diroffset, newinum * Link into parent directory pagedep to await its being written. */ pagedep_lookup(mp, bp, dp->i_number, lbn, DEPALLOC, &pagedep); -#ifdef DEBUG +#ifdef INVARIANTS if (diradd_lookup(pagedep, offset) != NULL) panic("softdep_setup_directory_add: %p already at off %d\n", diradd_lookup(pagedep, offset), offset); @@ -9314,7 +9307,7 @@ newdirrem(bp, dp, ip, isrmdir, prevdirremp) */ dirrem->dm_state |= COMPLETE; cancel_diradd(dap, dirrem, jremref, dotremref, dotdotremref); -#ifdef SUJ_DEBUG +#ifdef INVARIANTS if (isrmdir == 0) { struct worklist *wk; @@ -9958,13 +9951,15 @@ handle_workitem_freefile(freefile) { struct workhead wkhd; struct fs *fs; - struct inodedep *idp; struct ufsmount *ump; int error; +#ifdef INVARIANTS + struct inodedep *idp; +#endif ump = VFSTOUFS(freefile->fx_list.wk_mp); fs = ump->um_fs; -#ifdef DEBUG +#ifdef INVARIANTS ACQUIRE_LOCK(ump); error = inodedep_lookup(UFSTOVFS(ump), freefile->fx_oldinum, 0, &idp); FREE_LOCK(ump); @@ -10806,7 +10801,7 @@ softdep_setup_blkfree(mp, bp, blkno, frags, wkhd) struct ufsmount *ump; struct worklist *wk; struct fs *fs; -#ifdef SUJ_DEBUG +#ifdef INVARIANTS uint8_t *blksfree; struct cg *cgp; ufs2_daddr_t jstart; @@ -10845,7 +10840,7 @@ softdep_setup_blkfree(mp, bp, blkno, frags, wkhd) jnewblk = WK_JNEWBLK(wk); KASSERT(jnewblk->jn_state & GOINGAWAY, ("softdep_setup_blkfree: jnewblk not canceled.")); -#ifdef SUJ_DEBUG +#ifdef INVARIANTS /* * Assert that this block is free in the bitmap * before we discard the jnewblk. @@ -10869,7 +10864,7 @@ softdep_setup_blkfree(mp, bp, blkno, frags, wkhd) } } -#ifdef SUJ_DEBUG +#ifdef INVARIANTS /* * Assert that we are not freeing a block which has an outstanding * allocation dependency. @@ -11250,7 +11245,7 @@ handle_allocdirect_partdone(adp, wkhd) * be freed until they are moved to the current list. */ if (listadp == NULL) { -#ifdef DEBUG +#ifdef INVARIANTS if (adp->ad_state & EXTDATA) listhead = &inodedep->id_newextupdt; else @@ -11261,7 +11256,7 @@ handle_allocdirect_partdone(adp, wkhd) break; if (listadp == NULL) panic("handle_allocdirect_partdone: lost dep"); -#endif /* DEBUG */ +#endif /* INVARIANTS */ return; } /* Modified: head/sys/ufs/ffs/softdep.h ============================================================================== --- head/sys/ufs/ffs/softdep.h Tue May 28 16:12:16 2019 (r348328) +++ head/sys/ufs/ffs/softdep.h Tue May 28 16:32:04 2019 (r348329) @@ -213,7 +213,7 @@ struct worklist { struct mount *wk_mp; /* Mount we live in */ unsigned int wk_type:8, /* type of request */ wk_state:24; /* state flags */ -#ifdef DEBUG +#ifdef INVARIANTS const char *wk_func; /* func where added / removed */ int wk_line; /* line where added / removed */ #endif From owner-svn-src-head@freebsd.org Tue May 28 16:51:55 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1618515A58F7 for ; Tue, 28 May 2019 16:51:55 +0000 (UTC) (envelope-from mckusick@mckusick.com) Received: from chez.mckusick.com (chez.mckusick.com [70.36.157.235]) (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 7D8B988CF2; Tue, 28 May 2019 16:51:54 +0000 (UTC) (envelope-from mckusick@mckusick.com) Received: from chez.mckusick.com (localhost [IPv6:::1]) by chez.mckusick.com (8.15.2/8.15.2) with ESMTP id x4SH0aE2037260; Tue, 28 May 2019 10:00:37 -0700 (PDT) (envelope-from mckusick@mckusick.com) Message-Id: <201905281700.x4SH0aE2037260@chez.mckusick.com> From: Kirk McKusick To: Mark Johnston Subject: Re: svn commit: r348300 - head/sys/ufs/ffs cc: svn-src-head@freebsd.org X-URL: http://WWW.McKusick.COM/ Reply-To: Kirk McKusick In-reply-to: <20190527201500.GE82831@raichu> Comments: In-reply-to Mark Johnston message dated "Mon, 27 May 2019 16:15:00 -0400." MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <37258.1559062836.1@chez.mckusick.com> Content-Transfer-Encoding: quoted-printable Date: Tue, 28 May 2019 10:00:36 -0700 X-Spam-Status: No, score=-1.4 required=5.0 tests=BAYES_00,MISSING_MID, UNPARSEABLE_RELAY autolearn=no autolearn_force=no version=3.4.1 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on chez.mckusick.com X-Rspamd-Queue-Id: 7D8B988CF2 X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.87 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.87)[-0.866,0]; REPLY(-4.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 28 May 2019 16:51:55 -0000 > Date: Mon, 27 May 2019 16:15:00 -0400 > From: Mark Johnston > To: Kirk McKusick > Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, > svn-src-head@freebsd.org > Subject: Re: svn commit: r348300 - head/sys/ufs/ffs > = > On Mon, May 27, 2019 at 06:22:44AM +0000, Kirk McKusick wrote: >> Author: mckusick >> Date: Mon May 27 06:22:43 2019 >> New Revision: 348300 >> URL: https://svnweb.freebsd.org/changeset/base/348300 >> = >> Log: >> Add function name and line number debugging information to softupdate= s >> worklist structures to help track their movement between work lists. >> No functional change to the operation of soft updates intended. >> = >> Modified: >> head/sys/ufs/ffs/ffs_softdep.c >> head/sys/ufs/ffs/softdep.h >> = >> [...] >> Modified: head/sys/ufs/ffs/softdep.h >> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=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/ufs/ffs/softdep.h Mon May 27 04:20:31 2019 (r348299) >> +++ head/sys/ufs/ffs/softdep.h Mon May 27 06:22:43 2019 (r348300) >> @@ -213,6 +213,10 @@ struct worklist { >> struct mount *wk_mp; /* Mount we live in */ >> unsigned int wk_type:8, /* type of request */ >> wk_state:24; /* state flags */ >> +#ifdef DEBUG >> + const char *wk_func; /* func where added / removed */ >> + int wk_line; /* line where added / removed */ >> +#endif >> }; >> #define WK_DATA(wk) ((void *)(wk)) >> #define WK_PAGEDEP(wk) ((struct pagedep *)(wk)) > = > ffs_softdep.c defines DEBUG, while ffs_alloc.c (which includes > softdep.h) does not. A result of this is that the kernel's type info > used by DTrace contains two different definitions of struct worklist, > which has a sort of snowball effect since we end up with two definitions > of each structure containing a struct worklist *, and so on. > = > Could we turn DEBUG into a proper kernel configuration option so that > it's defined consistently everywhere, or just use INVARIANTS/DIAGNOSTIC > instead? I am happy to do the work if we can agree on a direction. > = > DEBUG is used only in the SU, snapshot and the block allocation code. > In ffs_alloc.c it is used to enable some debug printfs (which are > themselves conditionalized on a sysctl var). It is used similarly in > ffs_snapshot.c. In ffs_softdep.c (which also has SUJ_DEBUG) it enables > some consistency checking. INVARIANTS seems to me like a reasonable > option to use in ffs_softdep.c, and perhaps the others as well. Thanks for pointing out this problem. DEBUG is left over from the CSRG days (1980's :-) and should have been purged decades ago. I have converted its use in ffs_snapshot.c and ffs_alloc.c to DIAGNOSTIC. In ffs_softdep.c I have converted DEBUG and SUJ_DEBUG to INVARIANTS. Kirk From owner-svn-src-head@freebsd.org Tue May 28 17:31:36 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 04E3215A69D3; Tue, 28 May 2019 17:31:36 +0000 (UTC) (envelope-from mckusick@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 9369889F45; Tue, 28 May 2019 17:31:35 +0000 (UTC) (envelope-from mckusick@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 6BE091D852; Tue, 28 May 2019 17:31:35 +0000 (UTC) (envelope-from mckusick@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x4SHVZ6x075953; Tue, 28 May 2019 17:31:35 GMT (envelope-from mckusick@FreeBSD.org) Received: (from mckusick@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4SHVZld075952; Tue, 28 May 2019 17:31:35 GMT (envelope-from mckusick@FreeBSD.org) Message-Id: <201905281731.x4SHVZld075952@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mckusick set sender to mckusick@FreeBSD.org using -f From: Kirk McKusick Date: Tue, 28 May 2019 17:31:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r348330 - head/sys/ufs/ffs X-SVN-Group: head X-SVN-Commit-Author: mckusick X-SVN-Commit-Paths: head/sys/ufs/ffs X-SVN-Commit-Revision: 348330 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 9369889F45 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.97)[-0.968,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 28 May 2019 17:31:36 -0000 Author: mckusick Date: Tue May 28 17:31:35 2019 New Revision: 348330 URL: https://svnweb.freebsd.org/changeset/base/348330 Log: Add a missing bresle() in seldom-used error return. Modified: head/sys/ufs/ffs/ffs_softdep.c Modified: head/sys/ufs/ffs/ffs_softdep.c ============================================================================== --- head/sys/ufs/ffs/ffs_softdep.c Tue May 28 16:32:04 2019 (r348329) +++ head/sys/ufs/ffs/ffs_softdep.c Tue May 28 17:31:35 2019 (r348330) @@ -11055,15 +11055,13 @@ softdep_disk_write_complete(bp) "with outstanding dependencies for buffer %p", bp)); if (ump == NULL) return; - - sbp = NULL; - /* * If an error occurred while doing the write, then the data * has not hit the disk and the dependencies cannot be processed. * But we do have to go through and roll forward any dependencies * that were rolled back before the disk write. */ + sbp = NULL; ACQUIRE_LOCK(ump); if ((bp->b_ioflags & BIO_ERROR) != 0 && (bp->b_flags & B_INVAL) == 0) { LIST_FOREACH(wk, &bp->b_dep, wk_list) { @@ -11093,6 +11091,8 @@ softdep_disk_write_complete(bp) } } FREE_LOCK(ump); + if (sbp) + brelse(sbp); return; } LIST_INIT(&reattach); From owner-svn-src-head@freebsd.org Tue May 28 17:32:48 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DE44F15A6A57; Tue, 28 May 2019 17:32:47 +0000 (UTC) (envelope-from br@bsdpad.com) Received: from sc1.bsdpad.com (sc1.bsdpad.com [163.172.212.18]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D00338A256; Tue, 28 May 2019 17:32:45 +0000 (UTC) (envelope-from br@bsdpad.com) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=bsdpad.com; s=20190317; h=Subject:To:From; bh=zpSHr6YdWstlIlDA1f+x2QYZPY8k+fI4HcuWIKi4Ziw=; b=F3ILVqDkgdiWoqZ64FRLQs9Cvf HYYn7zmtAUnHu7aKuCCV6SuPMrz1K7zQxEiqNbNWc0EJ/r9SIEs/0v4g9327jmIvByXt7QdG//y1T sbepV2VigOO9NGtbGv+Ue/spUiDpBBYK+84NtJmB2jdjk5FtSXh6eEbCuUGrqlBJdLwPtoSs66uV8 jSXmFacpDmExyVVScABJobRibx+UpD5KUUOqT1Sg0ovhoFnXjp1A7WO9OaHjU2Ty7XjTmW/F7zMCX E0qsX3MfzknjP6ItHcTdBMKpDKZlxUA4saZYdRcj+GgvFNCmsQgA0rnJJFWdcJ2CWs9v5fULhsK/+ gniGi/9g==; Received: from localhost ([127.0.0.1] helo=bsdpad.com) by sc1.bsdpad.com with smtp (Exim 4.91 (FreeBSD)) (envelope-from ) id 1hVfwk-000Oco-Qs; Tue, 28 May 2019 18:31:34 +0100 Received: by bsdpad.com (nbSMTP-1.00) for uid 1001 br@bsdpad.com; Tue, 28 May 2019 18:31:34 +0100 (BST) Date: Tue, 28 May 2019 18:31:34 +0100 From: Ruslan Bukin To: Emmanuel Vadot Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r347930 - head/sys/dev/pci Message-ID: <20190528173134.GA94573@bsdpad.com> References: <201905171705.x4HH5HDR059483@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <201905171705.x4HH5HDR059483@repo.freebsd.org> User-Agent: Mutt/1.11.2 (2019-01-07) X-Rspamd-Queue-Id: D00338A256 X-Spamd-Bar: ----- Authentication-Results: mx1.freebsd.org; dkim=pass header.d=bsdpad.com header.s=20190317 header.b=F3ILVqDk; spf=pass (mx1.freebsd.org: domain of br@bsdpad.com designates 163.172.212.18 as permitted sender) smtp.mailfrom=br@bsdpad.com X-Spamd-Result: default: False [-5.94 / 15.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; R_DKIM_ALLOW(-0.20)[bsdpad.com:s=20190317]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; R_SPF_ALLOW(-0.20)[+mx]; TO_MATCH_ENVRCPT_ALL(0.00)[]; MIME_GOOD(-0.10)[text/plain]; DMARC_NA(0.00)[freebsd.org]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; TO_DN_SOME(0.00)[]; RCVD_COUNT_THREE(0.00)[3]; IP_SCORE(-2.83)[ip: (-9.26), ipnet: 163.172.208.0/20(-4.63), asn: 12876(-0.24), country: FR(-0.01)]; DKIM_TRACE(0.00)[bsdpad.com:+]; MX_GOOD(-0.01)[sc1.bsdpad.com]; NEURAL_HAM_SHORT(-0.90)[-0.899,0]; FORGED_SENDER(0.30)[br@freebsd.org,br@bsdpad.com]; MIME_TRACE(0.00)[0:+]; RCVD_TLS_LAST(0.00)[]; ASN(0.00)[asn:12876, ipnet:163.172.208.0/20, country:FR]; FROM_NEQ_ENVFROM(0.00)[br@freebsd.org,br@bsdpad.com] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 28 May 2019 17:32:48 -0000 On Fri, May 17, 2019 at 05:05:17PM +0000, Emmanuel Vadot wrote: > Author: manu > Date: Fri May 17 17:05:16 2019 > New Revision: 347930 > URL: https://svnweb.freebsd.org/changeset/base/347930 > > Log: > pci: ecam: Correctly parse memory and IO region > > When activating a resource do not compare the resource id to the adress. > Treat IO region as MEMORY region too. > > Submitted by: Tuan Phan (Original Version) > Sponsored by: Ampere Computing, LLC > Differential Revision: https://reviews.freebsd.org/D20214 > > Modified: > head/sys/dev/pci/pci_host_generic.c > head/sys/dev/pci/pci_host_generic_acpi.c > > Modified: head/sys/dev/pci/pci_host_generic_acpi.c > ============================================================================== > --- head/sys/dev/pci/pci_host_generic_acpi.c Fri May 17 17:04:01 2019 (r347929) > +++ head/sys/dev/pci/pci_host_generic_acpi.c Fri May 17 17:05:16 2019 (r347930) > @@ -293,7 +291,7 @@ pci_host_generic_acpi_attach(device_t dev) > continue; /* empty range element */ > if (sc->base.ranges[tuple].flags & FLAG_MEM) { > error = rman_manage_region(&sc->base.mem_rman, > - phys_base, phys_base + size - 1); > + pci_base, pci_base + size - 1); > } else if (sc->base.ranges[tuple].flags & FLAG_IO) { > error = rman_manage_region(&sc->base.io_rman, > pci_base + PCI_IO_WINDOW_OFFSET, > Don't we need to make a similar change to pci_host_generic_fdt.c ? Ruslan From owner-svn-src-head@freebsd.org Tue May 28 18:05:11 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C836C15A7489; Tue, 28 May 2019 18:05:11 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 6D0F68B0D8; Tue, 28 May 2019 18:05:11 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4637D1DEB8; Tue, 28 May 2019 18:05:11 +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 x4SI5BOp093955; Tue, 28 May 2019 18:05:11 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4SI5BUA093954; Tue, 28 May 2019 18:05:11 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201905281805.x4SI5BUA093954@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Tue, 28 May 2019 18:05:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r348331 - head/sys/dev/ath/ath_hal X-SVN-Group: head X-SVN-Commit-Author: adrian X-SVN-Commit-Paths: head/sys/dev/ath/ath_hal X-SVN-Commit-Revision: 348331 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 6D0F68B0D8 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.97)[-0.968,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 28 May 2019 18:05:12 -0000 Author: adrian Date: Tue May 28 18:05:10 2019 New Revision: 348331 URL: https://svnweb.freebsd.org/changeset/base/348331 Log: [ath_hal] Fix queue bits a bit Found by PVS Studio: duplicate assignment; add assignment of tqi_compBuf. Submitted by: Differential Revision: https://reviews.freebsd.org/D20431 Modified: head/sys/dev/ath/ath_hal/ah.c Modified: head/sys/dev/ath/ath_hal/ah.c ============================================================================== --- head/sys/dev/ath/ath_hal/ah.c Tue May 28 17:31:35 2019 (r348330) +++ head/sys/dev/ath/ath_hal/ah.c Tue May 28 18:05:10 2019 (r348331) @@ -1127,7 +1127,6 @@ ath_hal_getTxQProps(struct ath_hal *ah, return AH_FALSE; } - qInfo->tqi_qflags = qi->tqi_qflags; qInfo->tqi_ver = qi->tqi_ver; qInfo->tqi_subtype = qi->tqi_subtype; qInfo->tqi_qflags = qi->tqi_qflags; @@ -1141,6 +1140,7 @@ ath_hal_getTxQProps(struct ath_hal *ah, qInfo->tqi_cbrOverflowLimit = qi->tqi_cbrOverflowLimit; qInfo->tqi_burstTime = qi->tqi_burstTime; qInfo->tqi_readyTime = qi->tqi_readyTime; + qInfo->tqi_compBuf = qi->tqi_physCompBuf; return AH_TRUE; } From owner-svn-src-head@freebsd.org Tue May 28 18:32:05 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 11C7915A8196; Tue, 28 May 2019 18:32:05 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id AAF3B8C1FF; Tue, 28 May 2019 18:32:04 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 870DB1E3BA; Tue, 28 May 2019 18:32:04 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x4SIW4G9009698; Tue, 28 May 2019 18:32:04 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4SIW4wl009697; Tue, 28 May 2019 18:32:04 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201905281832.x4SIW4wl009697@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Tue, 28 May 2019 18:32:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r348332 - head/sys/dev/oce X-SVN-Group: head X-SVN-Commit-Author: mav X-SVN-Commit-Paths: head/sys/dev/oce X-SVN-Commit-Revision: 348332 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: AAF3B8C1FF X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.96)[-0.964,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 28 May 2019 18:32:05 -0000 Author: mav Date: Tue May 28 18:32:04 2019 New Revision: 348332 URL: https://svnweb.freebsd.org/changeset/base/348332 Log: Fix array out of bound panic introduced in r306219. As I see, different NICs in different configurations may have different numbers of TX and RX queues. The code was assuming 1:1 mapping between event queues (interrupts) and TX/RX queues. Since number of interrupts is set to maximum of TX and RX queues, when those two are different, the system is doomed. I have no documentation or deep knowledge about this hardware, so this change is based on general observations and code reading. If some of my guesses are wrong, please do better. I just confirmed HP NC550SFP NICs are working now. MFC after: 2 weeks Sponsored by: iXsystems, Inc. Modified: head/sys/dev/oce/oce_if.c Modified: head/sys/dev/oce/oce_if.c ============================================================================== --- head/sys/dev/oce/oce_if.c Tue May 28 18:05:10 2019 (r348331) +++ head/sys/dev/oce/oce_if.c Tue May 28 18:32:04 2019 (r348332) @@ -2394,10 +2394,20 @@ oce_eqd_set_periodic(POCE_SOFTC sc) goto modify_eqd; } - rq = sc->rq[i]; - rxpkts = rq->rx_stats.rx_pkts; - wq = sc->wq[i]; - tx_reqs = wq->tx_stats.tx_reqs; + if (i == 0) { + rq = sc->rq[0]; + rxpkts = rq->rx_stats.rx_pkts; + } else + rxpkts = 0; + if (i + 1 < sc->nrqs) { + rq = sc->rq[i + 1]; + rxpkts += rq->rx_stats.rx_pkts; + } + if (i < sc->nwqs) { + wq = sc->wq[i]; + tx_reqs = wq->tx_stats.tx_reqs; + } else + tx_reqs = 0; now = ticks; if (!aic->ticks || now < aic->ticks || From owner-svn-src-head@freebsd.org Tue May 28 20:44:24 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 186FF15AC155; Tue, 28 May 2019 20:44:24 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id B0F916A8AB; Tue, 28 May 2019 20:44:23 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 8B5B01F9BC; Tue, 28 May 2019 20:44:23 +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 x4SKiNdm078779; Tue, 28 May 2019 20:44:23 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4SKiNP7078778; Tue, 28 May 2019 20:44:23 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201905282044.x4SKiNP7078778@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: Conrad Meyer Date: Tue, 28 May 2019 20:44:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r348337 - head/share/man/man9 X-SVN-Group: head X-SVN-Commit-Author: cem X-SVN-Commit-Paths: head/share/man/man9 X-SVN-Commit-Revision: 348337 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: B0F916A8AB X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.98 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.98)[-0.977,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 28 May 2019 20:44:24 -0000 Author: cem Date: Tue May 28 20:44:23 2019 New Revision: 348337 URL: https://svnweb.freebsd.org/changeset/base/348337 Log: style.9: Correct usage's definition to match its declaration Suggested by: emaste Reviewed by: delphij, imp, rgrimes, vangyzen (earlier version) Sponsored by: Dell EMC Isilon Differential Revision: (part of D20448) Modified: head/share/man/man9/style.9 Modified: head/share/man/man9/style.9 ============================================================================== --- head/share/man/man9/style.9 Tue May 28 20:14:33 2019 (r348336) +++ head/share/man/man9/style.9 Tue May 28 20:44:23 2019 (r348337) @@ -26,7 +26,7 @@ .\" From: @(#)style 1.14 (Berkeley) 4/28/95 .\" $FreeBSD$ .\" -.Dd November 1, 2018 +.Dd May 28, 2019 .Dt STYLE 9 .Os .Sh NAME @@ -777,7 +777,7 @@ vaf(const char *fmt, ...) } static void -usage() +usage(void) { /* Insert an empty line if the function has no local variables. */ .Ed From owner-svn-src-head@freebsd.org Tue May 28 20:55:00 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 46AEE15AC418; Tue, 28 May 2019 20:55:00 +0000 (UTC) (envelope-from johalun@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id D8E8C6AED1; Tue, 28 May 2019 20:54:59 +0000 (UTC) (envelope-from johalun@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B36521FB63; Tue, 28 May 2019 20:54:59 +0000 (UTC) (envelope-from johalun@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x4SKsxen083780; Tue, 28 May 2019 20:54:59 GMT (envelope-from johalun@FreeBSD.org) Received: (from johalun@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4SKsxZ2083779; Tue, 28 May 2019 20:54:59 GMT (envelope-from johalun@FreeBSD.org) Message-Id: <201905282054.x4SKsxZ2083779@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: johalun set sender to johalun@FreeBSD.org using -f From: Johannes Lundberg Date: Tue, 28 May 2019 20:54:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r348338 - head/sys/fs/pseudofs X-SVN-Group: head X-SVN-Commit-Author: johalun X-SVN-Commit-Paths: head/sys/fs/pseudofs X-SVN-Commit-Revision: 348338 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: D8E8C6AED1 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.98 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.98)[-0.977,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 28 May 2019 20:55:00 -0000 Author: johalun Date: Tue May 28 20:54:59 2019 New Revision: 348338 URL: https://svnweb.freebsd.org/changeset/base/348338 Log: pseudofs: Ignore unsupported commands in vop_setattr. Users of pseudofs (e.g. lindebugfs), should be able to receive input from command line via commands like "echo 1 > /path/to/file". Currently this fails because sh tries to truncate the file first and vop_setattr returns not supported error for this. This patch simply ignores the error and returns 0 instead. Reviewed by: imp (mentor), asomers Approved by: imp (mentor), asomers MFC after: 1 week Differential Revision: D20451 Modified: head/sys/fs/pseudofs/pseudofs_vnops.c Modified: head/sys/fs/pseudofs/pseudofs_vnops.c ============================================================================== --- head/sys/fs/pseudofs/pseudofs_vnops.c Tue May 28 20:44:23 2019 (r348337) +++ head/sys/fs/pseudofs/pseudofs_vnops.c Tue May 28 20:54:59 2019 (r348338) @@ -967,7 +967,8 @@ pfs_setattr(struct vop_setattr_args *va) PFS_TRACE(("%s", pn->pn_name)); pfs_assert_not_owned(pn); - PFS_RETURN (EOPNOTSUPP); + /* Silently ignore unchangeable attributes. */ + PFS_RETURN (0); } /* From owner-svn-src-head@freebsd.org Tue May 28 21:54:14 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1581E15AD8E9; Tue, 28 May 2019 21:54:14 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 9CA3F6D010; Tue, 28 May 2019 21:54:13 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 761ED20593; Tue, 28 May 2019 21:54:13 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x4SLsDOr016092; Tue, 28 May 2019 21:54:13 GMT (envelope-from jkim@FreeBSD.org) Received: (from jkim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4SLsDLj016089; Tue, 28 May 2019 21:54:13 GMT (envelope-from jkim@FreeBSD.org) Message-Id: <201905282154.x4SLsDLj016089@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jkim set sender to jkim@FreeBSD.org using -f From: Jung-uk Kim Date: Tue, 28 May 2019 21:54:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r348340 - in head: crypto/openssl crypto/openssl/apps crypto/openssl/crypto crypto/openssl/crypto/aes/asm crypto/openssl/crypto/bio crypto/openssl/crypto/blake2 crypto/openssl/crypto/bn... X-SVN-Group: head X-SVN-Commit-Author: jkim X-SVN-Commit-Paths: in head: crypto/openssl crypto/openssl/apps crypto/openssl/crypto crypto/openssl/crypto/aes/asm crypto/openssl/crypto/bio crypto/openssl/crypto/blake2 crypto/openssl/crypto/bn crypto/openssl/crypto/bn... X-SVN-Commit-Revision: 348340 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 9CA3F6D010 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.96)[-0.964,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 28 May 2019 21:54:14 -0000 Author: jkim Date: Tue May 28 21:54:12 2019 New Revision: 348340 URL: https://svnweb.freebsd.org/changeset/base/348340 Log: Merge OpenSSL 1.1.1c. Modified: head/crypto/openssl/CHANGES head/crypto/openssl/Configure head/crypto/openssl/INSTALL head/crypto/openssl/NEWS head/crypto/openssl/NOTES.PERL head/crypto/openssl/README head/crypto/openssl/apps/asn1pars.c head/crypto/openssl/apps/cms.c head/crypto/openssl/apps/enc.c head/crypto/openssl/apps/ocsp.c head/crypto/openssl/apps/s_cb.c head/crypto/openssl/apps/s_client.c head/crypto/openssl/apps/speed.c head/crypto/openssl/crypto/aes/asm/aesp8-ppc.pl head/crypto/openssl/crypto/bio/b_addr.c head/crypto/openssl/crypto/bio/bss_mem.c head/crypto/openssl/crypto/blake2/blake2b.c head/crypto/openssl/crypto/bn/asm/mips.pl head/crypto/openssl/crypto/bn/asm/ppc.pl head/crypto/openssl/crypto/bn/bn_ctx.c head/crypto/openssl/crypto/bn/bn_lib.c head/crypto/openssl/crypto/bn/bn_prime.c head/crypto/openssl/crypto/chacha/build.info head/crypto/openssl/crypto/conf/conf_sap.c head/crypto/openssl/crypto/dh/dh_check.c head/crypto/openssl/crypto/dh/dh_gen.c head/crypto/openssl/crypto/dh/dh_key.c head/crypto/openssl/crypto/dh/dh_pmeth.c head/crypto/openssl/crypto/dsa/dsa_gen.c head/crypto/openssl/crypto/dsa/dsa_ossl.c head/crypto/openssl/crypto/dsa/dsa_pmeth.c head/crypto/openssl/crypto/dso/dso_openssl.c head/crypto/openssl/crypto/ec/curve25519.c head/crypto/openssl/crypto/ec/curve448/curve448.c head/crypto/openssl/crypto/ec/curve448/curve448_tables.c head/crypto/openssl/crypto/ec/curve448/curve448utils.h head/crypto/openssl/crypto/ec/curve448/f_generic.c head/crypto/openssl/crypto/ec/curve448/scalar.c head/crypto/openssl/crypto/ec/ec2_oct.c head/crypto/openssl/crypto/ec/ec2_smpl.c head/crypto/openssl/crypto/ec/ec_ameth.c head/crypto/openssl/crypto/ec/ec_lib.c head/crypto/openssl/crypto/ec/ec_mult.c head/crypto/openssl/crypto/ec/ec_pmeth.c head/crypto/openssl/crypto/ec/ecdh_ossl.c head/crypto/openssl/crypto/ec/ecp_nistp521.c head/crypto/openssl/crypto/ec/ecp_nistz256.c head/crypto/openssl/crypto/ec/ecp_smpl.c head/crypto/openssl/crypto/err/err.c head/crypto/openssl/crypto/evp/digest.c head/crypto/openssl/crypto/evp/e_aes.c head/crypto/openssl/crypto/evp/e_aria.c head/crypto/openssl/crypto/evp/e_chacha20_poly1305.c head/crypto/openssl/crypto/evp/p_lib.c head/crypto/openssl/crypto/evp/p_open.c head/crypto/openssl/crypto/hmac/hmac.c head/crypto/openssl/crypto/include/internal/dso_conf.h head/crypto/openssl/crypto/include/internal/dso_conf.h.in head/crypto/openssl/crypto/init.c head/crypto/openssl/crypto/mips_arch.h head/crypto/openssl/crypto/modes/asm/ghash-x86_64.pl head/crypto/openssl/crypto/modes/ccm128.c head/crypto/openssl/crypto/o_str.c head/crypto/openssl/crypto/objects/obj_dat.h head/crypto/openssl/crypto/objects/objects.txt head/crypto/openssl/crypto/ocsp/ocsp_ext.c head/crypto/openssl/crypto/ocsp/ocsp_lib.c head/crypto/openssl/crypto/pem/pem_sign.c head/crypto/openssl/crypto/poly1305/build.info head/crypto/openssl/crypto/ppccap.c head/crypto/openssl/crypto/rand/drbg_lib.c head/crypto/openssl/crypto/rand/rand_lib.c head/crypto/openssl/crypto/rand/rand_unix.c head/crypto/openssl/crypto/rand/randfile.c head/crypto/openssl/crypto/rc4/build.info head/crypto/openssl/crypto/rsa/rsa_ameth.c head/crypto/openssl/crypto/rsa/rsa_gen.c head/crypto/openssl/crypto/rsa/rsa_oaep.c head/crypto/openssl/crypto/rsa/rsa_ossl.c head/crypto/openssl/crypto/rsa/rsa_pk1.c head/crypto/openssl/crypto/rsa/rsa_pmeth.c head/crypto/openssl/crypto/rsa/rsa_ssl.c head/crypto/openssl/crypto/rsa/rsa_x931g.c head/crypto/openssl/crypto/sha/keccak1600.c head/crypto/openssl/crypto/x509/x509_lu.c head/crypto/openssl/crypto/x509v3/v3_genn.c head/crypto/openssl/doc/man1/genpkey.pod head/crypto/openssl/doc/man1/pkeyutl.pod head/crypto/openssl/doc/man1/s_client.pod head/crypto/openssl/doc/man1/s_server.pod head/crypto/openssl/doc/man1/s_time.pod head/crypto/openssl/doc/man1/ts.pod head/crypto/openssl/doc/man3/ASN1_TIME_set.pod head/crypto/openssl/doc/man3/ASN1_generate_nconf.pod head/crypto/openssl/doc/man3/BIO_connect.pod head/crypto/openssl/doc/man3/BIO_push.pod head/crypto/openssl/doc/man3/BIO_s_file.pod head/crypto/openssl/doc/man3/BIO_s_mem.pod head/crypto/openssl/doc/man3/BN_CTX_start.pod head/crypto/openssl/doc/man3/BN_new.pod head/crypto/openssl/doc/man3/BN_rand.pod head/crypto/openssl/doc/man3/BN_security_bits.pod head/crypto/openssl/doc/man3/CMS_verify.pod head/crypto/openssl/doc/man3/CONF_modules_load_file.pod head/crypto/openssl/doc/man3/DES_random_key.pod head/crypto/openssl/doc/man3/ECDSA_SIG_new.pod head/crypto/openssl/doc/man3/EVP_DigestVerifyInit.pod head/crypto/openssl/doc/man3/EVP_EncryptInit.pod head/crypto/openssl/doc/man3/EVP_PKEY_meth_new.pod head/crypto/openssl/doc/man3/EVP_PKEY_set1_RSA.pod head/crypto/openssl/doc/man3/EVP_chacha20.pod head/crypto/openssl/doc/man3/HMAC.pod head/crypto/openssl/doc/man3/OBJ_nid2obj.pod head/crypto/openssl/doc/man3/OCSP_cert_to_id.pod head/crypto/openssl/doc/man3/PEM_read_bio_PrivateKey.pod head/crypto/openssl/doc/man3/RAND_DRBG_generate.pod head/crypto/openssl/doc/man3/RAND_DRBG_get0_master.pod head/crypto/openssl/doc/man3/RAND_DRBG_new.pod head/crypto/openssl/doc/man3/RAND_DRBG_reseed.pod head/crypto/openssl/doc/man3/RAND_DRBG_set_callbacks.pod head/crypto/openssl/doc/man3/RAND_add.pod head/crypto/openssl/doc/man3/RAND_bytes.pod head/crypto/openssl/doc/man3/RAND_cleanup.pod head/crypto/openssl/doc/man3/RSA_padding_add_PKCS1_type_1.pod head/crypto/openssl/doc/man3/RSA_public_encrypt.pod head/crypto/openssl/doc/man3/SSL_CIPHER_get_name.pod head/crypto/openssl/doc/man3/SSL_CONF_cmd.pod head/crypto/openssl/doc/man3/SSL_CTX_load_verify_locations.pod head/crypto/openssl/doc/man3/SSL_CTX_new.pod head/crypto/openssl/doc/man3/SSL_CTX_set1_sigalgs.pod head/crypto/openssl/doc/man3/SSL_CTX_set_client_hello_cb.pod head/crypto/openssl/doc/man3/SSL_CTX_set_default_passwd_cb.pod head/crypto/openssl/doc/man3/SSL_CTX_set_generate_session_id.pod head/crypto/openssl/doc/man3/SSL_CTX_set_min_proto_version.pod head/crypto/openssl/doc/man3/SSL_CTX_set_read_ahead.pod head/crypto/openssl/doc/man3/SSL_CTX_set_split_send_fragment.pod head/crypto/openssl/doc/man3/SSL_CTX_set_tlsext_ticket_key_cb.pod head/crypto/openssl/doc/man3/SSL_CTX_set_tmp_dh_callback.pod head/crypto/openssl/doc/man3/SSL_get_error.pod head/crypto/openssl/doc/man3/SSL_load_client_CA_file.pod head/crypto/openssl/doc/man3/SSL_read.pod head/crypto/openssl/doc/man3/SSL_session_reused.pod head/crypto/openssl/doc/man3/SSL_shutdown.pod head/crypto/openssl/doc/man3/SSL_write.pod head/crypto/openssl/doc/man3/X509_LOOKUP_meth_new.pod head/crypto/openssl/doc/man3/X509_NAME_add_entry_by_txt.pod head/crypto/openssl/doc/man3/X509_NAME_get_index_by_NID.pod head/crypto/openssl/doc/man3/X509_get_subject_name.pod head/crypto/openssl/doc/man3/d2i_X509.pod head/crypto/openssl/e_os.h head/crypto/openssl/engines/e_padlock.c head/crypto/openssl/include/internal/dsoerr.h head/crypto/openssl/include/internal/refcount.h head/crypto/openssl/include/internal/tsan_assist.h head/crypto/openssl/include/openssl/err.h head/crypto/openssl/include/openssl/evp.h head/crypto/openssl/include/openssl/obj_mac.h head/crypto/openssl/include/openssl/ocsp.h head/crypto/openssl/include/openssl/opensslv.h head/crypto/openssl/include/openssl/ssl.h head/crypto/openssl/include/openssl/x509v3.h head/crypto/openssl/ssl/ssl_lib.c head/crypto/openssl/ssl/ssl_locl.h head/crypto/openssl/ssl/statem/extensions.c head/crypto/openssl/ssl/statem/extensions_clnt.c head/crypto/openssl/ssl/statem/extensions_srvr.c head/crypto/openssl/ssl/statem/statem_clnt.c head/crypto/openssl/ssl/statem/statem_srvr.c head/secure/lib/libcrypto/Makefile.inc head/secure/lib/libcrypto/Makefile.man head/secure/lib/libcrypto/Version.map head/secure/lib/libcrypto/man/ADMISSIONS.3 head/secure/lib/libcrypto/man/ASN1_INTEGER_get_int64.3 head/secure/lib/libcrypto/man/ASN1_ITEM_lookup.3 head/secure/lib/libcrypto/man/ASN1_OBJECT_new.3 head/secure/lib/libcrypto/man/ASN1_STRING_TABLE_add.3 head/secure/lib/libcrypto/man/ASN1_STRING_length.3 head/secure/lib/libcrypto/man/ASN1_STRING_new.3 head/secure/lib/libcrypto/man/ASN1_STRING_print_ex.3 head/secure/lib/libcrypto/man/ASN1_TIME_set.3 head/secure/lib/libcrypto/man/ASN1_TYPE_get.3 head/secure/lib/libcrypto/man/ASN1_generate_nconf.3 head/secure/lib/libcrypto/man/ASYNC_WAIT_CTX_new.3 head/secure/lib/libcrypto/man/ASYNC_start_job.3 head/secure/lib/libcrypto/man/BF_encrypt.3 head/secure/lib/libcrypto/man/BIO_ADDR.3 head/secure/lib/libcrypto/man/BIO_ADDRINFO.3 head/secure/lib/libcrypto/man/BIO_connect.3 head/secure/lib/libcrypto/man/BIO_ctrl.3 head/secure/lib/libcrypto/man/BIO_f_base64.3 head/secure/lib/libcrypto/man/BIO_f_buffer.3 head/secure/lib/libcrypto/man/BIO_f_cipher.3 head/secure/lib/libcrypto/man/BIO_f_md.3 head/secure/lib/libcrypto/man/BIO_f_null.3 head/secure/lib/libcrypto/man/BIO_f_ssl.3 head/secure/lib/libcrypto/man/BIO_find_type.3 head/secure/lib/libcrypto/man/BIO_get_data.3 head/secure/lib/libcrypto/man/BIO_get_ex_new_index.3 head/secure/lib/libcrypto/man/BIO_meth_new.3 head/secure/lib/libcrypto/man/BIO_new.3 head/secure/lib/libcrypto/man/BIO_new_CMS.3 head/secure/lib/libcrypto/man/BIO_parse_hostserv.3 head/secure/lib/libcrypto/man/BIO_printf.3 head/secure/lib/libcrypto/man/BIO_push.3 head/secure/lib/libcrypto/man/BIO_read.3 head/secure/lib/libcrypto/man/BIO_s_accept.3 head/secure/lib/libcrypto/man/BIO_s_bio.3 head/secure/lib/libcrypto/man/BIO_s_connect.3 head/secure/lib/libcrypto/man/BIO_s_fd.3 head/secure/lib/libcrypto/man/BIO_s_file.3 head/secure/lib/libcrypto/man/BIO_s_mem.3 head/secure/lib/libcrypto/man/BIO_s_null.3 head/secure/lib/libcrypto/man/BIO_s_socket.3 head/secure/lib/libcrypto/man/BIO_set_callback.3 head/secure/lib/libcrypto/man/BIO_should_retry.3 head/secure/lib/libcrypto/man/BN_BLINDING_new.3 head/secure/lib/libcrypto/man/BN_CTX_new.3 head/secure/lib/libcrypto/man/BN_CTX_start.3 head/secure/lib/libcrypto/man/BN_add.3 head/secure/lib/libcrypto/man/BN_add_word.3 head/secure/lib/libcrypto/man/BN_bn2bin.3 head/secure/lib/libcrypto/man/BN_cmp.3 head/secure/lib/libcrypto/man/BN_copy.3 head/secure/lib/libcrypto/man/BN_generate_prime.3 head/secure/lib/libcrypto/man/BN_mod_inverse.3 head/secure/lib/libcrypto/man/BN_mod_mul_montgomery.3 head/secure/lib/libcrypto/man/BN_mod_mul_reciprocal.3 head/secure/lib/libcrypto/man/BN_new.3 head/secure/lib/libcrypto/man/BN_num_bytes.3 head/secure/lib/libcrypto/man/BN_rand.3 head/secure/lib/libcrypto/man/BN_security_bits.3 head/secure/lib/libcrypto/man/BN_set_bit.3 head/secure/lib/libcrypto/man/BN_swap.3 head/secure/lib/libcrypto/man/BN_zero.3 head/secure/lib/libcrypto/man/BUF_MEM_new.3 head/secure/lib/libcrypto/man/CMS_add0_cert.3 head/secure/lib/libcrypto/man/CMS_add1_recipient_cert.3 head/secure/lib/libcrypto/man/CMS_add1_signer.3 head/secure/lib/libcrypto/man/CMS_compress.3 head/secure/lib/libcrypto/man/CMS_decrypt.3 head/secure/lib/libcrypto/man/CMS_encrypt.3 head/secure/lib/libcrypto/man/CMS_final.3 head/secure/lib/libcrypto/man/CMS_get0_RecipientInfos.3 head/secure/lib/libcrypto/man/CMS_get0_SignerInfos.3 head/secure/lib/libcrypto/man/CMS_get0_type.3 head/secure/lib/libcrypto/man/CMS_get1_ReceiptRequest.3 head/secure/lib/libcrypto/man/CMS_sign.3 head/secure/lib/libcrypto/man/CMS_sign_receipt.3 head/secure/lib/libcrypto/man/CMS_uncompress.3 head/secure/lib/libcrypto/man/CMS_verify.3 head/secure/lib/libcrypto/man/CMS_verify_receipt.3 head/secure/lib/libcrypto/man/CONF_modules_free.3 head/secure/lib/libcrypto/man/CONF_modules_load_file.3 head/secure/lib/libcrypto/man/CRYPTO_THREAD_run_once.3 head/secure/lib/libcrypto/man/CRYPTO_get_ex_new_index.3 head/secure/lib/libcrypto/man/CTLOG_STORE_get0_log_by_id.3 head/secure/lib/libcrypto/man/CTLOG_STORE_new.3 head/secure/lib/libcrypto/man/CTLOG_new.3 head/secure/lib/libcrypto/man/CT_POLICY_EVAL_CTX_new.3 head/secure/lib/libcrypto/man/DEFINE_STACK_OF.3 head/secure/lib/libcrypto/man/DES_random_key.3 head/secure/lib/libcrypto/man/DH_generate_key.3 head/secure/lib/libcrypto/man/DH_generate_parameters.3 head/secure/lib/libcrypto/man/DH_get0_pqg.3 head/secure/lib/libcrypto/man/DH_get_1024_160.3 head/secure/lib/libcrypto/man/DH_meth_new.3 head/secure/lib/libcrypto/man/DH_new.3 head/secure/lib/libcrypto/man/DH_new_by_nid.3 head/secure/lib/libcrypto/man/DH_set_method.3 head/secure/lib/libcrypto/man/DH_size.3 head/secure/lib/libcrypto/man/DSA_SIG_new.3 head/secure/lib/libcrypto/man/DSA_do_sign.3 head/secure/lib/libcrypto/man/DSA_dup_DH.3 head/secure/lib/libcrypto/man/DSA_generate_key.3 head/secure/lib/libcrypto/man/DSA_generate_parameters.3 head/secure/lib/libcrypto/man/DSA_get0_pqg.3 head/secure/lib/libcrypto/man/DSA_meth_new.3 head/secure/lib/libcrypto/man/DSA_new.3 head/secure/lib/libcrypto/man/DSA_set_method.3 head/secure/lib/libcrypto/man/DSA_sign.3 head/secure/lib/libcrypto/man/DSA_size.3 head/secure/lib/libcrypto/man/DTLS_get_data_mtu.3 head/secure/lib/libcrypto/man/DTLS_set_timer_cb.3 head/secure/lib/libcrypto/man/DTLSv1_listen.3 head/secure/lib/libcrypto/man/ECDSA_SIG_new.3 head/secure/lib/libcrypto/man/ECPKParameters_print.3 head/secure/lib/libcrypto/man/EC_GFp_simple_method.3 head/secure/lib/libcrypto/man/EC_GROUP_copy.3 head/secure/lib/libcrypto/man/EC_GROUP_new.3 head/secure/lib/libcrypto/man/EC_KEY_get_enc_flags.3 head/secure/lib/libcrypto/man/EC_KEY_new.3 head/secure/lib/libcrypto/man/EC_POINT_add.3 head/secure/lib/libcrypto/man/EC_POINT_new.3 head/secure/lib/libcrypto/man/ENGINE_add.3 head/secure/lib/libcrypto/man/ERR_GET_LIB.3 head/secure/lib/libcrypto/man/ERR_clear_error.3 head/secure/lib/libcrypto/man/ERR_error_string.3 head/secure/lib/libcrypto/man/ERR_get_error.3 head/secure/lib/libcrypto/man/ERR_load_crypto_strings.3 head/secure/lib/libcrypto/man/ERR_load_strings.3 head/secure/lib/libcrypto/man/ERR_print_errors.3 head/secure/lib/libcrypto/man/ERR_put_error.3 head/secure/lib/libcrypto/man/ERR_remove_state.3 head/secure/lib/libcrypto/man/ERR_set_mark.3 head/secure/lib/libcrypto/man/EVP_BytesToKey.3 head/secure/lib/libcrypto/man/EVP_CIPHER_CTX_get_cipher_data.3 head/secure/lib/libcrypto/man/EVP_CIPHER_meth_new.3 head/secure/lib/libcrypto/man/EVP_DigestInit.3 head/secure/lib/libcrypto/man/EVP_DigestSignInit.3 head/secure/lib/libcrypto/man/EVP_DigestVerifyInit.3 head/secure/lib/libcrypto/man/EVP_EncodeInit.3 head/secure/lib/libcrypto/man/EVP_EncryptInit.3 head/secure/lib/libcrypto/man/EVP_MD_meth_new.3 head/secure/lib/libcrypto/man/EVP_OpenInit.3 head/secure/lib/libcrypto/man/EVP_PKEY_ASN1_METHOD.3 head/secure/lib/libcrypto/man/EVP_PKEY_CTX_ctrl.3 head/secure/lib/libcrypto/man/EVP_PKEY_CTX_new.3 head/secure/lib/libcrypto/man/EVP_PKEY_CTX_set1_pbe_pass.3 head/secure/lib/libcrypto/man/EVP_PKEY_CTX_set_hkdf_md.3 head/secure/lib/libcrypto/man/EVP_PKEY_CTX_set_rsa_pss_keygen_md.3 head/secure/lib/libcrypto/man/EVP_PKEY_CTX_set_scrypt_N.3 head/secure/lib/libcrypto/man/EVP_PKEY_CTX_set_tls1_prf_md.3 head/secure/lib/libcrypto/man/EVP_PKEY_asn1_get_count.3 head/secure/lib/libcrypto/man/EVP_PKEY_cmp.3 head/secure/lib/libcrypto/man/EVP_PKEY_decrypt.3 head/secure/lib/libcrypto/man/EVP_PKEY_derive.3 head/secure/lib/libcrypto/man/EVP_PKEY_encrypt.3 head/secure/lib/libcrypto/man/EVP_PKEY_get_default_digest_nid.3 head/secure/lib/libcrypto/man/EVP_PKEY_keygen.3 head/secure/lib/libcrypto/man/EVP_PKEY_meth_get_count.3 head/secure/lib/libcrypto/man/EVP_PKEY_meth_new.3 head/secure/lib/libcrypto/man/EVP_PKEY_new.3 head/secure/lib/libcrypto/man/EVP_PKEY_print_private.3 head/secure/lib/libcrypto/man/EVP_PKEY_set1_RSA.3 head/secure/lib/libcrypto/man/EVP_PKEY_sign.3 head/secure/lib/libcrypto/man/EVP_PKEY_verify.3 head/secure/lib/libcrypto/man/EVP_PKEY_verify_recover.3 head/secure/lib/libcrypto/man/EVP_SealInit.3 head/secure/lib/libcrypto/man/EVP_SignInit.3 head/secure/lib/libcrypto/man/EVP_VerifyInit.3 head/secure/lib/libcrypto/man/EVP_aes.3 head/secure/lib/libcrypto/man/EVP_aria.3 head/secure/lib/libcrypto/man/EVP_bf_cbc.3 head/secure/lib/libcrypto/man/EVP_blake2b512.3 head/secure/lib/libcrypto/man/EVP_camellia.3 head/secure/lib/libcrypto/man/EVP_cast5_cbc.3 head/secure/lib/libcrypto/man/EVP_chacha20.3 head/secure/lib/libcrypto/man/EVP_des.3 head/secure/lib/libcrypto/man/EVP_desx_cbc.3 head/secure/lib/libcrypto/man/EVP_idea_cbc.3 head/secure/lib/libcrypto/man/EVP_md2.3 head/secure/lib/libcrypto/man/EVP_md4.3 head/secure/lib/libcrypto/man/EVP_md5.3 head/secure/lib/libcrypto/man/EVP_mdc2.3 head/secure/lib/libcrypto/man/EVP_rc2_cbc.3 head/secure/lib/libcrypto/man/EVP_rc4.3 head/secure/lib/libcrypto/man/EVP_rc5_32_12_16_cbc.3 head/secure/lib/libcrypto/man/EVP_ripemd160.3 head/secure/lib/libcrypto/man/EVP_seed_cbc.3 head/secure/lib/libcrypto/man/EVP_sha1.3 head/secure/lib/libcrypto/man/EVP_sha224.3 head/secure/lib/libcrypto/man/EVP_sha3_224.3 head/secure/lib/libcrypto/man/EVP_sm3.3 head/secure/lib/libcrypto/man/EVP_sm4_cbc.3 head/secure/lib/libcrypto/man/EVP_whirlpool.3 head/secure/lib/libcrypto/man/HMAC.3 head/secure/lib/libcrypto/man/MD5.3 head/secure/lib/libcrypto/man/MDC2_Init.3 head/secure/lib/libcrypto/man/OBJ_nid2obj.3 head/secure/lib/libcrypto/man/OCSP_REQUEST_new.3 head/secure/lib/libcrypto/man/OCSP_cert_to_id.3 head/secure/lib/libcrypto/man/OCSP_request_add1_nonce.3 head/secure/lib/libcrypto/man/OCSP_resp_find_status.3 head/secure/lib/libcrypto/man/OCSP_response_status.3 head/secure/lib/libcrypto/man/OCSP_sendreq_new.3 head/secure/lib/libcrypto/man/OPENSSL_Applink.3 head/secure/lib/libcrypto/man/OPENSSL_LH_COMPFUNC.3 head/secure/lib/libcrypto/man/OPENSSL_LH_stats.3 head/secure/lib/libcrypto/man/OPENSSL_VERSION_NUMBER.3 head/secure/lib/libcrypto/man/OPENSSL_config.3 head/secure/lib/libcrypto/man/OPENSSL_fork_prepare.3 head/secure/lib/libcrypto/man/OPENSSL_ia32cap.3 head/secure/lib/libcrypto/man/OPENSSL_init_crypto.3 head/secure/lib/libcrypto/man/OPENSSL_init_ssl.3 head/secure/lib/libcrypto/man/OPENSSL_instrument_bus.3 head/secure/lib/libcrypto/man/OPENSSL_load_builtin_modules.3 head/secure/lib/libcrypto/man/OPENSSL_malloc.3 head/secure/lib/libcrypto/man/OPENSSL_secure_malloc.3 head/secure/lib/libcrypto/man/OSSL_STORE_INFO.3 head/secure/lib/libcrypto/man/OSSL_STORE_LOADER.3 head/secure/lib/libcrypto/man/OSSL_STORE_SEARCH.3 head/secure/lib/libcrypto/man/OSSL_STORE_expect.3 head/secure/lib/libcrypto/man/OSSL_STORE_open.3 head/secure/lib/libcrypto/man/OpenSSL_add_all_algorithms.3 head/secure/lib/libcrypto/man/PEM_bytes_read_bio.3 head/secure/lib/libcrypto/man/PEM_read.3 head/secure/lib/libcrypto/man/PEM_read_CMS.3 head/secure/lib/libcrypto/man/PEM_read_bio_PrivateKey.3 head/secure/lib/libcrypto/man/PEM_read_bio_ex.3 head/secure/lib/libcrypto/man/PEM_write_bio_CMS_stream.3 head/secure/lib/libcrypto/man/PEM_write_bio_PKCS7_stream.3 head/secure/lib/libcrypto/man/PKCS12_create.3 head/secure/lib/libcrypto/man/PKCS12_newpass.3 head/secure/lib/libcrypto/man/PKCS12_parse.3 head/secure/lib/libcrypto/man/PKCS5_PBKDF2_HMAC.3 head/secure/lib/libcrypto/man/PKCS7_decrypt.3 head/secure/lib/libcrypto/man/PKCS7_encrypt.3 head/secure/lib/libcrypto/man/PKCS7_sign.3 head/secure/lib/libcrypto/man/PKCS7_sign_add_signer.3 head/secure/lib/libcrypto/man/PKCS7_verify.3 head/secure/lib/libcrypto/man/RAND_DRBG_generate.3 head/secure/lib/libcrypto/man/RAND_DRBG_get0_master.3 head/secure/lib/libcrypto/man/RAND_DRBG_new.3 head/secure/lib/libcrypto/man/RAND_DRBG_reseed.3 head/secure/lib/libcrypto/man/RAND_DRBG_set_callbacks.3 head/secure/lib/libcrypto/man/RAND_DRBG_set_ex_data.3 head/secure/lib/libcrypto/man/RAND_add.3 head/secure/lib/libcrypto/man/RAND_bytes.3 head/secure/lib/libcrypto/man/RAND_cleanup.3 head/secure/lib/libcrypto/man/RAND_egd.3 head/secure/lib/libcrypto/man/RAND_load_file.3 head/secure/lib/libcrypto/man/RAND_set_rand_method.3 head/secure/lib/libcrypto/man/RC4_set_key.3 head/secure/lib/libcrypto/man/RIPEMD160_Init.3 head/secure/lib/libcrypto/man/RSA_blinding_on.3 head/secure/lib/libcrypto/man/RSA_check_key.3 head/secure/lib/libcrypto/man/RSA_generate_key.3 head/secure/lib/libcrypto/man/RSA_get0_key.3 head/secure/lib/libcrypto/man/RSA_meth_new.3 head/secure/lib/libcrypto/man/RSA_new.3 head/secure/lib/libcrypto/man/RSA_padding_add_PKCS1_type_1.3 head/secure/lib/libcrypto/man/RSA_print.3 head/secure/lib/libcrypto/man/RSA_private_encrypt.3 head/secure/lib/libcrypto/man/RSA_public_encrypt.3 head/secure/lib/libcrypto/man/RSA_set_method.3 head/secure/lib/libcrypto/man/RSA_sign.3 head/secure/lib/libcrypto/man/RSA_sign_ASN1_OCTET_STRING.3 head/secure/lib/libcrypto/man/RSA_size.3 head/secure/lib/libcrypto/man/SCT_new.3 head/secure/lib/libcrypto/man/SCT_print.3 head/secure/lib/libcrypto/man/SCT_validate.3 head/secure/lib/libcrypto/man/SHA256_Init.3 head/secure/lib/libcrypto/man/SMIME_read_CMS.3 head/secure/lib/libcrypto/man/SMIME_read_PKCS7.3 head/secure/lib/libcrypto/man/SMIME_write_CMS.3 head/secure/lib/libcrypto/man/SMIME_write_PKCS7.3 head/secure/lib/libcrypto/man/SSL_CIPHER_get_name.3 head/secure/lib/libcrypto/man/SSL_COMP_add_compression_method.3 head/secure/lib/libcrypto/man/SSL_CONF_CTX_new.3 head/secure/lib/libcrypto/man/SSL_CONF_CTX_set1_prefix.3 head/secure/lib/libcrypto/man/SSL_CONF_CTX_set_flags.3 head/secure/lib/libcrypto/man/SSL_CONF_CTX_set_ssl_ctx.3 head/secure/lib/libcrypto/man/SSL_CONF_cmd.3 head/secure/lib/libcrypto/man/SSL_CONF_cmd_argv.3 head/secure/lib/libcrypto/man/SSL_CTX_add1_chain_cert.3 head/secure/lib/libcrypto/man/SSL_CTX_add_extra_chain_cert.3 head/secure/lib/libcrypto/man/SSL_CTX_add_session.3 head/secure/lib/libcrypto/man/SSL_CTX_config.3 head/secure/lib/libcrypto/man/SSL_CTX_ctrl.3 head/secure/lib/libcrypto/man/SSL_CTX_dane_enable.3 head/secure/lib/libcrypto/man/SSL_CTX_flush_sessions.3 head/secure/lib/libcrypto/man/SSL_CTX_free.3 head/secure/lib/libcrypto/man/SSL_CTX_get0_param.3 head/secure/lib/libcrypto/man/SSL_CTX_get_verify_mode.3 head/secure/lib/libcrypto/man/SSL_CTX_has_client_custom_ext.3 head/secure/lib/libcrypto/man/SSL_CTX_load_verify_locations.3 head/secure/lib/libcrypto/man/SSL_CTX_new.3 head/secure/lib/libcrypto/man/SSL_CTX_sess_number.3 head/secure/lib/libcrypto/man/SSL_CTX_sess_set_cache_size.3 head/secure/lib/libcrypto/man/SSL_CTX_sess_set_get_cb.3 head/secure/lib/libcrypto/man/SSL_CTX_sessions.3 head/secure/lib/libcrypto/man/SSL_CTX_set0_CA_list.3 head/secure/lib/libcrypto/man/SSL_CTX_set1_curves.3 head/secure/lib/libcrypto/man/SSL_CTX_set1_sigalgs.3 head/secure/lib/libcrypto/man/SSL_CTX_set1_verify_cert_store.3 head/secure/lib/libcrypto/man/SSL_CTX_set_alpn_select_cb.3 head/secure/lib/libcrypto/man/SSL_CTX_set_cert_cb.3 head/secure/lib/libcrypto/man/SSL_CTX_set_cert_store.3 head/secure/lib/libcrypto/man/SSL_CTX_set_cert_verify_callback.3 head/secure/lib/libcrypto/man/SSL_CTX_set_cipher_list.3 head/secure/lib/libcrypto/man/SSL_CTX_set_client_cert_cb.3 head/secure/lib/libcrypto/man/SSL_CTX_set_client_hello_cb.3 head/secure/lib/libcrypto/man/SSL_CTX_set_ct_validation_callback.3 head/secure/lib/libcrypto/man/SSL_CTX_set_ctlog_list_file.3 head/secure/lib/libcrypto/man/SSL_CTX_set_default_passwd_cb.3 head/secure/lib/libcrypto/man/SSL_CTX_set_ex_data.3 head/secure/lib/libcrypto/man/SSL_CTX_set_generate_session_id.3 head/secure/lib/libcrypto/man/SSL_CTX_set_info_callback.3 head/secure/lib/libcrypto/man/SSL_CTX_set_keylog_callback.3 head/secure/lib/libcrypto/man/SSL_CTX_set_max_cert_list.3 head/secure/lib/libcrypto/man/SSL_CTX_set_min_proto_version.3 head/secure/lib/libcrypto/man/SSL_CTX_set_mode.3 head/secure/lib/libcrypto/man/SSL_CTX_set_msg_callback.3 head/secure/lib/libcrypto/man/SSL_CTX_set_num_tickets.3 head/secure/lib/libcrypto/man/SSL_CTX_set_options.3 head/secure/lib/libcrypto/man/SSL_CTX_set_psk_client_callback.3 head/secure/lib/libcrypto/man/SSL_CTX_set_quiet_shutdown.3 head/secure/lib/libcrypto/man/SSL_CTX_set_read_ahead.3 head/secure/lib/libcrypto/man/SSL_CTX_set_record_padding_callback.3 head/secure/lib/libcrypto/man/SSL_CTX_set_security_level.3 head/secure/lib/libcrypto/man/SSL_CTX_set_session_cache_mode.3 head/secure/lib/libcrypto/man/SSL_CTX_set_session_id_context.3 head/secure/lib/libcrypto/man/SSL_CTX_set_session_ticket_cb.3 head/secure/lib/libcrypto/man/SSL_CTX_set_split_send_fragment.3 head/secure/lib/libcrypto/man/SSL_CTX_set_ssl_version.3 head/secure/lib/libcrypto/man/SSL_CTX_set_stateless_cookie_generate_cb.3 head/secure/lib/libcrypto/man/SSL_CTX_set_timeout.3 head/secure/lib/libcrypto/man/SSL_CTX_set_tlsext_servername_callback.3 head/secure/lib/libcrypto/man/SSL_CTX_set_tlsext_status_cb.3 head/secure/lib/libcrypto/man/SSL_CTX_set_tlsext_ticket_key_cb.3 head/secure/lib/libcrypto/man/SSL_CTX_set_tlsext_use_srtp.3 head/secure/lib/libcrypto/man/SSL_CTX_set_tmp_dh_callback.3 head/secure/lib/libcrypto/man/SSL_CTX_set_verify.3 head/secure/lib/libcrypto/man/SSL_CTX_use_certificate.3 head/secure/lib/libcrypto/man/SSL_CTX_use_psk_identity_hint.3 head/secure/lib/libcrypto/man/SSL_CTX_use_serverinfo.3 head/secure/lib/libcrypto/man/SSL_SESSION_free.3 head/secure/lib/libcrypto/man/SSL_SESSION_get0_cipher.3 head/secure/lib/libcrypto/man/SSL_SESSION_get0_hostname.3 head/secure/lib/libcrypto/man/SSL_SESSION_get0_id_context.3 head/secure/lib/libcrypto/man/SSL_SESSION_get0_peer.3 head/secure/lib/libcrypto/man/SSL_SESSION_get_compress_id.3 head/secure/lib/libcrypto/man/SSL_SESSION_get_ex_data.3 head/secure/lib/libcrypto/man/SSL_SESSION_get_protocol_version.3 head/secure/lib/libcrypto/man/SSL_SESSION_get_time.3 head/secure/lib/libcrypto/man/SSL_SESSION_has_ticket.3 head/secure/lib/libcrypto/man/SSL_SESSION_is_resumable.3 head/secure/lib/libcrypto/man/SSL_SESSION_print.3 head/secure/lib/libcrypto/man/SSL_SESSION_set1_id.3 head/secure/lib/libcrypto/man/SSL_accept.3 head/secure/lib/libcrypto/man/SSL_alert_type_string.3 head/secure/lib/libcrypto/man/SSL_alloc_buffers.3 head/secure/lib/libcrypto/man/SSL_check_chain.3 head/secure/lib/libcrypto/man/SSL_clear.3 head/secure/lib/libcrypto/man/SSL_connect.3 head/secure/lib/libcrypto/man/SSL_do_handshake.3 head/secure/lib/libcrypto/man/SSL_export_keying_material.3 head/secure/lib/libcrypto/man/SSL_extension_supported.3 head/secure/lib/libcrypto/man/SSL_free.3 head/secure/lib/libcrypto/man/SSL_get0_peer_scts.3 head/secure/lib/libcrypto/man/SSL_get_SSL_CTX.3 head/secure/lib/libcrypto/man/SSL_get_all_async_fds.3 head/secure/lib/libcrypto/man/SSL_get_ciphers.3 head/secure/lib/libcrypto/man/SSL_get_client_random.3 head/secure/lib/libcrypto/man/SSL_get_current_cipher.3 head/secure/lib/libcrypto/man/SSL_get_default_timeout.3 head/secure/lib/libcrypto/man/SSL_get_error.3 head/secure/lib/libcrypto/man/SSL_get_extms_support.3 head/secure/lib/libcrypto/man/SSL_get_fd.3 head/secure/lib/libcrypto/man/SSL_get_peer_cert_chain.3 head/secure/lib/libcrypto/man/SSL_get_peer_certificate.3 head/secure/lib/libcrypto/man/SSL_get_peer_signature_nid.3 head/secure/lib/libcrypto/man/SSL_get_peer_tmp_key.3 head/secure/lib/libcrypto/man/SSL_get_psk_identity.3 head/secure/lib/libcrypto/man/SSL_get_rbio.3 head/secure/lib/libcrypto/man/SSL_get_session.3 head/secure/lib/libcrypto/man/SSL_get_shared_sigalgs.3 head/secure/lib/libcrypto/man/SSL_get_verify_result.3 head/secure/lib/libcrypto/man/SSL_get_version.3 head/secure/lib/libcrypto/man/SSL_in_init.3 head/secure/lib/libcrypto/man/SSL_key_update.3 head/secure/lib/libcrypto/man/SSL_library_init.3 head/secure/lib/libcrypto/man/SSL_load_client_CA_file.3 head/secure/lib/libcrypto/man/SSL_new.3 head/secure/lib/libcrypto/man/SSL_pending.3 head/secure/lib/libcrypto/man/SSL_read.3 head/secure/lib/libcrypto/man/SSL_read_early_data.3 head/secure/lib/libcrypto/man/SSL_rstate_string.3 head/secure/lib/libcrypto/man/SSL_session_reused.3 head/secure/lib/libcrypto/man/SSL_set1_host.3 head/secure/lib/libcrypto/man/SSL_set_bio.3 head/secure/lib/libcrypto/man/SSL_set_connect_state.3 head/secure/lib/libcrypto/man/SSL_set_fd.3 head/secure/lib/libcrypto/man/SSL_set_session.3 head/secure/lib/libcrypto/man/SSL_set_shutdown.3 head/secure/lib/libcrypto/man/SSL_set_verify_result.3 head/secure/lib/libcrypto/man/SSL_shutdown.3 head/secure/lib/libcrypto/man/SSL_state_string.3 head/secure/lib/libcrypto/man/SSL_want.3 head/secure/lib/libcrypto/man/SSL_write.3 head/secure/lib/libcrypto/man/UI_STRING.3 head/secure/lib/libcrypto/man/UI_UTIL_read_pw.3 head/secure/lib/libcrypto/man/UI_create_method.3 head/secure/lib/libcrypto/man/UI_new.3 head/secure/lib/libcrypto/man/X509V3_get_d2i.3 head/secure/lib/libcrypto/man/X509_ALGOR_dup.3 head/secure/lib/libcrypto/man/X509_CRL_get0_by_serial.3 head/secure/lib/libcrypto/man/X509_EXTENSION_set_object.3 head/secure/lib/libcrypto/man/X509_LOOKUP_hash_dir.3 head/secure/lib/libcrypto/man/X509_LOOKUP_meth_new.3 head/secure/lib/libcrypto/man/X509_NAME_ENTRY_get_object.3 head/secure/lib/libcrypto/man/X509_NAME_add_entry_by_txt.3 head/secure/lib/libcrypto/man/X509_NAME_get0_der.3 head/secure/lib/libcrypto/man/X509_NAME_get_index_by_NID.3 head/secure/lib/libcrypto/man/X509_NAME_print_ex.3 head/secure/lib/libcrypto/man/X509_PUBKEY_new.3 head/secure/lib/libcrypto/man/X509_SIG_get0.3 head/secure/lib/libcrypto/man/X509_STORE_CTX_get_error.3 head/secure/lib/libcrypto/man/X509_STORE_CTX_new.3 head/secure/lib/libcrypto/man/X509_STORE_CTX_set_verify_cb.3 head/secure/lib/libcrypto/man/X509_STORE_add_cert.3 head/secure/lib/libcrypto/man/X509_STORE_get0_param.3 head/secure/lib/libcrypto/man/X509_STORE_new.3 head/secure/lib/libcrypto/man/X509_STORE_set_verify_cb_func.3 head/secure/lib/libcrypto/man/X509_VERIFY_PARAM_set_flags.3 head/secure/lib/libcrypto/man/X509_check_ca.3 head/secure/lib/libcrypto/man/X509_check_host.3 head/secure/lib/libcrypto/man/X509_check_issued.3 head/secure/lib/libcrypto/man/X509_check_private_key.3 head/secure/lib/libcrypto/man/X509_cmp_time.3 head/secure/lib/libcrypto/man/X509_digest.3 head/secure/lib/libcrypto/man/X509_dup.3 head/secure/lib/libcrypto/man/X509_get0_notBefore.3 head/secure/lib/libcrypto/man/X509_get0_signature.3 head/secure/lib/libcrypto/man/X509_get0_uids.3 head/secure/lib/libcrypto/man/X509_get_extension_flags.3 head/secure/lib/libcrypto/man/X509_get_pubkey.3 head/secure/lib/libcrypto/man/X509_get_serialNumber.3 head/secure/lib/libcrypto/man/X509_get_subject_name.3 head/secure/lib/libcrypto/man/X509_get_version.3 head/secure/lib/libcrypto/man/X509_new.3 head/secure/lib/libcrypto/man/X509_sign.3 head/secure/lib/libcrypto/man/X509_verify_cert.3 head/secure/lib/libcrypto/man/X509v3_get_ext_by_NID.3 head/secure/lib/libcrypto/man/d2i_DHparams.3 head/secure/lib/libcrypto/man/d2i_PKCS8PrivateKey_bio.3 head/secure/lib/libcrypto/man/d2i_PrivateKey.3 head/secure/lib/libcrypto/man/d2i_SSL_SESSION.3 head/secure/lib/libcrypto/man/d2i_X509.3 head/secure/lib/libcrypto/man/i2d_CMS_bio_stream.3 head/secure/lib/libcrypto/man/i2d_PKCS7_bio_stream.3 head/secure/lib/libcrypto/man/i2d_re_X509_tbs.3 head/secure/lib/libcrypto/man/o2i_SCT_LIST.3 head/secure/usr.bin/openssl/man/CA.pl.1 head/secure/usr.bin/openssl/man/asn1parse.1 head/secure/usr.bin/openssl/man/ca.1 head/secure/usr.bin/openssl/man/ciphers.1 head/secure/usr.bin/openssl/man/cms.1 head/secure/usr.bin/openssl/man/crl.1 head/secure/usr.bin/openssl/man/crl2pkcs7.1 head/secure/usr.bin/openssl/man/dgst.1 head/secure/usr.bin/openssl/man/dhparam.1 head/secure/usr.bin/openssl/man/dsa.1 head/secure/usr.bin/openssl/man/dsaparam.1 head/secure/usr.bin/openssl/man/ec.1 head/secure/usr.bin/openssl/man/ecparam.1 head/secure/usr.bin/openssl/man/enc.1 head/secure/usr.bin/openssl/man/engine.1 head/secure/usr.bin/openssl/man/errstr.1 head/secure/usr.bin/openssl/man/gendsa.1 head/secure/usr.bin/openssl/man/genpkey.1 head/secure/usr.bin/openssl/man/genrsa.1 head/secure/usr.bin/openssl/man/list.1 head/secure/usr.bin/openssl/man/nseq.1 head/secure/usr.bin/openssl/man/ocsp.1 head/secure/usr.bin/openssl/man/openssl.1 head/secure/usr.bin/openssl/man/passwd.1 head/secure/usr.bin/openssl/man/pkcs12.1 head/secure/usr.bin/openssl/man/pkcs7.1 head/secure/usr.bin/openssl/man/pkcs8.1 head/secure/usr.bin/openssl/man/pkey.1 head/secure/usr.bin/openssl/man/pkeyparam.1 head/secure/usr.bin/openssl/man/pkeyutl.1 head/secure/usr.bin/openssl/man/prime.1 head/secure/usr.bin/openssl/man/rand.1 head/secure/usr.bin/openssl/man/req.1 head/secure/usr.bin/openssl/man/rsa.1 head/secure/usr.bin/openssl/man/rsautl.1 head/secure/usr.bin/openssl/man/s_client.1 head/secure/usr.bin/openssl/man/s_server.1 head/secure/usr.bin/openssl/man/s_time.1 head/secure/usr.bin/openssl/man/sess_id.1 head/secure/usr.bin/openssl/man/smime.1 head/secure/usr.bin/openssl/man/speed.1 head/secure/usr.bin/openssl/man/spkac.1 head/secure/usr.bin/openssl/man/srp.1 head/secure/usr.bin/openssl/man/storeutl.1 head/secure/usr.bin/openssl/man/ts.1 head/secure/usr.bin/openssl/man/tsget.1 head/secure/usr.bin/openssl/man/verify.1 head/secure/usr.bin/openssl/man/version.1 head/secure/usr.bin/openssl/man/x509.1 Directory Properties: head/crypto/openssl/ (props changed) Modified: head/crypto/openssl/CHANGES ============================================================================== --- head/crypto/openssl/CHANGES Tue May 28 21:10:35 2019 (r348339) +++ head/crypto/openssl/CHANGES Tue May 28 21:54:12 2019 (r348340) @@ -7,6 +7,77 @@ https://github.com/openssl/openssl/commits/ and pick the appropriate release branch. + Changes between 1.1.1b and 1.1.1c [28 May 2019] + + *) Add build tests for C++. These are generated files that only do one + thing, to include one public OpenSSL head file each. This tests that + the public header files can be usefully included in a C++ application. + + This test isn't enabled by default. It can be enabled with the option + 'enable-buildtest-c++'. + [Richard Levitte] + + *) Enable SHA3 pre-hashing for ECDSA and DSA. + [Patrick Steuer] + + *) Change the default RSA, DSA and DH size to 2048 bit instead of 1024. + This changes the size when using the genpkey app when no size is given. It + fixes an omission in earlier changes that changed all RSA, DSA and DH + generation apps to use 2048 bits by default. + [Kurt Roeckx] + + *) Reorganize the manual pages to consistently have RETURN VALUES, + EXAMPLES, SEE ALSO and HISTORY come in that order, and adjust + util/fix-doc-nits accordingly. + [Paul Yang, Joshua Lock] + + *) Add the missing accessor EVP_PKEY_get0_engine() + [Matt Caswell] + + *) Have apps like 's_client' and 's_server' output the signature scheme + along with other cipher suite parameters when debugging. + [Lorinczy Zsigmond] + + *) Make OPENSSL_config() error agnostic again. + [Richard Levitte] + + *) Do the error handling in RSA decryption constant time. + [Bernd Edlinger] + + *) Prevent over long nonces in ChaCha20-Poly1305. + + ChaCha20-Poly1305 is an AEAD cipher, and requires a unique nonce input + for every encryption operation. RFC 7539 specifies that the nonce value + (IV) should be 96 bits (12 bytes). OpenSSL allows a variable nonce length + and front pads the nonce with 0 bytes if it is less than 12 + bytes. However it also incorrectly allows a nonce to be set of up to 16 + bytes. In this case only the last 12 bytes are significant and any + additional leading bytes are ignored. + + It is a requirement of using this cipher that nonce values are + unique. Messages encrypted using a reused nonce value are susceptible to + serious confidentiality and integrity attacks. If an application changes + the default nonce length to be longer than 12 bytes and then makes a + change to the leading bytes of the nonce expecting the new value to be a + new unique nonce then such an application could inadvertently encrypt + messages with a reused nonce. + + Additionally the ignored bytes in a long nonce are not covered by the + integrity guarantee of this cipher. Any application that relies on the + integrity of these ignored leading bytes of a long nonce may be further + affected. Any OpenSSL internal use of this cipher, including in SSL/TLS, + is safe because no such use sets such a long nonce value. However user + applications that use this cipher directly and set a non-default nonce + length to be longer than 12 bytes may be vulnerable. + + This issue was reported to OpenSSL on 16th of March 2019 by Joran Dirk + Greef of Ronomon. + (CVE-2019-1543) + [Matt Caswell] + + *) Ensure that SM2 only uses SM3 as digest algorithm + [Paul Yang] + Changes between 1.1.1a and 1.1.1b [26 Feb 2019] *) Added SCA hardening for modular field inversion in EC_GROUP through Modified: head/crypto/openssl/Configure ============================================================================== --- head/crypto/openssl/Configure Tue May 28 21:10:35 2019 (r348339) +++ head/crypto/openssl/Configure Tue May 28 21:54:12 2019 (r348340) @@ -24,7 +24,7 @@ use OpenSSL::Glob; my $orig_death_handler = $SIG{__DIE__}; $SIG{__DIE__} = \&death_handler; -my $usage="Usage: Configure [no- ...] [enable- ...] [-Dxxx] [-lxxx] [-Lxxx] [-fxxx] [-Kxxx] [no-hw-xxx|no-hw] [[no-]threads] [[no-]shared] [[no-]zlib|zlib-dynamic] [no-asm] [no-dso] [no-egd] [sctp] [386] [--prefix=DIR] [--openssldir=OPENSSLDIR] [--with-xxx[=vvv]] [--config=FILE] os/compiler[:flags]\n"; +my $usage="Usage: Configure [no- ...] [enable- ...] [-Dxxx] [-lxxx] [-Lxxx] [-fxxx] [-Kxxx] [no-hw-xxx|no-hw] [[no-]threads] [[no-]shared] [[no-]zlib|zlib-dynamic] [no-asm] [no-egd] [sctp] [386] [--prefix=DIR] [--openssldir=OPENSSLDIR] [--with-xxx[=vvv]] [--config=FILE] os/compiler[:flags]\n"; # Options: # @@ -54,16 +54,14 @@ my $usage="Usage: Configure [no- ...] [enable- # [no-]threads [don't] try to create a library that is suitable for # multithreaded applications (default is "threads" if we # know how to do it) -# [no-]shared [don't] try to create shared libraries when supported. +# [no-]shared [don't] try to create shared libraries when supported. # [no-]pic [don't] try to build position independent code when supported. # If disabled, it also disables shared and dynamic-engine. # no-asm do not use assembler -# no-dso do not compile in any native shared-library methods. This -# will ensure that all methods just return NULL. # no-egd do not compile support for the entropy-gathering daemon APIs # [no-]zlib [don't] compile support for zlib compression. -# zlib-dynamic Like "zlib", but the zlib library is expected to be a shared -# library and will be loaded in run-time by the OpenSSL library. +# zlib-dynamic Like "zlib", but the zlib library is expected to be a shared +# library and will be loaded in run-time by the OpenSSL library. # sctp include SCTP support # enable-weak-ssl-ciphers # Enable weak ciphers that are disabled by default. @@ -75,7 +73,7 @@ my $usage="Usage: Configure [no- ...] [enable- # -static while -static is also a pass-through compiler option (and # as such is limited to environments where it's actually # meaningful), it triggers a number configuration options, -# namely no-dso, no-pic, no-shared and no-threads. It is +# namely no-pic, no-shared and no-threads. It is # argued that the only reason to produce statically linked # binaries (and in context it means executables linked with # -static flag, and not just executables linked with static @@ -90,21 +88,22 @@ my $usage="Usage: Configure [no- ...] [enable- # production quality. # # DEBUG_SAFESTACK use type-safe stacks to enforce type-safety on stack items -# provided to stack calls. Generates unique stack functions for -# each possible stack type. -# BN_LLONG use the type 'long long' in crypto/bn/bn.h -# RC4_CHAR use 'char' instead of 'int' for RC4_INT in crypto/rc4/rc4.h +# provided to stack calls. Generates unique stack functions for +# each possible stack type. +# BN_LLONG use the type 'long long' in crypto/bn/bn.h +# RC4_CHAR use 'char' instead of 'int' for RC4_INT in crypto/rc4/rc4.h # Following are set automatically by this script # -# MD5_ASM use some extra md5 assembler, -# SHA1_ASM use some extra sha1 assembler, must define L_ENDIAN for x86 -# RMD160_ASM use some extra ripemd160 assembler, -# SHA256_ASM sha256_block is implemented in assembler -# SHA512_ASM sha512_block is implemented in assembler -# AES_ASM AES_[en|de]crypt is implemented in assembler +# MD5_ASM use some extra md5 assembler, +# SHA1_ASM use some extra sha1 assembler, must define L_ENDIAN for x86 +# RMD160_ASM use some extra ripemd160 assembler, +# SHA256_ASM sha256_block is implemented in assembler +# SHA512_ASM sha512_block is implemented in assembler +# AES_ASM AES_[en|de]crypt is implemented in assembler -# Minimum warning options... any contributions to OpenSSL should at least get -# past these. +# Minimum warning options... any contributions to OpenSSL should at least +# get past these. Note that we only use these with C compilers, not with +# C++ compilers. # DEBUG_UNUSED enables __owur (warn unused result) checks. # -DPEDANTIC complements -pedantic and is meant to mask code that @@ -119,22 +118,23 @@ my $usage="Usage: Configure [no- ...] [enable- # code, so we just tell compiler to be pedantic about everything # but 'long long' type. -my $gcc_devteam_warn = "-DDEBUG_UNUSED" - . " -DPEDANTIC -pedantic -Wno-long-long" - . " -Wall" - . " -Wextra" - . " -Wno-unused-parameter" - . " -Wno-missing-field-initializers" - . " -Wswitch" - . " -Wsign-compare" - . " -Wmissing-prototypes" - . " -Wstrict-prototypes" - . " -Wshadow" - . " -Wformat" - . " -Wtype-limits" - . " -Wundef" - . " -Werror" - ; +my @gcc_devteam_warn = qw( + -DDEBUG_UNUSED + -DPEDANTIC -pedantic -Wno-long-long + -Wall + -Wextra + -Wno-unused-parameter + -Wno-missing-field-initializers + -Wswitch + -Wsign-compare + -Wshadow + -Wformat + -Wtype-limits + -Wundef + -Werror + -Wmissing-prototypes + -Wstrict-prototypes +); # These are used in addition to $gcc_devteam_warn when the compiler is clang. # TODO(openssl-team): fix problems and investigate if (at least) the @@ -144,19 +144,16 @@ my $gcc_devteam_warn = "-DDEBUG_UNUSED" # -Wlanguage-extension-token -- no, we use asm() # -Wunused-macros -- no, too tricky for BN and _XOPEN_SOURCE etc # -Wextended-offsetof -- no, needed in CMS ASN1 code -# -Wunused-function -- no, it forces header use of safestack et al -# DEFINE macros -my $clang_devteam_warn = "" - . " -Wswitch-default" - . " -Wno-parentheses-equality" - . " -Wno-language-extension-token" - . " -Wno-extended-offsetof" - . " -Wconditional-uninitialized" - . " -Wincompatible-pointer-types-discards-qualifiers" - . " -Wmissing-variable-declarations" - . " -Wno-unknown-warning-option" - . " -Wno-unused-function" - ; +my @clang_devteam_warn = qw( + -Wswitch-default + -Wno-parentheses-equality + -Wno-language-extension-token + -Wno-extended-offsetof + -Wconditional-uninitialized + -Wincompatible-pointer-types-discards-qualifiers + -Wno-unknown-warning-option + -Wmissing-variable-declarations +); # This adds backtrace information to the memory leak info. Is only used # when crypto-mdebug-backtrace is enabled. @@ -225,20 +222,20 @@ if (grep /^reconf(igure)?$/, @argvcopy) { die "reconfiguring with other arguments present isn't supported" if scalar @argvcopy > 1; if (-f "./configdata.pm") { - my $file = "./configdata.pm"; - unless (my $return = do $file) { - die "couldn't parse $file: $@" if $@; + my $file = "./configdata.pm"; + unless (my $return = do $file) { + die "couldn't parse $file: $@" if $@; die "couldn't do $file: $!" unless defined $return; die "couldn't run $file" unless $return; - } + } - @argvcopy = defined($configdata::config{perlargv}) ? - @{$configdata::config{perlargv}} : (); - die "Incorrect data to reconfigure, please do a normal configuration\n" - if (grep(/^reconf/,@argvcopy)); - $config{perlenv} = $configdata::config{perlenv} // {}; + @argvcopy = defined($configdata::config{perlargv}) ? + @{$configdata::config{perlargv}} : (); + die "Incorrect data to reconfigure, please do a normal configuration\n" + if (grep(/^reconf/,@argvcopy)); + $config{perlenv} = $configdata::config{perlenv} // {}; } else { - die "Insufficient data to reconfigure, please do a normal configuration\n"; + die "Insufficient data to reconfigure, please do a normal configuration\n"; } } @@ -253,8 +250,8 @@ $config{shlib_version_history} = "unknown"; collect_information( collect_from_file(catfile($srcdir,'include/openssl/opensslv.h')), qr/OPENSSL.VERSION.TEXT.*OpenSSL (\S+) / => sub { $config{version} = $1; }, - qr/OPENSSL.VERSION.NUMBER.*(0x\S+)/ => sub { $config{version_num}=$1 }, - qr/SHLIB_VERSION_NUMBER *"([^"]+)"/ => sub { $config{shlib_version_number}=$1 }, + qr/OPENSSL.VERSION.NUMBER.*(0x\S+)/ => sub { $config{version_num}=$1 }, + qr/SHLIB_VERSION_NUMBER *"([^"]+)"/ => sub { $config{shlib_version_number}=$1 }, qr/SHLIB_VERSION_HISTORY *"([^"]*)"/ => sub { $config{shlib_version_history}=$1 } ); if ($config{shlib_version_history} ne "") { $config{shlib_version_history} .= ":"; } @@ -266,7 +263,7 @@ if ($config{shlib_version_history} ne "") { $config{sh die "erroneous version information in opensslv.h: ", "$config{major}, $config{minor}, $config{shlib_major}, $config{shlib_minor}\n" if ($config{major} eq "" || $config{minor} eq "" - || $config{shlib_major} eq "" || $config{shlib_minor} eq ""); + || $config{shlib_major} eq "" || $config{shlib_minor} eq ""); # Collect target configurations @@ -335,6 +332,7 @@ my @disablables = ( "autoload-config", "bf", "blake2", + "buildtest-c\\+\\+", "camellia", "capieng", "cast", @@ -351,7 +349,6 @@ my @disablables = ( "dgram", "dh", "dsa", - "dso", "dtls", "dynamic-engine", "ec", @@ -419,71 +416,70 @@ my @disablables = ( "zlib-dynamic", ); foreach my $proto ((@tls, @dtls)) - { - push(@disablables, $proto); - push(@disablables, "$proto-method") unless $proto eq "tls1_3"; - } + { + push(@disablables, $proto); + push(@disablables, "$proto-method") unless $proto eq "tls1_3"; + } my %deprecated_disablables = ( "ssl2" => undef, "buf-freelists" => undef, "ripemd" => "rmd160", "ui" => "ui-console", + "dso" => "", # Empty string means we're silent about it ); # All of the following are disabled by default: our %disabled = ( # "what" => "comment" - "asan" => "default", - "crypto-mdebug" => "default", - "crypto-mdebug-backtrace" => "default", - "devcryptoeng" => "default", - "ec_nistp_64_gcc_128" => "default", - "egd" => "default", - "external-tests" => "default", - "fuzz-libfuzzer" => "default", - "fuzz-afl" => "default", - "heartbeats" => "default", - "md2" => "default", + "asan" => "default", + "buildtest-c++" => "default", + "crypto-mdebug" => "default", + "crypto-mdebug-backtrace" => "default", + "devcryptoeng" => "default", + "ec_nistp_64_gcc_128" => "default", + "egd" => "default", + "external-tests" => "default", + "fuzz-libfuzzer" => "default", + "fuzz-afl" => "default", + "heartbeats" => "default", + "md2" => "default", "msan" => "default", - "rc5" => "default", - "sctp" => "default", - "ssl-trace" => "default", - "ssl3" => "default", - "ssl3-method" => "default", - "ubsan" => "default", - "unit-test" => "default", - "weak-ssl-ciphers" => "default", - "zlib" => "default", - "zlib-dynamic" => "default", - ); + "rc5" => "default", + "sctp" => "default", + "ssl-trace" => "default", + "ssl3" => "default", + "ssl3-method" => "default", + "ubsan" => "default", + "unit-test" => "default", + "weak-ssl-ciphers" => "default", + "zlib" => "default", + "zlib-dynamic" => "default", + ); # Note: => pair form used for aesthetics, not to truly make a hash table my @disable_cascades = ( - # "what" => [ "cascade", ... ] + # "what" => [ "cascade", ... ] sub { $config{processor} eq "386" } - => [ "sse2" ], - "ssl" => [ "ssl3" ], - "ssl3-method" => [ "ssl3" ], - "zlib" => [ "zlib-dynamic" ], - "des" => [ "mdc2" ], - "ec" => [ "ecdsa", "ecdh" ], + => [ "sse2" ], + "ssl" => [ "ssl3" ], + "ssl3-method" => [ "ssl3" ], + "zlib" => [ "zlib-dynamic" ], + "des" => [ "mdc2" ], + "ec" => [ "ecdsa", "ecdh" ], - "dgram" => [ "dtls", "sctp" ], - "sock" => [ "dgram" ], - "dtls" => [ @dtls ], + "dgram" => [ "dtls", "sctp" ], + "sock" => [ "dgram" ], + "dtls" => [ @dtls ], sub { 0 == scalar grep { !$disabled{$_} } @dtls } - => [ "dtls" ], + => [ "dtls" ], - "tls" => [ @tls ], + "tls" => [ @tls ], sub { 0 == scalar grep { !$disabled{$_} } @tls } - => [ "tls" ], + => [ "tls" ], "crypto-mdebug" => [ "crypto-mdebug-backtrace" ], - # Without DSO, we can't load dynamic engines, so don't build them dynamic - "dso" => [ "dynamic-engine" ], - # Without position independent code, there can be no shared libraries or DSOs "pic" => [ "shared" ], "shared" => [ "dynamic-engine" ], @@ -510,14 +506,14 @@ my @list = (reverse @tls); while ((my $first, my $second) = (shift @list, shift @list)) { last unless @list; push @disable_cascades, ( sub { !$disabled{$first} && $disabled{$second} } - => [ @list ] ); + => [ @list ] ); unshift @list, $second; } my @list = (reverse @dtls); while ((my $first, my $second) = (shift @list, shift @list)) { last unless @list; push @disable_cascades, ( sub { !$disabled{$first} && $disabled{$second} } - => [ @list ] ); + => [ @list ] ); unshift @list, $second; } @@ -544,24 +540,24 @@ my %user = ( AS => undef, ASFLAGS => [], CC => env('CC'), - CFLAGS => [], + CFLAGS => [ env('CFLAGS') || () ], CXX => env('CXX'), - CXXFLAGS => [], + CXXFLAGS => [ env('CXXFLAGS') || () ], CPP => undef, - CPPFLAGS => [], # -D, -I, -Wp, + CPPFLAGS => [ env('CPPFLAGS') || () ], # -D, -I, -Wp, CPPDEFINES => [], # Alternative for -D CPPINCLUDES => [], # Alternative for -I CROSS_COMPILE => env('CROSS_COMPILE'), HASHBANGPERL=> env('HASHBANGPERL') || env('PERL'), LD => undef, - LDFLAGS => [], # -L, -Wl, - LDLIBS => [], # -l + LDFLAGS => [ env('LDFLAGS') || () ], # -L, -Wl, + LDLIBS => [ env('LDLIBS') || () ], # -l MT => undef, MTFLAGS => [], PERL => env('PERL') || ($^O ne "VMS" ? $^X : "perl"), RANLIB => env('RANLIB'), RC => env('RC') || env('WINDRES'), - RCFLAGS => [], + RCFLAGS => [ env('RCFLAGS') || () ], RM => undef, ); # Info about what "make variables" may be prefixed with the cross compiler @@ -578,6 +574,7 @@ my %useradd = ( CXXFLAGS => [], LDFLAGS => [], LDLIBS => [], + RCFLAGS => [], ); my %user_synonyms = ( @@ -625,43 +622,43 @@ my %deprecated_options = (); my @known_seed_sources = qw(getrandom devrandom os egd none rdcpu librandom); my @seed_sources = (); while (@argvcopy) - { - $_ = shift @argvcopy; + { + $_ = shift @argvcopy; - # Support env variable assignments among the options - if (m|^(\w+)=(.+)?$|) - { - $cmdvars{$1} = $2; - # Every time a variable is given as a configuration argument, - # it acts as a reset if the variable. - if (exists $user{$1}) - { - $user{$1} = ref $user{$1} eq "ARRAY" ? [] : undef; - } - #if (exists $useradd{$1}) - # { - # $useradd{$1} = []; - # } - next; - } + # Support env variable assignments among the options + if (m|^(\w+)=(.+)?$|) + { + $cmdvars{$1} = $2; + # Every time a variable is given as a configuration argument, + # it acts as a reset if the variable. + if (exists $user{$1}) + { + $user{$1} = ref $user{$1} eq "ARRAY" ? [] : undef; + } + #if (exists $useradd{$1}) + # { + # $useradd{$1} = []; + # } + next; + } - # VMS is a case insensitive environment, and depending on settings - # out of our control, we may receive options uppercased. Let's - # downcase at least the part before any equal sign. - if ($^O eq "VMS") - { - s/^([^=]*)/lc($1)/e; - } + # VMS is a case insensitive environment, and depending on settings + # out of our control, we may receive options uppercased. Let's + # downcase at least the part before any equal sign. + if ($^O eq "VMS") + { + s/^([^=]*)/lc($1)/e; + } - # some people just can't read the instructions, clang people have to... - s/^-no-(?!integrated-as)/no-/; + # some people just can't read the instructions, clang people have to... + s/^-no-(?!integrated-as)/no-/; - # rewrite some options in "enable-..." form - s /^-?-?shared$/enable-shared/; - s /^sctp$/enable-sctp/; - s /^threads$/enable-threads/; - s /^zlib$/enable-zlib/; - s /^zlib-dynamic$/enable-zlib-dynamic/; + # rewrite some options in "enable-..." form + s /^-?-?shared$/enable-shared/; + s /^sctp$/enable-sctp/; + s /^threads$/enable-threads/; + s /^zlib$/enable-zlib/; + s /^zlib-dynamic$/enable-zlib-dynamic/; if (/^(no|disable|enable)-(.+)$/) { @@ -715,21 +712,24 @@ while (@argvcopy) } elsif (exists $deprecated_disablables{$1}) { - $deprecated_options{$_} = 1; - if (defined $deprecated_disablables{$1}) + if ($deprecated_disablables{$1} ne "") { - $disabled{$deprecated_disablables{$1}} = "option"; + $deprecated_options{$_} = 1; + if (defined $deprecated_disablables{$1}) + { + $disabled{$deprecated_disablables{$1}} = "option"; + } } } else { $disabled{$1} = "option"; } - # No longer an automatic choice - $auto_threads = 0 if ($1 eq "threads"); - } - elsif (/^enable-(.+)$/) - { + # No longer an automatic choice + $auto_threads = 0 if ($1 eq "threads"); + } + elsif (/^enable-(.+)$/) + { if ($1 eq "static-engine") { $disabled{"dynamic-engine"} = "option"; @@ -742,173 +742,172 @@ while (@argvcopy) { delete $disabled{"zlib"}; } - my $algo = $1; - delete $disabled{$algo}; + my $algo = $1; + delete $disabled{$algo}; - # No longer an automatic choice - $auto_threads = 0 if ($1 eq "threads"); - } - elsif (/^--strict-warnings$/) - { - $strict_warnings = 1; - } - elsif (/^--debug$/) - { - $config{build_type} = "debug"; - } - elsif (/^--release$/) - { - $config{build_type} = "release"; - } - elsif (/^386$/) - { $config{processor}=386; } - elsif (/^fips$/) - { - die "FIPS mode not supported\n"; - } - elsif (/^rsaref$/) - { - # No RSAref support any more since it's not needed. - # The check for the option is there so scripts aren't - # broken - } - elsif (/^nofipscanistercheck$/) - { - die "FIPS mode not supported\n"; - } - elsif (/^[-+]/) - { - if (/^--prefix=(.*)$/) - { - $config{prefix}=$1; - die "Directory given with --prefix MUST be absolute\n" - unless file_name_is_absolute($config{prefix}); - } - elsif (/^--api=(.*)$/) - { - $config{api}=$1; - } - elsif (/^--libdir=(.*)$/) - { - $config{libdir}=$1; - } - elsif (/^--openssldir=(.*)$/) - { - $config{openssldir}=$1; - } - elsif (/^--with-zlib-lib=(.*)$/) - { - $withargs{zlib_lib}=$1; - } - elsif (/^--with-zlib-include=(.*)$/) - { - $withargs{zlib_include}=$1; - } - elsif (/^--with-fuzzer-lib=(.*)$/) - { - $withargs{fuzzer_lib}=$1; - } - elsif (/^--with-fuzzer-include=(.*)$/) - { - $withargs{fuzzer_include}=$1; - } - elsif (/^--with-rand-seed=(.*)$/) - { - foreach my $x (split(m|,|, $1)) - { - die "Unknown --with-rand-seed choice $x\n" - if ! grep { $x eq $_ } @known_seed_sources; - push @seed_sources, $x; - } + # No longer an automatic choice + $auto_threads = 0 if ($1 eq "threads"); + } + elsif (/^--strict-warnings$/) + { + # Pretend that our strict flags is a C flag, and replace it + # with the proper flags later on + push @{$useradd{CFLAGS}}, '--ossl-strict-warnings'; + $strict_warnings=1; + } + elsif (/^--debug$/) + { + $config{build_type} = "debug"; + } + elsif (/^--release$/) + { + $config{build_type} = "release"; + } + elsif (/^386$/) + { $config{processor}=386; } + elsif (/^fips$/) + { + die "FIPS mode not supported\n"; + } + elsif (/^rsaref$/) + { + # No RSAref support any more since it's not needed. + # The check for the option is there so scripts aren't + # broken + } + elsif (/^nofipscanistercheck$/) + { + die "FIPS mode not supported\n"; + } + elsif (/^[-+]/) + { + if (/^--prefix=(.*)$/) + { + $config{prefix}=$1; + die "Directory given with --prefix MUST be absolute\n" + unless file_name_is_absolute($config{prefix}); } - elsif (/^--cross-compile-prefix=(.*)$/) - { - $user{CROSS_COMPILE}=$1; - } - elsif (/^--config=(.*)$/) - { - read_config $1; - } - elsif (/^-l(.*)$/) - { - push @{$useradd{LDLIBS}}, $_; - } - elsif (/^-framework$/) - { - push @{$useradd{LDLIBS}}, $_, shift(@argvcopy); - } - elsif (/^-L(.*)$/ or /^-Wl,/) - { - push @{$useradd{LDFLAGS}}, $_; - } - elsif (/^-rpath$/ or /^-R$/) - # -rpath is the OSF1 rpath flag - # -R is the old Solaris rpath flag - { - my $rpath = shift(@argvcopy) || ""; - $rpath .= " " if $rpath ne ""; - push @{$useradd{LDFLAGS}}, $_, $rpath; - } - elsif (/^-static$/) - { - push @{$useradd{LDFLAGS}}, $_; - $disabled{"dso"} = "forced"; - $disabled{"pic"} = "forced"; - $disabled{"shared"} = "forced"; - $disabled{"threads"} = "forced"; - } - elsif (/^-D(.*)$/) - { - push @{$useradd{CPPDEFINES}}, $1; - } - elsif (/^-I(.*)$/) - { - push @{$useradd{CPPINCLUDES}}, $1; - } - elsif (/^-Wp,$/) - { - push @{$useradd{CPPFLAGS}}, $1; - } - else # common if (/^[-+]/), just pass down... - { - $_ =~ s/%([0-9a-f]{1,2})/chr(hex($1))/gei; - push @{$useradd{CFLAGS}}, $_; - push @{$useradd{CXXFLAGS}}, $_; - } - } - else - { - die "target already defined - $target (offending arg: $_)\n" if ($target ne ""); - $target=$_; - } - unless ($_ eq $target || /^no-/ || /^disable-/) - { - # "no-..." follows later after implied deactivations - # have been derived. (Don't take this too seriously, - # we really only write OPTIONS to the Makefile out of - # nostalgia.) + elsif (/^--api=(.*)$/) + { + $config{api}=$1; + } + elsif (/^--libdir=(.*)$/) + { + $config{libdir}=$1; + } + elsif (/^--openssldir=(.*)$/) + { + $config{openssldir}=$1; + } + elsif (/^--with-zlib-lib=(.*)$/) + { + $withargs{zlib_lib}=$1; + } + elsif (/^--with-zlib-include=(.*)$/) + { + $withargs{zlib_include}=$1; + } + elsif (/^--with-fuzzer-lib=(.*)$/) + { + $withargs{fuzzer_lib}=$1; + } + elsif (/^--with-fuzzer-include=(.*)$/) + { + $withargs{fuzzer_include}=$1; + } + elsif (/^--with-rand-seed=(.*)$/) + { + foreach my $x (split(m|,|, $1)) + { + die "Unknown --with-rand-seed choice $x\n" + if ! grep { $x eq $_ } @known_seed_sources; + push @seed_sources, $x; + } + } + elsif (/^--cross-compile-prefix=(.*)$/) + { + $user{CROSS_COMPILE}=$1; + } + elsif (/^--config=(.*)$/) + { + read_config $1; + } + elsif (/^-l(.*)$/) + { + push @{$useradd{LDLIBS}}, $_; + } + elsif (/^-framework$/) + { + push @{$useradd{LDLIBS}}, $_, shift(@argvcopy); + } + elsif (/^-L(.*)$/ or /^-Wl,/) + { + push @{$useradd{LDFLAGS}}, $_; + } + elsif (/^-rpath$/ or /^-R$/) + # -rpath is the OSF1 rpath flag + # -R is the old Solaris rpath flag + { + my $rpath = shift(@argvcopy) || ""; + $rpath .= " " if $rpath ne ""; + push @{$useradd{LDFLAGS}}, $_, $rpath; + } + elsif (/^-static$/) + { + push @{$useradd{LDFLAGS}}, $_; + } + elsif (/^-D(.*)$/) + { + push @{$useradd{CPPDEFINES}}, $1; + } + elsif (/^-I(.*)$/) + { + push @{$useradd{CPPINCLUDES}}, $1; + } + elsif (/^-Wp,$/) + { + push @{$useradd{CPPFLAGS}}, $1; + } + else # common if (/^[-+]/), just pass down... + { + $_ =~ s/%([0-9a-f]{1,2})/chr(hex($1))/gei; + push @{$useradd{CFLAGS}}, $_; + push @{$useradd{CXXFLAGS}}, $_; + } + } + else + { + die "target already defined - $target (offending arg: $_)\n" if ($target ne ""); + $target=$_; + } + unless ($_ eq $target || /^no-/ || /^disable-/) + { + # "no-..." follows later after implied deactivations + # have been derived. (Don't take this too seriously, + # we really only write OPTIONS to the Makefile out of + # nostalgia.) - if ($config{options} eq "") - { $config{options} = $_; } - else - { $config{options} .= " ".$_; } - } - } + if ($config{options} eq "") + { $config{options} = $_; } + else + { $config{options} .= " ".$_; } + } + } if (defined($config{api}) && !exists $apitable->{$config{api}}) { - die "***** Unsupported api compatibility level: $config{api}\n", + die "***** Unsupported api compatibility level: $config{api}\n", } if (keys %deprecated_options) - { - warn "***** Deprecated options: ", - join(", ", keys %deprecated_options), "\n"; - } + { + warn "***** Deprecated options: ", + join(", ", keys %deprecated_options), "\n"; + } if (keys %unsupported_options) - { - die "***** Unsupported options: ", - join(", ", keys %unsupported_options), "\n"; - } + { + die "***** Unsupported options: ", + join(", ", keys %unsupported_options), "\n"; + } # If any %useradd entry has been set, we must check that the "make # variables" haven't been set. We start by checking of any %useradd entry @@ -964,36 +963,46 @@ if (grep { /-rpath\b/ } ($user{LDFLAGS} ? @{$user{LDFL && !$disabled{shared} && !($disabled{asan} && $disabled{msan} && $disabled{ubsan})) { die "***** Cannot simultaneously use -rpath, shared libraries, and\n", - "***** any of asan, msan or ubsan\n"; + "***** any of asan, msan or ubsan\n"; } -my @tocheckfor = (keys %disabled); -while (@tocheckfor) { - my %new_tocheckfor = (); - my @cascade_copy = (@disable_cascades); - while (@cascade_copy) { - my ($test, $descendents) = (shift @cascade_copy, shift @cascade_copy); - if (ref($test) eq "CODE" ? $test->() : defined($disabled{$test})) { - foreach(grep { !defined($disabled{$_}) } @$descendents) { - $new_tocheckfor{$_} = 1; $disabled{$_} = "forced"; - } - } +sub disable { + my $disable_type = shift; + + for (@_) { + $disabled{$_} = $disable_type; } - @tocheckfor = (keys %new_tocheckfor); + + my @tocheckfor = (@_ ? @_ : keys %disabled); + while (@tocheckfor) { + my %new_tocheckfor = (); + my @cascade_copy = (@disable_cascades); + while (@cascade_copy) { + my ($test, $descendents) = + (shift @cascade_copy, shift @cascade_copy); + if (ref($test) eq "CODE" ? $test->() : defined($disabled{$test})) { + foreach (grep { !defined($disabled{$_}) } @$descendents) { + $new_tocheckfor{$_} = 1; $disabled{$_} = "cascade"; + } + } + } + @tocheckfor = (keys %new_tocheckfor); + } } +disable(); # First cascade run our $die = sub { die @_; }; if ($target eq "TABLE") { local $die = sub { warn @_; }; foreach (sort keys %table) { - print_table_entry($_, "TABLE"); + print_table_entry($_, "TABLE"); } exit 0; } if ($target eq "LIST") { foreach (sort keys %table) { - print $_,"\n" unless $table{$_}->{template}; + print $_,"\n" unless $table{$_}->{template}; } exit 0; } @@ -1002,7 +1011,7 @@ if ($target eq "HASH") { local $die = sub { warn @_; }; print "%table = (\n"; foreach (sort keys %table) { - print_table_entry($_, "HASH"); + print_table_entry($_, "HASH"); } exit 0; } @@ -1033,7 +1042,7 @@ _____ } push @{$config{openssl_other_defines}}, map { (my $x = $_) =~ tr|[\-a-z]|[_A-Z]|; "OPENSSL_RAND_SEED_$x" } - @seed_sources; + @seed_sources; # Backward compatibility? if ($target =~ m/^CygWin32(-.*)$/) { @@ -1047,7 +1056,7 @@ if ($d) { # If we do not find debug-foo in the table, the target is set to foo. if (!$table{$target}) { - $target = $t; + $target = $t; } } @@ -1064,47 +1073,11 @@ foreach (keys %target_attr_translate) { %target = ( %{$table{DEFAULTS}}, %target ); -# Make the flags to build DSOs the same as for shared libraries unless they -# are already defined -$target{module_cflags} = $target{shared_cflag} unless defined $target{module_cflags}; -$target{module_cxxflags} = $target{shared_cxxflag} unless defined $target{module_cxxflags}; -$target{module_ldflags} = $target{shared_ldflag} unless defined $target{module_ldflags}; *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@freebsd.org Wed May 29 00:10:50 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CAD6C15B0CDB; Wed, 29 May 2019 00:10:50 +0000 (UTC) (envelope-from glebius@freebsd.org) Received: from cell.glebi.us (glebi.us [162.251.186.162]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "cell.glebi.us", Issuer "cell.glebi.us" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id ECC5670DF5; Wed, 29 May 2019 00:10:49 +0000 (UTC) (envelope-from glebius@freebsd.org) Received: from cell.glebi.us (localhost [127.0.0.1]) by cell.glebi.us (8.15.2/8.15.2) with ESMTPS id x4T0Ak9t023556 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NO); Tue, 28 May 2019 17:10:47 -0700 (PDT) (envelope-from glebius@freebsd.org) Received: (from glebius@localhost) by cell.glebi.us (8.15.2/8.15.2/Submit) id x4T0AkWA023555; Tue, 28 May 2019 17:10:46 -0700 (PDT) (envelope-from glebius@freebsd.org) X-Authentication-Warning: cell.glebi.us: glebius set sender to glebius@freebsd.org using -f Date: Tue, 28 May 2019 17:10:46 -0700 From: Gleb Smirnoff To: "Andrey V. Elsukov" , kib@freebsd.org Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r348303 - head/sys/net Message-ID: <20190529001046.GC21836@FreeBSD.org> References: <201905271241.x4RCffTm047128@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201905271241.x4RCffTm047128@repo.freebsd.org> User-Agent: Mutt/1.11.4 (2019-03-13) X-Rspamd-Queue-Id: ECC5670DF5 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[freebsd.org]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.96)[-0.955,0]; ASN(0.00)[asn:27348, ipnet:162.251.186.0/24, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 29 May 2019 00:10:51 -0000 Hi Andrey, I made a different change to mitigate this panic: don't clear the pointer. --- a/FreeBSD/sys/net/bpf.c +++ b/FreeBSD/sys/net/bpf.c @@ -857,7 +857,6 @@ bpf_detachd_locked(struct bpf_d *d, bool detached_ifp) /* Save bd_writer value */ error = d->bd_writer; ifp = bp->bif_ifp; - d->bd_bif = NULL; if (detached_ifp) { /* * Notify descriptor as it's detached, so that any Since every bpf_d holds a reference on bpf_if until delayed free happens, the the bpf_if is going to be valid. This allows not to use epoch_wait and run fully async. The patch above is a minimal patch: with NULL assignment removed, several more pieces of code can be removed in bpf.c Of course your patch also is going to work, but what do you think: are there any landmines with fully async approach? On Mon, May 27, 2019 at 12:41:41PM +0000, Andrey V. Elsukov wrote: A> Author: ae A> Date: Mon May 27 12:41:41 2019 A> New Revision: 348303 A> URL: https://svnweb.freebsd.org/changeset/base/348303 A> A> Log: A> Fix possible NULL pointer dereference. A> A> bpf_mtap() can invoke catchpacket() for already detached descriptor. A> And this can lead to NULL pointer dereference, since bd_bif pointer A> was reset to NULL in bpf_detachd_locked(). To avoid this, use A> NET_EPOCH_WAIT() when descriptor is removed from interface's descriptors A> list. After the wait it is safe to modify descriptor's content. A> A> Submitted by: kib A> Reported by: slavash A> MFC after: 1 week A> A> Modified: A> head/sys/net/bpf.c A> A> Modified: head/sys/net/bpf.c A> ============================================================================== A> --- head/sys/net/bpf.c Mon May 27 06:37:23 2019 (r348302) A> +++ head/sys/net/bpf.c Mon May 27 12:41:41 2019 (r348303) A> @@ -850,10 +850,15 @@ bpf_detachd_locked(struct bpf_d *d, bool detached_ifp) A> /* Check if descriptor is attached */ A> if ((bp = d->bd_bif) == NULL) A> return; A> + /* A> + * Remove d from the interface's descriptor list. A> + * And wait until bpf_[m]tap*() will finish their possible work A> + * with descriptor. A> + */ A> + CK_LIST_REMOVE(d, bd_next); A> + NET_EPOCH_WAIT(); A> A> BPFD_LOCK(d); A> - /* Remove d from the interface's descriptor list. */ A> - CK_LIST_REMOVE(d, bd_next); A> /* Save bd_writer value */ A> error = d->bd_writer; A> ifp = bp->bif_ifp; A> -- Gleb Smirnoff From owner-svn-src-head@freebsd.org Wed May 29 00:14:18 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9F65E15B0FE4; Wed, 29 May 2019 00:14:18 +0000 (UTC) (envelope-from glebius@freebsd.org) Received: from cell.glebi.us (glebi.us [162.251.186.162]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "cell.glebi.us", Issuer "cell.glebi.us" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id F0C6771224; Wed, 29 May 2019 00:14:17 +0000 (UTC) (envelope-from glebius@freebsd.org) Received: from cell.glebi.us (localhost [127.0.0.1]) by cell.glebi.us (8.15.2/8.15.2) with ESMTPS id x4T0EFTj023588 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NO); Tue, 28 May 2019 17:14:15 -0700 (PDT) (envelope-from glebius@freebsd.org) Received: (from glebius@localhost) by cell.glebi.us (8.15.2/8.15.2/Submit) id x4T0EFrP023587; Tue, 28 May 2019 17:14:15 -0700 (PDT) (envelope-from glebius@freebsd.org) X-Authentication-Warning: cell.glebi.us: glebius set sender to glebius@freebsd.org using -f Date: Tue, 28 May 2019 17:14:15 -0700 From: Gleb Smirnoff To: "Andrey V. Elsukov" Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r348324 - head/sys/net Message-ID: <20190529001415.GD21836@FreeBSD.org> References: <201905281145.x4SBj0Yj094548@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201905281145.x4SBj0Yj094548@repo.freebsd.org> User-Agent: Mutt/1.11.4 (2019-03-13) X-Rspamd-Queue-Id: F0C6771224 X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.95 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; REPLY(-4.00)[]; NEURAL_HAM_SHORT(-0.95)[-0.953,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 29 May 2019 00:14:18 -0000 Hi, sorry for short followup, replied on previous commit without reading through whole mailbox. Given the fallout of r348303 I'd suggest to consider my one liner as a proper solution to the problem. On Tue, May 28, 2019 at 11:45:00AM +0000, Andrey V. Elsukov wrote: A> Author: ae A> Date: Tue May 28 11:45:00 2019 A> New Revision: 348324 A> URL: https://svnweb.freebsd.org/changeset/base/348324 A> A> Log: A> Rework r348303 to reduce the time of holding global BPF lock. A> A> It appeared that using NET_EPOCH_WAIT() while holding global BPF lock A> can lead to another panic: A> A> spin lock 0xfffff800183c9840 (turnstile lock) held by 0xfffff80018e2c5a0 (tid 100325) too long A> panic: spin lock held too long A> ... A> #0 sched_switch (td=0xfffff80018e2c5a0, newtd=0xfffff8000389e000, flags=) at /usr/src/sys/kern/sched_ule.c:2133 A> #1 0xffffffff80bf9912 in mi_switch (flags=256, newtd=0x0) at /usr/src/sys/kern/kern_synch.c:439 A> #2 0xffffffff80c21db7 in sched_bind (td=, cpu=) at /usr/src/sys/kern/sched_ule.c:2704 A> #3 0xffffffff80c34c33 in epoch_block_handler_preempt (global=, cr=0xfffffe00005a1a00, arg=) A> at /usr/src/sys/kern/subr_epoch.c:394 A> #4 0xffffffff803c741b in epoch_block (global=, cr=, cb=, ct=) A> at /usr/src/sys/contrib/ck/src/ck_epoch.c:416 A> #5 ck_epoch_synchronize_wait (global=0xfffff8000380cd80, cb=, ct=) at /usr/src/sys/contrib/ck/src/ck_epoch.c:465 A> #6 0xffffffff80c3475e in epoch_wait_preempt (epoch=0xfffff8000380cd80) at /usr/src/sys/kern/subr_epoch.c:513 A> #7 0xffffffff80ce970b in bpf_detachd_locked (d=0xfffff801d309cc00, detached_ifp=) at /usr/src/sys/net/bpf.c:856 A> #8 0xffffffff80ced166 in bpf_detachd (d=) at /usr/src/sys/net/bpf.c:836 A> #9 bpf_dtor (data=0xfffff801d309cc00) at /usr/src/sys/net/bpf.c:914 A> A> To fix this add the check to the catchpacket() that BPF descriptor was A> not detached just before we acquired BPFD_LOCK(). A> A> Reported by: slavash A> Tested by: slavash A> MFC after: 1 week A> A> Modified: A> head/sys/net/bpf.c A> A> Modified: head/sys/net/bpf.c A> ============================================================================== A> --- head/sys/net/bpf.c Tue May 28 10:55:59 2019 (r348323) A> +++ head/sys/net/bpf.c Tue May 28 11:45:00 2019 (r348324) A> @@ -850,15 +850,10 @@ bpf_detachd_locked(struct bpf_d *d, bool detached_ifp) A> /* Check if descriptor is attached */ A> if ((bp = d->bd_bif) == NULL) A> return; A> - /* A> - * Remove d from the interface's descriptor list. A> - * And wait until bpf_[m]tap*() will finish their possible work A> - * with descriptor. A> - */ A> - CK_LIST_REMOVE(d, bd_next); A> - NET_EPOCH_WAIT(); A> A> BPFD_LOCK(d); A> + /* Remove d from the interface's descriptor list. */ A> + CK_LIST_REMOVE(d, bd_next); A> /* Save bd_writer value */ A> error = d->bd_writer; A> ifp = bp->bif_ifp; A> @@ -2494,6 +2489,11 @@ catchpacket(struct bpf_d *d, u_char *pkt, u_int pktlen A> int tstype; A> A> BPFD_LOCK_ASSERT(d); A> + if (d->bd_bif == NULL) { A> + /* Descriptor was detached in concurrent thread */ A> + counter_u64_add(d->bd_dcount, 1); A> + return; A> + } A> A> /* A> * Detect whether user space has released a buffer back to us, and if A> -- Gleb Smirnoff From owner-svn-src-head@freebsd.org Wed May 29 00:23:30 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7B8D215B13C5; Wed, 29 May 2019 00:23:30 +0000 (UTC) (envelope-from bu7cher@yandex.ru) Received: from forward101o.mail.yandex.net (forward101o.mail.yandex.net [IPv6:2a02:6b8:0:1a2d::601]) (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 EBA7E717B1; Wed, 29 May 2019 00:23:29 +0000 (UTC) (envelope-from bu7cher@yandex.ru) Received: from mxback19j.mail.yandex.net (mxback19j.mail.yandex.net [IPv6:2a02:6b8:0:1619::95]) by forward101o.mail.yandex.net (Yandex) with ESMTP id 83E3C3C00DA6; Wed, 29 May 2019 03:23:25 +0300 (MSK) Received: from smtp1p.mail.yandex.net (smtp1p.mail.yandex.net [2a02:6b8:0:1472:2741:0:8b6:6]) by mxback19j.mail.yandex.net (nwsmtp/Yandex) with ESMTP id FV053QObeH-NPa8H8MA; Wed, 29 May 2019 03:23:25 +0300 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yandex.ru; s=mail; t=1559089405; bh=LYRoXIGy7dT2/S1gbtDupldQO4lpRlsGaOjpK7IBtIY=; h=In-Reply-To:From:To:Subject:Cc:Date:References:Message-ID; b=XP/1c0JbHYI41oXCXfIwBECzZFf4e+WvDg4tht1IGe1yW1jLppIDRHzxiTJDI9+Nq 55wgldh9QsXwbJiyeYEnZLEek20jW44UZHg6IF9Y5uc1KyUDYhpb61osCjsB4fSx83 MuM/tvNmW9ir5MKVgb6Y8CJ9C7zwtISjNqdoMS0Y= Received: by smtp1p.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id FZwmZgcLfy-NO7SD94r; Wed, 29 May 2019 03:23:24 +0300 (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client certificate not present) Subject: Re: svn commit: r348303 - head/sys/net To: Gleb Smirnoff , "Andrey V. Elsukov" , kib@freebsd.org Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201905271241.x4RCffTm047128@repo.freebsd.org> <20190529001046.GC21836@FreeBSD.org> From: "Andrey V. Elsukov" Openpgp: preference=signencrypt Autocrypt: addr=bu7cher@yandex.ru; prefer-encrypt=mutual; keydata= mQENBEwBF1kBCADB9sXFhBEUy8qQ4X63Y8eBatYMHGEFWN9ypS5lI3RE6qQW2EYbxNk7qUC5 21YIIS1mMFVBEfvR7J9uc7yaYgFCEb6Sce1RSO4ULN2mRKGHP3/Sl0ijZEjWHV91hY1YTHEF ZW/0GYinDf56sYpDDehaBF5wkWIo1+QK5nmj3vl0DIDCMNd7QEiWpyLVwECgLX2eOAXByT8B bCqVhJGcG6iFP7/B9Ll6uX5gb8thM9LM+ibwErDBVDGiOgvfxqidab7fdkh893IBCXa82H9N CNwnEtcgzh+BSKK5BgvPohFMgRwjti37TSxwLu63QejRGbZWSz3OK3jMOoF63tCgn7FvABEB AAG0JUFuZHJleSBWLiBFbHN1a292IDxidTdjaGVyQHlhbmRleC5ydT6JATgEEwECACIFAkwB F1kCGwMGCwkIBwMCBhUIAgkKCwQWAgMBAh4BAheAAAoJEAHF6gQQyKF6qmYIAI6ekfm1VA4T vqankI1ISE6ku4jV7UlpIQlEbE7/8n3Zd6teJ+pGOQhN5qk8QE7utdPdbktAzi+x7LIJVzUw 4TywZLXGrkP7VKYkfg6oyCGyzITghefQeJtr2TN4hYCkzPWpylkue8MtmqfZv/6royqwTbN+ +E09FQNvTgRUYJYTeQ1qOsxNRycwvw3dr2rOfuxShbzaHBB1pBIjGrMg8fC5pd65ACH5zuFV A0CoTNGMDrEZSfBkTW604UUHFFXeCoC3dwDZRKOWJ3GmMXns65Ai5YkA63BSHEE1Qle3VBhd cG1w0CB5FBV3pB27UVnf0jEbysrDqW4qN7XMRFSWNAy5AQ0ETAEXWQEIAJ2p6l9LBoqdH/0J PEFDY2t2gTvAuzz+8zs3R03dFuHcNbOwjvWCG0aOmVpAzkRa8egn5JB4sZaFUtKPYJEQ1Iu+ LUBwgvtXf4vWpzC67zs2dDuiW4LamH5p6xkTD61aHR7mCB3bg2TUjrDWn2Jt44cvoYxj3dz4 S49U1rc9ZPgD5axCNv45j72tggWlZvpefThP7xT1OlNTUqye2gAwQravXpZkl5JG4eOqJVIU X316iE3qso0iXRUtO7OseBf0PiVmk+wCahdreHOeOxK5jMhYkPKVn7z1sZiB7W2H2TojbmcK HZC22sz7Z/H36Lhg1+/RCnGzdEcjGc8oFHXHCxUAEQEAAYkBHwQYAQIACQUCTAEXWQIbDAAK CRABxeoEEMihegkYCAC3ivGYNe2taNm/4Nx5GPdzuaAJGKWksV+w9mo7dQvU+NmI2az5w8vw 98OmX7G0OV9snxMW+6cyNqBrVFTu33VVNzz9pnqNCHxGvj5dL5ltP160JV2zw2bUwJBYsgYQ WfyJJIM7l3gv5ZS3DGqaGIm9gOK1ANxfrR5PgPzvI9VxDhlr2juEVMZYAqPLEJe+SSxbwLoz BcFCNdDAyXcaAzXsx/E02YWm1hIWNRxanAe7Vlg7OL+gvLpdtrYCMg28PNqKNyrQ87LQ49O9 50IIZDOtNFeR0FGucjcLPdS9PiEqCoH7/waJxWp6ydJ+g4OYRBYNM0EmMgy1N85JJrV1mi5i Message-ID: Date: Wed, 29 May 2019 03:23:23 +0300 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.14; rv:60.0) Gecko/20100101 Thunderbird/60.6.1 MIME-Version: 1.0 In-Reply-To: <20190529001046.GC21836@FreeBSD.org> Content-Type: text/plain; charset=utf-8 Content-Language: ru Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: EBA7E717B1 X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.97 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.97)[-0.975,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; REPLY(-4.00)[] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 29 May 2019 00:23:30 -0000 29.05.2019 3:10, Gleb Smirnoff пишет: > Hi Andrey, > > I made a different change to mitigate this panic: don't clear the pointer. > > --- a/FreeBSD/sys/net/bpf.c > +++ b/FreeBSD/sys/net/bpf.c > @@ -857,7 +857,6 @@ bpf_detachd_locked(struct bpf_d *d, bool detached_ifp) > /* Save bd_writer value */ > error = d->bd_writer; > ifp = bp->bif_ifp; > - d->bd_bif = NULL; > if (detached_ifp) { > /* > * Notify descriptor as it's detached, so that any > > Since every bpf_d holds a reference on bpf_if until delayed free happens, > the the bpf_if is going to be valid. > > This allows not to use epoch_wait and run fully async. The patch above is > a minimal patch: with NULL assignment removed, several more pieces of code > can be removed in bpf.c > > Of course your patch also is going to work, but what do you think: > are there any landmines with fully async approach? Hi, bpf_mtap() is not the only consumer of bd_bif, some of them expect it becomes NULL when descriptor is detached. -- WBR, Andrey V. Elsukov From owner-svn-src-head@freebsd.org Wed May 29 01:08:31 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 65E4A15B20E8; Wed, 29 May 2019 01:08:31 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 03D107299A; Wed, 29 May 2019 01:08:31 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D0050225EE; Wed, 29 May 2019 01:08:30 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x4T18UV6014930; Wed, 29 May 2019 01:08:30 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4T18Ub3014929; Wed, 29 May 2019 01:08:30 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201905290108.x4T18Ub3014929@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Wed, 29 May 2019 01:08:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r348346 - head/sys/net X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/sys/net X-SVN-Commit-Revision: 348346 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 03D107299A X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.96)[-0.956,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 29 May 2019 01:08:31 -0000 Author: kevans Date: Wed May 29 01:08:30 2019 New Revision: 348346 URL: https://svnweb.freebsd.org/changeset/base/348346 Log: if_bridge(4): Complete bpf auditing of local traffic over the bridge There were two remaining "gaps" in auditing local bridge traffic with bpf(4): Locally originated outbound traffic from a member interface is invisible to the bridge's bpf(4) interface. Inbound traffic locally destined to a member interface is invisible to the member's bpf(4) interface -- this traffic has no chance after bridge_input to otherwise pass it over, and it wasn't originally received on this interface. I call these "gaps" because they don't affect conventional bridge setups. Alas, being able to establish an audit trail of all locally destined traffic for setups that can function like this is useful in some scenarios. Reviewed by: kp MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D19757 Modified: head/sys/net/if_bridge.c Modified: head/sys/net/if_bridge.c ============================================================================== --- head/sys/net/if_bridge.c Wed May 29 00:54:49 2019 (r348345) +++ head/sys/net/if_bridge.c Wed May 29 01:08:30 2019 (r348346) @@ -2000,7 +2000,7 @@ bridge_output(struct ifnet *ifp, struct mbuf *m, struc struct rtentry *rt) { struct ether_header *eh; - struct ifnet *dst_if; + struct ifnet *bifp, *dst_if; struct bridge_softc *sc; uint16_t vlan; @@ -2015,13 +2015,14 @@ bridge_output(struct ifnet *ifp, struct mbuf *m, struc vlan = VLANTAGOF(m); BRIDGE_LOCK(sc); + bifp = sc->sc_ifp; /* * If bridge is down, but the original output interface is up, * go ahead and send out that interface. Otherwise, the packet * is dropped below. */ - if ((sc->sc_ifp->if_drv_flags & IFF_DRV_RUNNING) == 0) { + if ((bifp->if_drv_flags & IFF_DRV_RUNNING) == 0) { dst_if = ifp; goto sendunicast; } @@ -2034,6 +2035,9 @@ bridge_output(struct ifnet *ifp, struct mbuf *m, struc dst_if = NULL; else dst_if = bridge_rtlookup(sc, eh->ether_dhost, vlan); + /* Tap any traffic not passing back out the originating interface */ + if (dst_if != ifp) + ETHER_BPF_MTAP(bifp, m); if (dst_if == NULL) { struct bridge_iflist *bif; struct mbuf *mc; @@ -2071,7 +2075,7 @@ bridge_output(struct ifnet *ifp, struct mbuf *m, struc } else { mc = m_copypacket(m, M_NOWAIT); if (mc == NULL) { - if_inc_counter(sc->sc_ifp, IFCOUNTER_OERRORS, 1); + if_inc_counter(bifp, IFCOUNTER_OERRORS, 1); continue; } } @@ -2450,6 +2454,8 @@ bridge_input(struct ifnet *ifp, struct mbuf *m) return (NULL); \ } \ } \ + if ((iface) != bifp) \ + ETHER_BPF_MTAP(iface, m); \ BRIDGE_UNLOCK(sc); \ return (m); \ } \ From owner-svn-src-head@freebsd.org Wed May 29 02:02:57 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1C37515B3030; Wed, 29 May 2019 02:02:57 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id B4CD074721; Wed, 29 May 2019 02:02:56 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 896E522FD8; Wed, 29 May 2019 02:02:56 +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 x4T22u86045559; Wed, 29 May 2019 02:02:56 GMT (envelope-from jhibbits@FreeBSD.org) Received: (from jhibbits@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4T22uXG045558; Wed, 29 May 2019 02:02:56 GMT (envelope-from jhibbits@FreeBSD.org) Message-Id: <201905290202.x4T22uXG045558@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhibbits set sender to jhibbits@FreeBSD.org using -f From: Justin Hibbits Date: Wed, 29 May 2019 02:02:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r348347 - head/contrib/elftoolchain/libdwarf X-SVN-Group: head X-SVN-Commit-Author: jhibbits X-SVN-Commit-Paths: head/contrib/elftoolchain/libdwarf X-SVN-Commit-Revision: 348347 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: B4CD074721 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.95)[-0.952,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 29 May 2019 02:02:57 -0000 Author: jhibbits Date: Wed May 29 02:02:56 2019 New Revision: 348347 URL: https://svnweb.freebsd.org/changeset/base/348347 Log: Add missing powerpc64 relocation support to libdwarf Summary: Due to missing relocation support in libdwarf for powerpc64, handling of dwarf info on unlinked objects was bogus. Examining raw dwarf data on objects compiled on ppc64 with a modern compiler (in-tree gcc tends to hide the issue, since it only rarely generates relocations in .debug_info and uses DW_FORM_str instead of DW_FORM_strp for everything), you will find that the dwarf data appears corrupt, with repeated references to the compiler version where things like types and function names should appear. This happens because the 0 offset of .debug_str contains the compiler version, and without applying the relocations, *all* indirect strings in .dwarf_info will end up pointing to it. This corruption then propogates to the CTF data, as ctfconvert relies on libdwarf to read the dwarf info, for every compiled object (when building a kernel.) However, if you examine the dwarf data on a compiled executable, it will appear correct, because during final link the relocations get applied and baked in by the linker. Submitted by: Brandon Bergren Reviewed By: emaste Differential Revision: https://reviews.freebsd.org/D20367 Modified: head/contrib/elftoolchain/libdwarf/libdwarf_reloc.c Modified: head/contrib/elftoolchain/libdwarf/libdwarf_reloc.c ============================================================================== --- head/contrib/elftoolchain/libdwarf/libdwarf_reloc.c Wed May 29 01:08:30 2019 (r348346) +++ head/contrib/elftoolchain/libdwarf/libdwarf_reloc.c Wed May 29 02:02:56 2019 (r348347) @@ -44,7 +44,7 @@ _dwarf_get_reloc_type(Dwarf_P_Debug dbg, int is64) case DW_ISA_SPARC: return (is64 ? R_SPARC_UA64 : R_SPARC_UA32); case DW_ISA_PPC: - return (R_PPC_ADDR32); + return (is64 ? R_PPC64_ADDR64 : R_PPC_ADDR32); case DW_ISA_ARM: return (R_ARM_ABS32); case DW_ISA_MIPS: @@ -96,6 +96,12 @@ _dwarf_get_reloc_size(Dwarf_Debug dbg, Dwarf_Unsigned case EM_PPC: if (rel_type == R_PPC_ADDR32) return (4); + break; + case EM_PPC64: + if (rel_type == R_PPC_ADDR32) + return (4); + else if (rel_type == R_PPC64_ADDR64) + return (8); break; case EM_MIPS: if (rel_type == R_MIPS_32) From owner-svn-src-head@freebsd.org Wed May 29 02:08:24 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 483A015B310C; Wed, 29 May 2019 02:08:24 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id E24FD7498D; Wed, 29 May 2019 02:08:23 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B767222FE1; Wed, 29 May 2019 02:08:23 +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 x4T28N5c045877; Wed, 29 May 2019 02:08:23 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4T28NlQ045875; Wed, 29 May 2019 02:08:23 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201905290208.x4T28NlQ045875@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Wed, 29 May 2019 02:08:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r348349 - in head: lib/libc/net sys/i386/i386 X-SVN-Group: head X-SVN-Commit-Author: pfg X-SVN-Commit-Paths: in head: lib/libc/net sys/i386/i386 X-SVN-Commit-Revision: 348349 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: E24FD7498D X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.95)[-0.952,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 29 May 2019 02:08:24 -0000 Author: pfg Date: Wed May 29 02:08:23 2019 New Revision: 348349 URL: https://svnweb.freebsd.org/changeset/base/348349 Log: typo: suppported. Modified: head/lib/libc/net/rthdr.c head/sys/i386/i386/initcpu.c Modified: head/lib/libc/net/rthdr.c ============================================================================== --- head/lib/libc/net/rthdr.c Wed May 29 02:03:08 2019 (r348348) +++ head/lib/libc/net/rthdr.c Wed May 29 02:08:23 2019 (r348349) @@ -282,7 +282,7 @@ inet6_rth_space(int type, int segments) return (((segments * 2) + 1) << 3); /* FALLTHROUGH */ default: - return (0); /* type not suppported */ + return (0); /* type not supported */ } } Modified: head/sys/i386/i386/initcpu.c ============================================================================== --- head/sys/i386/i386/initcpu.c Wed May 29 02:03:08 2019 (r348348) +++ head/sys/i386/i386/initcpu.c Wed May 29 02:08:23 2019 (r348349) @@ -848,7 +848,7 @@ enable_K6_wt_alloc(void) */ /* * The AMD-K6 processer provides the 64-bit Test Register 12(TR12), - * but only the Cache Inhibit(CI) (bit 3 of TR12) is suppported. + * but only the Cache Inhibit(CI) (bit 3 of TR12) is supported. * All other bits in TR12 have no effect on the processer's operation. * The I/O Trap Restart function (bit 9 of TR12) is always enabled * on the AMD-K6. @@ -898,7 +898,7 @@ enable_K6_2_wt_alloc(void) */ /* * The AMD-K6 processer provides the 64-bit Test Register 12(TR12), - * but only the Cache Inhibit(CI) (bit 3 of TR12) is suppported. + * but only the Cache Inhibit(CI) (bit 3 of TR12) is supported. * All other bits in TR12 have no effect on the processer's operation. * The I/O Trap Restart function (bit 9 of TR12) is always enabled * on the AMD-K6. From owner-svn-src-head@freebsd.org Wed May 29 02:26:16 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 82D1B15B3865; Wed, 29 May 2019 02:26:16 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 258A8752D6; Wed, 29 May 2019 02:26:16 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id F001823342; Wed, 29 May 2019 02:26:15 +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 x4T2QFub056659; Wed, 29 May 2019 02:26:15 GMT (envelope-from jhibbits@FreeBSD.org) Received: (from jhibbits@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4T2QFiG056658; Wed, 29 May 2019 02:26:15 GMT (envelope-from jhibbits@FreeBSD.org) Message-Id: <201905290226.x4T2QFiG056658@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhibbits set sender to jhibbits@FreeBSD.org using -f From: Justin Hibbits Date: Wed, 29 May 2019 02:26:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r348350 - in head: . sys/sys X-SVN-Group: head X-SVN-Commit-Author: jhibbits X-SVN-Commit-Paths: in head: . sys/sys X-SVN-Commit-Revision: 348350 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 258A8752D6 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.95)[-0.952,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 29 May 2019 02:26:16 -0000 Author: jhibbits Date: Wed May 29 02:26:15 2019 New Revision: 348350 URL: https://svnweb.freebsd.org/changeset/base/348350 Log: Update __FreeBSD_version and Makefile check for r348347 libdwarf needs forcibly rebuilt after r348347. Modified: head/Makefile.inc1 head/sys/sys/param.h Modified: head/Makefile.inc1 ============================================================================== --- head/Makefile.inc1 Wed May 29 02:08:23 2019 (r348349) +++ head/Makefile.inc1 Wed May 29 02:26:15 2019 (r348350) @@ -2105,7 +2105,8 @@ _bootstrap_tools_links+=m4 lex # r334881 added libdwarf constants used by ctfconvert. # r338478 fixed a crash in objcopy for mips64el objects # r339083 libelf: correct mips64el test to use ELF header -.if ${BOOTSTRAPPING} < 1200085 +# r348347 Add missing powerpc64 relocation support to libdwarf +.if ${BOOTSTRAPPING} < 1300030 _elftoolchain_libs= lib/libelf lib/libdwarf ${_bt}-lib/libelf: ${_bt_m4_depend} ${_bt}-lib/libdwarf: ${_bt_m4_depend} Modified: head/sys/sys/param.h ============================================================================== --- head/sys/sys/param.h Wed May 29 02:08:23 2019 (r348349) +++ head/sys/sys/param.h Wed May 29 02:26:15 2019 (r348350) @@ -60,7 +60,7 @@ * in the range 5 to 9. */ #undef __FreeBSD_version -#define __FreeBSD_version 1300029 /* Master, propagated to newvers */ +#define __FreeBSD_version 1300030 /* Master, propagated to newvers */ /* * __FreeBSD_kernel__ indicates that this system uses the kernel of FreeBSD, From owner-svn-src-head@freebsd.org Wed May 29 03:12:59 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D8C3615B470E; Wed, 29 May 2019 03:12:59 +0000 (UTC) (envelope-from glebius@freebsd.org) Received: from cell.glebi.us (glebi.us [162.251.186.162]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "cell.glebi.us", Issuer "cell.glebi.us" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 506D0768C2; Wed, 29 May 2019 03:12:58 +0000 (UTC) (envelope-from glebius@freebsd.org) Received: from cell.glebi.us (localhost [127.0.0.1]) by cell.glebi.us (8.15.2/8.15.2) with ESMTPS id x4T3Cuno024182 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NO); Tue, 28 May 2019 20:12:56 -0700 (PDT) (envelope-from glebius@freebsd.org) Received: (from glebius@localhost) by cell.glebi.us (8.15.2/8.15.2/Submit) id x4T3CuaK024181; Tue, 28 May 2019 20:12:56 -0700 (PDT) (envelope-from glebius@freebsd.org) X-Authentication-Warning: cell.glebi.us: glebius set sender to glebius@freebsd.org using -f Date: Tue, 28 May 2019 20:12:56 -0700 From: Gleb Smirnoff To: "Andrey V. Elsukov" Cc: "Andrey V. Elsukov" , kib@freebsd.org, src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r348303 - head/sys/net Message-ID: <20190529031256.GE21836@FreeBSD.org> References: <201905271241.x4RCffTm047128@repo.freebsd.org> <20190529001046.GC21836@FreeBSD.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.11.4 (2019-03-13) X-Rspamd-Queue-Id: 506D0768C2 X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.93 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.93)[-0.930,0]; REPLY(-4.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 29 May 2019 03:13:00 -0000 On Wed, May 29, 2019 at 03:23:23AM +0300, Andrey V. Elsukov wrote: A> > --- a/FreeBSD/sys/net/bpf.c A> > +++ b/FreeBSD/sys/net/bpf.c A> > @@ -857,7 +857,6 @@ bpf_detachd_locked(struct bpf_d *d, bool detached_ifp) A> > /* Save bd_writer value */ A> > error = d->bd_writer; A> > ifp = bp->bif_ifp; A> > - d->bd_bif = NULL; A> > if (detached_ifp) { A> > /* A> > * Notify descriptor as it's detached, so that any A> > A> > Since every bpf_d holds a reference on bpf_if until delayed free happens, A> > the the bpf_if is going to be valid. A> > A> > This allows not to use epoch_wait and run fully async. The patch above is A> > a minimal patch: with NULL assignment removed, several more pieces of code A> > can be removed in bpf.c A> > A> > Of course your patch also is going to work, but what do you think: A> > are there any landmines with fully async approach? A> A> Hi, A> A> bpf_mtap() is not the only consumer of bd_bif, some of them expect it A> becomes NULL when descriptor is detached. May be then make a flag attached/detached? -- Gleb Smirnoff From owner-svn-src-head@freebsd.org Wed May 29 03:14:47 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B65AF15B478F; Wed, 29 May 2019 03:14:47 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 55FB676A49; Wed, 29 May 2019 03:14:47 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 2C3CD23BE1; Wed, 29 May 2019 03:14:47 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x4T3Elvv083147; Wed, 29 May 2019 03:14:47 GMT (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4T3Elkg083146; Wed, 29 May 2019 03:14:47 GMT (envelope-from glebius@FreeBSD.org) Message-Id: <201905290314.x4T3Elkg083146@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: glebius set sender to glebius@FreeBSD.org using -f From: Gleb Smirnoff Date: Wed, 29 May 2019 03:14:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r348351 - head/lib/libmemstat X-SVN-Group: head X-SVN-Commit-Author: glebius X-SVN-Commit-Paths: head/lib/libmemstat X-SVN-Commit-Revision: 348351 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 55FB676A49 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.97)[-0.969,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 29 May 2019 03:14:47 -0000 Author: glebius Date: Wed May 29 03:14:46 2019 New Revision: 348351 URL: https://svnweb.freebsd.org/changeset/base/348351 Log: The KVM code also needs a fix similar to r344269. Reported by: pho Modified: head/lib/libmemstat/memstat_uma.c Modified: head/lib/libmemstat/memstat_uma.c ============================================================================== --- head/lib/libmemstat/memstat_uma.c Wed May 29 02:26:15 2019 (r348350) +++ head/lib/libmemstat/memstat_uma.c Wed May 29 03:14:46 2019 (r348351) @@ -423,6 +423,11 @@ memstat_kvm_uma(struct memory_type_list *list, void *k mtp->mt_failures = kvm_counter_u64_fetch(kvm, (unsigned long )uz.uz_fails); mtp->mt_sleeps = uz.uz_sleeps; + + /* See comment above in memstat_sysctl_uma(). */ + if (mtp->mt_numallocs < mtp->mt_numfrees) + mtp->mt_numallocs = mtp->mt_numfrees; + if (kz.uk_flags & UMA_ZFLAG_INTERNAL) goto skip_percpu; for (i = 0; i < mp_maxid + 1; i++) { From owner-svn-src-head@freebsd.org Wed May 29 07:24:11 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8146C15B9F4D; Wed, 29 May 2019 07:24:11 +0000 (UTC) (envelope-from tsoome@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 22A6E8598A; Wed, 29 May 2019 07:24:11 +0000 (UTC) (envelope-from tsoome@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E013026619; Wed, 29 May 2019 07:24:10 +0000 (UTC) (envelope-from tsoome@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x4T7OAJW013292; Wed, 29 May 2019 07:24:10 GMT (envelope-from tsoome@FreeBSD.org) Received: (from tsoome@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4T7OA9f013291; Wed, 29 May 2019 07:24:10 GMT (envelope-from tsoome@FreeBSD.org) Message-Id: <201905290724.x4T7OA9f013291@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tsoome set sender to tsoome@FreeBSD.org using -f From: Toomas Soome Date: Wed, 29 May 2019 07:24:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r348352 - head/stand/libsa/zfs X-SVN-Group: head X-SVN-Commit-Author: tsoome X-SVN-Commit-Paths: head/stand/libsa/zfs X-SVN-Commit-Revision: 348352 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 22A6E8598A X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.97)[-0.970,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 29 May 2019 07:24:11 -0000 Author: tsoome Date: Wed May 29 07:24:10 2019 New Revision: 348352 URL: https://svnweb.freebsd.org/changeset/base/348352 Log: loader: zfs_alloc and zfs_free should use panic The zfs alloc and free code print out the error and get stuck in infinite loop; use panic() instead. Modified: head/stand/libsa/zfs/zfsimpl.c Modified: head/stand/libsa/zfs/zfsimpl.c ============================================================================== --- head/stand/libsa/zfs/zfsimpl.c Wed May 29 03:14:46 2019 (r348351) +++ head/stand/libsa/zfs/zfsimpl.c Wed May 29 07:24:10 2019 (r348352) @@ -107,8 +107,7 @@ zfs_alloc(size_t size) char *ptr; if (zfs_temp_ptr + size > zfs_temp_end) { - printf("ZFS: out of temporary buffer space\n"); - for (;;) ; + panic("ZFS: out of temporary buffer space"); } ptr = zfs_temp_ptr; zfs_temp_ptr += size; @@ -122,8 +121,7 @@ zfs_free(void *ptr, size_t size) zfs_temp_ptr -= size; if (zfs_temp_ptr != ptr) { - printf("ZFS: zfs_alloc()/zfs_free() mismatch\n"); - for (;;) ; + panic("ZFS: zfs_alloc()/zfs_free() mismatch"); } } From owner-svn-src-head@freebsd.org Wed May 29 07:32:44 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0F64A15BA467; Wed, 29 May 2019 07:32:44 +0000 (UTC) (envelope-from tsoome@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id AACBE86027; Wed, 29 May 2019 07:32:43 +0000 (UTC) (envelope-from tsoome@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 83D20267E1; Wed, 29 May 2019 07:32:43 +0000 (UTC) (envelope-from tsoome@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x4T7Wh1R018650; Wed, 29 May 2019 07:32:43 GMT (envelope-from tsoome@FreeBSD.org) Received: (from tsoome@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4T7WhWe018649; Wed, 29 May 2019 07:32:43 GMT (envelope-from tsoome@FreeBSD.org) Message-Id: <201905290732.x4T7WhWe018649@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tsoome set sender to tsoome@FreeBSD.org using -f From: Toomas Soome Date: Wed, 29 May 2019 07:32:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r348353 - head/stand/efi/boot1 X-SVN-Group: head X-SVN-Commit-Author: tsoome X-SVN-Commit-Paths: head/stand/efi/boot1 X-SVN-Commit-Revision: 348353 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: AACBE86027 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.95)[-0.950,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 29 May 2019 07:32:44 -0000 Author: tsoome Date: Wed May 29 07:32:43 2019 New Revision: 348353 URL: https://svnweb.freebsd.org/changeset/base/348353 Log: boot1.efi should also provide Calloc boot1.efi does provide Malloc and Free, we also need Calloc. Modified: head/stand/efi/boot1/boot1.c Modified: head/stand/efi/boot1/boot1.c ============================================================================== --- head/stand/efi/boot1/boot1.c Wed May 29 07:24:10 2019 (r348352) +++ head/stand/efi/boot1/boot1.c Wed May 29 07:32:43 2019 (r348353) @@ -54,10 +54,11 @@ static EFI_GUID LoadedImageGUID = LOADED_IMAGE_PROTOCO static EFI_GUID ConsoleControlGUID = EFI_CONSOLE_CONTROL_PROTOCOL_GUID; /* - * Provide Malloc / Free backed by EFIs AllocatePool / FreePool which ensures + * Provide Malloc / Free / Calloc backed by EFIs AllocatePool / FreePool which ensures * memory is correctly aligned avoiding EFI_INVALID_PARAMETER returns from * EFI methods. */ + void * Malloc(size_t len, const char *file __unused, int line __unused) { @@ -74,6 +75,19 @@ Free(void *buf, const char *file __unused, int line __ { if (buf != NULL) (void)BS->FreePool(buf); +} + +void * +Calloc(size_t n1, size_t n2, const char *file, int line) +{ + size_t bytes; + void *res; + + bytes = n1 * n2; + if ((res = Malloc(bytes, file, line)) != NULL) + bzero(res, bytes); + + return (res); } /* From owner-svn-src-head@freebsd.org Wed May 29 07:33:52 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 245C015BA50E; Wed, 29 May 2019 07:33:52 +0000 (UTC) (envelope-from tsoome@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id BBE3086269; Wed, 29 May 2019 07:33:51 +0000 (UTC) (envelope-from tsoome@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A541B267E8; Wed, 29 May 2019 07:33:51 +0000 (UTC) (envelope-from tsoome@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x4T7Xpco018872; Wed, 29 May 2019 07:33:51 GMT (envelope-from tsoome@FreeBSD.org) Received: (from tsoome@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4T7Xpdh018871; Wed, 29 May 2019 07:33:51 GMT (envelope-from tsoome@FreeBSD.org) Message-Id: <201905290733.x4T7Xpdh018871@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tsoome set sender to tsoome@FreeBSD.org using -f From: Toomas Soome Date: Wed, 29 May 2019 07:33:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r348354 - head/stand/libsa/zfs X-SVN-Group: head X-SVN-Commit-Author: tsoome X-SVN-Commit-Paths: head/stand/libsa/zfs X-SVN-Commit-Revision: 348354 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: BBE3086269 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.95)[-0.950,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 29 May 2019 07:33:52 -0000 Author: tsoome Date: Wed May 29 07:33:51 2019 New Revision: 348354 URL: https://svnweb.freebsd.org/changeset/base/348354 Log: loader: malloc+memset is calloc in spa_create Replace malloc + memset pair with calloc. Modified: head/stand/libsa/zfs/zfsimpl.c Modified: head/stand/libsa/zfs/zfsimpl.c ============================================================================== --- head/stand/libsa/zfs/zfsimpl.c Wed May 29 07:32:43 2019 (r348353) +++ head/stand/libsa/zfs/zfsimpl.c Wed May 29 07:33:51 2019 (r348354) @@ -750,9 +750,8 @@ spa_create(uint64_t guid, const char *name) { spa_t *spa; - if ((spa = malloc(sizeof(spa_t))) == NULL) + if ((spa = calloc(1, sizeof(spa_t))) == NULL) return (NULL); - memset(spa, 0, sizeof(spa_t)); if ((spa->spa_name = strdup(name)) == NULL) { free(spa); return (NULL); From owner-svn-src-head@freebsd.org Wed May 29 09:08:22 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 196E915BC802; Wed, 29 May 2019 09:08:22 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id B46CF899D7; Wed, 29 May 2019 09:08:21 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 8EA782776C; Wed, 29 May 2019 09:08:21 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x4T98LUc066646; Wed, 29 May 2019 09:08:21 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4T98L89066643; Wed, 29 May 2019 09:08:21 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201905290908.x4T98L89066643@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Wed, 29 May 2019 09:08:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r348355 - head/sys/dev/iicbus X-SVN-Group: head X-SVN-Commit-Author: avg X-SVN-Commit-Paths: head/sys/dev/iicbus X-SVN-Commit-Revision: 348355 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: B46CF899D7 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.97)[-0.969,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 29 May 2019 09:08:22 -0000 Author: avg Date: Wed May 29 09:08:20 2019 New Revision: 348355 URL: https://svnweb.freebsd.org/changeset/base/348355 Log: revert r273728 and parts of r306589, iicbus no-stop by default feature Since drm2 removal, there has not been any consumer of the feature in the tree. I am also unaware of any out-of-tree consumer. More importantly, the feature has been broken from the very start, both before and after r306589, because the ivar was set on a device that does not support it and it was read from another device that also does not support it. A bus-wide no-stop flag cannot be implemented as an ivar as iicbus attaches as a child of various drivers. Implementing the ivar in each and every I2C driver is just impractical. If we ever want to implement this feature properly, then probably the easiest way to do it would be via a flag in the softc of iicbus. In fact, we might have to do that in the stable branches if we want to fix the code for them. Reported by: ian (long time ago) MFC after: 1 month (maybe) X-MFC-note: cannot just merge the change, must keep drm2 happy Modified: head/sys/dev/iicbus/iicbus.c head/sys/dev/iicbus/iicbus.h head/sys/dev/iicbus/iiconf.c Modified: head/sys/dev/iicbus/iicbus.c ============================================================================== --- head/sys/dev/iicbus/iicbus.c Wed May 29 07:33:51 2019 (r348354) +++ head/sys/dev/iicbus/iicbus.c Wed May 29 09:08:20 2019 (r348355) @@ -194,9 +194,6 @@ iicbus_read_ivar(device_t bus, device_t child, int whi case IICBUS_IVAR_ADDR: *result = devi->addr; break; - case IICBUS_IVAR_NOSTOP: - *result = devi->nostop; - break; } return (0); } @@ -213,9 +210,6 @@ iicbus_write_ivar(device_t bus, device_t child, int wh if (devi->addr != 0) return (EINVAL); devi->addr = value; - case IICBUS_IVAR_NOSTOP: - devi->nostop = value; - break; } return (0); } Modified: head/sys/dev/iicbus/iicbus.h ============================================================================== --- head/sys/dev/iicbus/iicbus.h Wed May 29 07:33:51 2019 (r348354) +++ head/sys/dev/iicbus/iicbus.h Wed May 29 09:08:20 2019 (r348355) @@ -54,19 +54,16 @@ struct iicbus_ivar { uint32_t addr; struct resource_list rl; - bool nostop; }; enum { - IICBUS_IVAR_ADDR, /* Address or base address */ - IICBUS_IVAR_NOSTOP, /* nostop defaults */ + IICBUS_IVAR_ADDR /* Address or base address */ }; #define IICBUS_ACCESSOR(A, B, T) \ __BUS_ACCESSOR(iicbus, A, IICBUS, B, T) IICBUS_ACCESSOR(addr, ADDR, uint32_t) -IICBUS_ACCESSOR(nostop, NOSTOP, bool) #define IICBUS_LOCK(sc) mtx_lock(&(sc)->lock) #define IICBUS_UNLOCK(sc) mtx_unlock(&(sc)->lock) Modified: head/sys/dev/iicbus/iiconf.c ============================================================================== --- head/sys/dev/iicbus/iiconf.c Wed May 29 07:33:51 2019 (r348354) +++ head/sys/dev/iicbus/iiconf.c Wed May 29 09:08:20 2019 (r348355) @@ -427,7 +427,7 @@ iicbus_transfer_gen(device_t dev, struct iic_msg *msgs { int i, error, lenread, lenwrote, nkid, rpstart, addr; device_t *children, bus; - bool nostop, started; + bool started; if ((error = device_get_children(dev, &children, &nkid)) != 0) return (IIC_ERESOURCE); @@ -438,7 +438,6 @@ iicbus_transfer_gen(device_t dev, struct iic_msg *msgs bus = children[0]; rpstart = 0; free(children, M_TEMP); - nostop = iicbus_get_nostop(dev); started = false; for (i = 0, error = 0; i < nmsgs && error == 0; i++) { addr = msgs[i].slave; @@ -466,12 +465,11 @@ iicbus_transfer_gen(device_t dev, struct iic_msg *msgs if (error != 0) break; - if ((msgs[i].flags & IIC_M_NOSTOP) != 0 || - (nostop && i + 1 < nmsgs)) { - rpstart = 1; /* Next message gets repeated start */ - } else { + if (!(msgs[i].flags & IIC_M_NOSTOP)) { rpstart = 0; iicbus_stop(bus); + } else { + rpstart = 1; /* Next message gets repeated start */ } } if (error != 0 && started) From owner-svn-src-head@freebsd.org Wed May 29 11:54:17 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 90DF615C06F0; Wed, 29 May 2019 11:54:17 +0000 (UTC) (envelope-from zeising@freebsd.org) Received: from mail.daemonic.se (mail.daemonic.se [IPv6:2607:f740:d:20::25]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2139B8F849; Wed, 29 May 2019 11:54:17 +0000 (UTC) (envelope-from zeising@freebsd.org) Received: from cid.daemonic.se (localhost [IPv6:::1]) by mail.daemonic.se (Postfix) with ESMTP id 45DTdf3x4fz3c7W; Wed, 29 May 2019 11:54:14 +0000 (UTC) X-Virus-Scanned: amavisd-new at daemonic.se Received: from mail.daemonic.se ([127.0.0.1]) (using TLS with cipher ECDHE-RSA-AES128-GCM-SHA256) by cid.daemonic.se (mailscanner.daemonic.se [127.0.0.1]) (amavisd-new, port 10587) with ESMTPS id v8lPjebk7D07; Wed, 29 May 2019 11:54:14 +0000 (UTC) Received: from garnet.daemonic.se (host-95-192-108-109.mobileonline.telia.com [95.192.108.109]) by mail.daemonic.se (Postfix) with ESMTPSA id 45DTdd5mqxz3c7V; Wed, 29 May 2019 11:54:13 +0000 (UTC) Subject: Re: svn commit: r348355 - head/sys/dev/iicbus To: Andriy Gapon , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201905290908.x4T98L89066643@repo.freebsd.org> From: Niclas Zeising Message-ID: Date: Wed, 29 May 2019 13:54:06 +0200 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:60.0) Gecko/20100101 Thunderbird/60.6.1 MIME-Version: 1.0 In-Reply-To: <201905290908.x4T98L89066643@repo.freebsd.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: 2139B8F849 X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.99 / 15.00]; REPLY(-4.00)[]; NEURAL_HAM_SHORT(-0.99)[-0.993,0]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 29 May 2019 11:54:17 -0000 On 2019-05-29 11:08, Andriy Gapon wrote: > Author: avg > Date: Wed May 29 09:08:20 2019 > New Revision: 348355 > URL: https://svnweb.freebsd.org/changeset/base/348355 > > Log: > revert r273728 and parts of r306589, iicbus no-stop by default feature > > Since drm2 removal, there has not been any consumer of the feature in the > tree. I am also unaware of any out-of-tree consumer. > More importantly, the feature has been broken from the very start, both > before and after r306589, because the ivar was set on a device that does > not support it and it was read from another device that also does not > support it. > > A bus-wide no-stop flag cannot be implemented as an ivar as iicbus > attaches as a child of various drivers. Implementing the ivar in each > and every I2C driver is just impractical. > > If we ever want to implement this feature properly, then probably the > easiest way to do it would be via a flag in the softc of iicbus. > In fact, we might have to do that in the stable branches if we want to > fix the code for them. > > Reported by: ian (long time ago) > MFC after: 1 month (maybe) > X-MFC-note: cannot just merge the change, must keep drm2 happy > Hi! Just a note, be aware that drm2 lives on in ports as drm-legacy-kmod. I haven't tested, but, from the description above I worry that it will affect the port. What do you think? Regards -- Niclas From owner-svn-src-head@freebsd.org Wed May 29 12:41:41 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E0AE815C2043; Wed, 29 May 2019 12:41:40 +0000 (UTC) (envelope-from agapon@gmail.com) Received: from mail-lf1-f52.google.com (mail-lf1-f52.google.com [209.85.167.52]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 53B166AA37; Wed, 29 May 2019 12:41:40 +0000 (UTC) (envelope-from agapon@gmail.com) Received: by mail-lf1-f52.google.com with SMTP id u27so1916701lfg.10; Wed, 29 May 2019 05:41:40 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:references:from:openpgp:autocrypt :message-id:date:user-agent:mime-version:in-reply-to :content-language:content-transfer-encoding; bh=zD7GxjDKhFVEy53eKaX7DE5CX8MD6tyejgX63N1eN2E=; b=mrMNFY+pdGp5cLIluzmNg5/7yHIbg92a04EtgNnB12831qvzdeu67p40wQhxr2jieR acNv+PL2G4bHLr/81exsHPSvgYwvjhynQOPbR9bk//gcl60BlFj3ApGDJb0Wxb/lOmfy b8WyiXf+aNZqJneHyK0W8QSLeeKXcErtkPd1i2BqVpSJNRyqipPCUqzd7P0cnryuzolF 4CtM8MwrIEjjvYTSBPcppfaAIQH64kDS4AyJslUe6/lsHXnkpnhz+4MJcLD/ITPhc2hY alDfNBmWap0nJzUwFoRJUM1cNploC7OMv7jz2Ve3AD9SXkMNqDsIKAiHuS0kMSjnugPM /rag== X-Gm-Message-State: APjAAAX601TW+Dqh0mLQHllm7UuUjm1ZkNt0b4M3vAxV/yERhmUhdTzH PwN9SquzvBeFouyp0GECl8dh6xb8/0Q= X-Google-Smtp-Source: APXvYqzliSftBks7KQpRxtNDpdT+BZzp2KbiW9tDTsZo7ob+edkPR6iMi7zdWR5fDVUMwz2NRTtMNA== X-Received: by 2002:a19:f20d:: with SMTP id q13mr16538734lfh.65.1559131972934; Wed, 29 May 2019 05:12:52 -0700 (PDT) Received: from [192.168.0.88] (east.meadow.volia.net. [93.72.151.96]) by smtp.googlemail.com with ESMTPSA id i74sm3444165lfg.78.2019.05.29.05.12.51 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 29 May 2019 05:12:52 -0700 (PDT) Subject: Re: svn commit: r348355 - head/sys/dev/iicbus To: Niclas Zeising , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201905290908.x4T98L89066643@repo.freebsd.org> From: Andriy Gapon Openpgp: preference=signencrypt Autocrypt: addr=avg@FreeBSD.org; prefer-encrypt=mutual; keydata= xsFNBFm4LIgBEADNB/3lT7f15UKeQ52xCFQx/GqHkSxEdVyLFZTmY3KyNPQGBtyvVyBfprJ7 mAeXZWfhat6cKNRAGZcL5EmewdQuUfQfBdYmKjbw3a9GFDsDNuhDA2QwFt8BmkiVMRYyvI7l N0eVzszWCUgdc3qqM6qqcgBaqsVmJluwpvwp4ZBXmch5BgDDDb1MPO8AZ2QZfIQmplkj8Y6Z AiNMknkmgaekIINSJX8IzRzKD5WwMsin70psE8dpL/iBsA2cpJGzWMObVTtCxeDKlBCNqM1i gTXta1ukdUT7JgLEFZk9ceYQQMJJtUwzWu1UHfZn0Fs29HTqawfWPSZVbulbrnu5q55R4PlQ /xURkWQUTyDpqUvb4JK371zhepXiXDwrrpnyyZABm3SFLkk2bHlheeKU6Yql4pcmSVym1AS4 dV8y0oHAfdlSCF6tpOPf2+K9nW1CFA8b/tw4oJBTtfZ1kxXOMdyZU5fiG7xb1qDgpQKgHUX8 7Rd2T1UVLVeuhYlXNw2F+a2ucY+cMoqz3LtpksUiBppJhw099gEXehcN2JbUZ2TueJdt1FdS ztnZmsHUXLxrRBtGwqnFL7GSd6snpGIKuuL305iaOGODbb9c7ne1JqBbkw1wh8ci6vvwGlzx rexzimRaBzJxlkjNfMx8WpCvYebGMydNoeEtkWldtjTNVsUAtQARAQABzR5BbmRyaXkgR2Fw b24gPGF2Z0BGcmVlQlNELm9yZz7CwZQEEwEIAD4WIQS+LEO7ngQnXA4Bjr538m7TUc1yjwUC WbgsiAIbIwUJBaOagAULCQgHAgYVCAkKCwIEFgIDAQIeAQIXgAAKCRB38m7TUc1yj+JAEACV l9AK/nOWAt/9cufV2fRj0hdOqB1aCshtSrwHk/exXsDa4/FkmegxXQGY+3GWX3deIyesbVRL rYdtdK0dqJyT1SBqXK1h3/at9rxr9GQA6KWOxTjUFURsU7ok/6SIlm8uLRPNKO+yq0GDjgaO LzN+xykuBA0FlhQAXJnpZLcVfPJdWv7sSHGedL5ln8P8rxR+XnmsA5TUaaPcbhTB+mG+iKFj GghASDSfGqLWFPBlX/fpXikBDZ1gvOr8nyMY9nXhgfXpq3B6QCRYKPy58ChrZ5weeJZ29b7/ QdEO8NFNWHjSD9meiLdWQaqo9Y7uUxN3wySc/YUZxtS0bhAd8zJdNPsJYG8sXgKjeBQMVGuT eCAJFEYJqbwWvIXMfVWop4+O4xB+z2YE3jAbG/9tB/GSnQdVSj3G8MS80iLS58frnt+RSEw/ psahrfh0dh6SFHttE049xYiC+cM8J27Aaf0i9RflyITq57NuJm+AHJoU9SQUkIF0nc6lfA+o JRiyRlHZHKoRQkIg4aiKaZSWjQYRl5Txl0IZUP1dSWMX4s3XTMurC/pnja45dge/4ESOtJ9R 8XuIWg45Oq6MeIWdjKddGhRj3OohsltKgkEU3eLKYtB6qRTQypHHUawCXz88uYt5e3w4V16H lCpSTZV/EVHnNe45FVBlvK7k7HFfDDkryM7BTQRZuCyIARAAlq0slcsVboY/+IUJdcbEiJRW be9HKVz4SUchq0z9MZPX/0dcnvz/gkyYA+OuM78dNS7Mbby5dTvOqfpLJfCuhaNYOhlE0wY+ 1T6Tf1f4c/uA3U/YiadukQ3+6TJuYGAdRZD5EqYFIkreARTVWg87N9g0fT9BEqLw9lJtEGDY EWUE7L++B8o4uu3LQFEYxcrb4K/WKmgtmFcm77s0IKDrfcX4doV92QTIpLiRxcOmCC/OCYuO jB1oaaqXQzZrCutXRK0L5XN1Y1PYjIrEzHMIXmCDlLYnpFkK+itlXwlE2ZQxkfMruCWdQXye syl2fynAe8hvp7Mms9qU2r2K9EcJiR5N1t1C2/kTKNUhcRv7Yd/vwusK7BqJbhlng5ZgRx0m WxdntU/JLEntz3QBsBsWM9Y9wf2V4tLv6/DuDBta781RsCB/UrU2zNuOEkSixlUiHxw1dccI 6CVlaWkkJBxmHX22GdDFrcjvwMNIbbyfQLuBq6IOh8nvu9vuItup7qemDG3Ms6TVwA7BD3j+ 3fGprtyW8Fd/RR2bW2+LWkMrqHffAr6Y6V3h5kd2G9Q8ZWpEJk+LG6Mk3fhZhmCnHhDu6CwN MeUvxXDVO+fqc3JjFm5OxhmfVeJKrbCEUJyM8ESWLoNHLqjywdZga4Q7P12g8DUQ1mRxYg/L HgZY3zfKOqcAEQEAAcLBfAQYAQgAJhYhBL4sQ7ueBCdcDgGOvnfybtNRzXKPBQJZuCyIAhsM BQkFo5qAAAoJEHfybtNRzXKPBVwQAKfFy9P7N3OsLDMB56A4Kf+ZT+d5cIx0Yiaf4n6w7m3i ImHHHk9FIetI4Xe54a2IXh4Bq5UkAGY0667eIs+Z1Ea6I2i27Sdo7DxGwq09Qnm/Y65ADvXs 3aBvokCcm7FsM1wky395m8xUos1681oV5oxgqeRI8/76qy0hD9WR65UW+HQgZRIcIjSel9vR XDaD2HLGPTTGr7u4v00UeTMs6qvPsa2PJagogrKY8RXdFtXvweQFz78NbXhluwix2Tb9ETPk LIpDrtzV73CaE2aqBG/KrboXT2C67BgFtnk7T7Y7iKq4/XvEdDWscz2wws91BOXuMMd4c/c4 OmGW9m3RBLufFrOag1q5yUS9QbFfyqL6dftJP3Zq/xe+mr7sbWbhPVCQFrH3r26mpmy841ym dwQnNcsbIGiBASBSKksOvIDYKa2Wy8htPmWFTEOPRpFXdGQ27awcjjnB42nngyCK5ukZDHi6 w0qK5DNQQCkiweevCIC6wc3p67jl1EMFY5+z+zdTPb3h7LeVnGqW0qBQl99vVFgzLxchKcl0 R/paSFgwqXCZhAKMuUHncJuynDOP7z5LirUeFI8qsBAJi1rXpQoLJTVcW72swZ42IdPiboqx NbTMiNOiE36GqMcTPfKylCbF45JNX4nF9ElM0E+Y8gi4cizJYBRr2FBJgay0b9Cp Message-ID: Date: Wed, 29 May 2019 15:12:51 +0300 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:52.0) Gecko/20100101 Thunderbird/52.7.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 53B166AA37 X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.97 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.97)[-0.966,0]; REPLY(-4.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 29 May 2019 12:41:41 -0000 On 29/05/2019 14:54, Niclas Zeising wrote: > On 2019-05-29 11:08, Andriy Gapon wrote: >> Author: avg >> Date: Wed May 29 09:08:20 2019 >> New Revision: 348355 >> URL: https://svnweb.freebsd.org/changeset/base/348355 >> >> Log: >>    revert r273728 and parts of r306589, iicbus no-stop by default feature >>       Since drm2 removal, there has not been any consumer of the feature in the >>    tree.  I am also unaware of any out-of-tree consumer. >>    More importantly, the feature has been broken from the very start, both >>    before and after r306589, because the ivar was set on a device that does >>    not support it and it was read from another device that also does not >>    support it. >>       A bus-wide no-stop flag cannot be implemented as an ivar as iicbus >>    attaches as a child of various drivers.  Implementing the ivar in each >>    and every I2C driver is just impractical. >>       If we ever want to implement this feature properly, then probably the >>    easiest way to do it would be via a flag in the softc of iicbus. >>    In fact, we might have to do that in the stable branches if we want to >>    fix the code for them. >>       Reported by:    ian (long time ago) >>    MFC after:    1 month (maybe) >>    X-MFC-note:    cannot just merge the change, must keep drm2 happy >> > > Hi! > Just a note, be aware that drm2 lives on in ports as drm-legacy-kmod.  I haven't > tested, but, from the description above I worry that it will affect the port.  > What do you think? Oh, I forgot about that one... I think that it could be affected if it still uses FreeBSD iic code. I guess I might have to revert the change. -- Andriy Gapon From owner-svn-src-head@freebsd.org Wed May 29 13:51:20 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0A50315C34A5; Wed, 29 May 2019 13:51:20 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id A03506D024; Wed, 29 May 2019 13:51:19 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 79F0D28C0; Wed, 29 May 2019 13:51:19 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x4TDpJPD015623; Wed, 29 May 2019 13:51:19 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4TDpJI8015622; Wed, 29 May 2019 13:51:19 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201905291351.x4TDpJI8015622@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Wed, 29 May 2019 13:51:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r348359 - head/usr.bin/posixshmcontrol X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: head/usr.bin/posixshmcontrol X-SVN-Commit-Revision: 348359 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: A03506D024 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.96)[-0.962,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 29 May 2019 13:51:20 -0000 Author: kib Date: Wed May 29 13:51:18 2019 New Revision: 348359 URL: https://svnweb.freebsd.org/changeset/base/348359 Log: Add posixshmcontrol(1) page. Reviewed by: emaste With input by: danfe Sponsored by: The FreeBSD Foundation (kib) MFC after: 1 week Differential revision: https://reviews.freebsd.org/D20430 Added: head/usr.bin/posixshmcontrol/posixshmcontrol.1 (contents, props changed) Modified: head/usr.bin/posixshmcontrol/Makefile Modified: head/usr.bin/posixshmcontrol/Makefile ============================================================================== --- head/usr.bin/posixshmcontrol/Makefile Wed May 29 13:47:10 2019 (r348358) +++ head/usr.bin/posixshmcontrol/Makefile Wed May 29 13:51:18 2019 (r348359) @@ -3,6 +3,5 @@ PROG= posixshmcontrol LIBADD= util WARNS?= 6 -MAN= .include Added: head/usr.bin/posixshmcontrol/posixshmcontrol.1 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.bin/posixshmcontrol/posixshmcontrol.1 Wed May 29 13:51:18 2019 (r348359) @@ -0,0 +1,153 @@ +.\" Copyright (c) 2019 The FreeBSD Foundation, Inc. +.\" All rights reserved. +.\" +.\" This documentation was written by +.\" Konstantin Belousov under sponsorship +.\" from the FreeBSD Foundation. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE AUTHORS 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 AUTHORS OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.\" $FreeBSD$ +.\" +.Dd May 27, 2019 +.Dt POSIXSHMCONTROL 1 +.Os +.Sh NAME +.Nm posixshmcontrol +.Nd Control POSIX shared memory segments +.Sh SYNOPSIS +.Nm +.Ar create +.Op Fl m Ar mode +.Op Pa path \&... +.Nm +.Ar rm +.Op Pa path \&... +.Nm +.Ar ls +.Op Fl h +.Op Fl n +.Nm +.Ar dump +.Op Pa path \&... +.Nm +.Ar stat +.Op Fl h +.Op Fl n +.Op Pa path \&... +.Nm +.Ar truncate +.Op Fl s Ar length +.Op Pa path \&... +.Sh DESCRIPTION +The +.Nm +command manipulates the named POSIX shared memory segments. +It allows inspecting existing segments, dumping their metadata or contents, +and unlinking them. +.Pp +Unlinking removes the name from the system and, when the last process +unmaps the segment and closes file descriptor pointing to the segment, +frees underlying memory. +.Pp +The number of hard links as displayed by the +.Ic stat +subcommand, is equal to the number of references to the underlying VM +object. +It is almost always equal to the number of mappings +1, except +for transient references. +.Pp +The following subcommands are provided: +.Bl -tag -width truncate +.It Ic create +Create segments with the specified paths, if not exist. +The +.Ar mode +optional numerical argument specifies initial access mode. +.It Ic rm +Unlink the paths specified. +.It Ic ls +List all linked named shared memory segments visible to the caller. +For each segment, the user and group owner, size, and path are displayed. +.It Ic dump +Output raw bytes values from the segment to standard output. +.It Ic stat +Print metadata for the specified path, in the format similar to the +.Xr stat 1 +utility. +.It Ic truncate +Change the length of the segments. +Argument to the +.Fl s +option specifies new length, the human-friendly 'k', 'm', 'g' suffixes +can be used, see +.Xr expand_number 3. +If the option is not specified, assumed length is zero. +.El +.Pp +For some commands, the following options may be provided: +.Bl -tag XX +.It Fl h +If specified, requests human-readable display of size, see +.Xr humanize_number 3 . +.It Fl n +Prevent translation of owner and group into symbolic names +using name-switch services, instead the raw numeric values are printed. +.El +.Sh EXIT STATUS +.Ex -std +.Sh EXAMPLES +.Bl -bullet +.It +To show content of the shared memory segment with the path +.Pa /1 , +use the command +.Dl "posixshmcontrol dump /q | hexdump -C" +.It +To create a segment with the path +.Pa /2 +and then enlarge it to 1M, use the sequence of commands +.Dl "posixshmcontrol create /2" +.Dl "posixshmcontrol truncate -s 1m /2" +.El +.Sh SEE ALSO +.Xr hexdump 1 , +.Xr stat 1 , +.Xr ftruncate 2 , +.Xr read 2 , +.Xr shm_open 2 , +.Xr shm_unlink 2 , +.Xr stat 2 , +.Xr expand_number 3 , +.Xr humanize_number 3 , +.Xr sysctl 3 +.Sh HISTORY +The +.Nm +command appeared in +.Fx 13.0 . +.Sh AUTHORS +The +.Nm +command and this manual page were written by +.An Konstantin Belousov Aq Mt kib@freebsd.org +under sponsorship from The FreeBSD Foundation. From owner-svn-src-head@freebsd.org Wed May 29 14:03:54 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 499B115C38F4; Wed, 29 May 2019 14:03:54 +0000 (UTC) (envelope-from freebsd@gndrsh.dnsmgr.net) Received: from gndrsh.dnsmgr.net (br1.CN84in.dnsmgr.net [69.59.192.140]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8B8E76D88B; Wed, 29 May 2019 14:03:53 +0000 (UTC) (envelope-from freebsd@gndrsh.dnsmgr.net) Received: from gndrsh.dnsmgr.net (localhost [127.0.0.1]) by gndrsh.dnsmgr.net (8.13.3/8.13.3) with ESMTP id x4TE3o94021106; Wed, 29 May 2019 07:03:50 -0700 (PDT) (envelope-from freebsd@gndrsh.dnsmgr.net) Received: (from freebsd@localhost) by gndrsh.dnsmgr.net (8.13.3/8.13.3/Submit) id x4TE3opc021105; Wed, 29 May 2019 07:03:50 -0700 (PDT) (envelope-from freebsd) From: "Rodney W. Grimes" Message-Id: <201905291403.x4TE3opc021105@gndrsh.dnsmgr.net> Subject: Re: svn commit: r348359 - head/usr.bin/posixshmcontrol In-Reply-To: <201905291351.x4TDpJI8015622@repo.freebsd.org> To: Konstantin Belousov Date: Wed, 29 May 2019 07:03:50 -0700 (PDT) CC: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Reply-To: rgrimes@freebsd.org X-Mailer: ELM [version 2.4ME+ PL121h (25)] MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII X-Rspamd-Queue-Id: 8B8E76D88B X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.97 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; REPLY(-4.00)[]; NEURAL_HAM_SHORT(-0.97)[-0.967,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 29 May 2019 14:03:54 -0000 > Author: kib > Date: Wed May 29 13:51:18 2019 > New Revision: 348359 > URL: https://svnweb.freebsd.org/changeset/base/348359 > > Log: > Add posixshmcontrol(1) page. > > Reviewed by: emaste > With input by: danfe > Sponsored by: The FreeBSD Foundation (kib) > MFC after: 1 week > Differential revision: https://reviews.freebsd.org/D20430 > > Added: > head/usr.bin/posixshmcontrol/posixshmcontrol.1 (contents, props changed) > Modified: > head/usr.bin/posixshmcontrol/Makefile > > Modified: head/usr.bin/posixshmcontrol/Makefile > ============================================================================== > --- head/usr.bin/posixshmcontrol/Makefile Wed May 29 13:47:10 2019 (r348358) > +++ head/usr.bin/posixshmcontrol/Makefile Wed May 29 13:51:18 2019 (r348359) > @@ -3,6 +3,5 @@ > PROG= posixshmcontrol > LIBADD= util > WARNS?= 6 > -MAN= > > .include > > Added: head/usr.bin/posixshmcontrol/posixshmcontrol.1 > ============================================================================== > --- /dev/null 00:00:00 1970 (empty, because file is newly added) > +++ head/usr.bin/posixshmcontrol/posixshmcontrol.1 Wed May 29 13:51:18 2019 (r348359) > @@ -0,0 +1,153 @@ > +.\" Copyright (c) 2019 The FreeBSD Foundation, Inc. > +.\" All rights reserved. I thought the "All rights reserved." had been removed from all FreeBSD Foundation templates per email from emaste And thank you for the man page and the utility. Regards, Rod > +.\" > +.\" This documentation was written by > +.\" Konstantin Belousov under sponsorship > +.\" from the FreeBSD Foundation. > +.\" > +.\" Redistribution and use in source and binary forms, with or without > +.\" modification, are permitted provided that the following conditions > +.\" are met: > +.\" 1. Redistributions of source code must retain the above copyright > +.\" notice, this list of conditions and the following disclaimer. > +.\" 2. Redistributions in binary form must reproduce the above copyright > +.\" notice, this list of conditions and the following disclaimer in the > +.\" documentation and/or other materials provided with the distribution. > +.\" > +.\" THIS SOFTWARE IS PROVIDED BY THE AUTHORS 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 AUTHORS OR CONTRIBUTORS BE LIABLE > +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL > +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS > +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) > +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT > +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY > +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF > +.\" SUCH DAMAGE. > +.\" > +.\" $FreeBSD$ > +.\" > +.Dd May 27, 2019 > +.Dt POSIXSHMCONTROL 1 > +.Os > +.Sh NAME > +.Nm posixshmcontrol > +.Nd Control POSIX shared memory segments > +.Sh SYNOPSIS > +.Nm > +.Ar create > +.Op Fl m Ar mode > +.Op Pa path \&... > +.Nm > +.Ar rm > +.Op Pa path \&... > +.Nm > +.Ar ls > +.Op Fl h > +.Op Fl n > +.Nm > +.Ar dump > +.Op Pa path \&... > +.Nm > +.Ar stat > +.Op Fl h > +.Op Fl n > +.Op Pa path \&... > +.Nm > +.Ar truncate > +.Op Fl s Ar length > +.Op Pa path \&... > +.Sh DESCRIPTION > +The > +.Nm > +command manipulates the named POSIX shared memory segments. > +It allows inspecting existing segments, dumping their metadata or contents, > +and unlinking them. > +.Pp > +Unlinking removes the name from the system and, when the last process > +unmaps the segment and closes file descriptor pointing to the segment, > +frees underlying memory. > +.Pp > +The number of hard links as displayed by the > +.Ic stat > +subcommand, is equal to the number of references to the underlying VM > +object. > +It is almost always equal to the number of mappings +1, except > +for transient references. > +.Pp > +The following subcommands are provided: > +.Bl -tag -width truncate > +.It Ic create > +Create segments with the specified paths, if not exist. > +The > +.Ar mode > +optional numerical argument specifies initial access mode. > +.It Ic rm > +Unlink the paths specified. > +.It Ic ls > +List all linked named shared memory segments visible to the caller. > +For each segment, the user and group owner, size, and path are displayed. > +.It Ic dump > +Output raw bytes values from the segment to standard output. > +.It Ic stat > +Print metadata for the specified path, in the format similar to the > +.Xr stat 1 > +utility. > +.It Ic truncate > +Change the length of the segments. > +Argument to the > +.Fl s > +option specifies new length, the human-friendly 'k', 'm', 'g' suffixes > +can be used, see > +.Xr expand_number 3. > +If the option is not specified, assumed length is zero. > +.El > +.Pp > +For some commands, the following options may be provided: > +.Bl -tag XX > +.It Fl h > +If specified, requests human-readable display of size, see > +.Xr humanize_number 3 . > +.It Fl n > +Prevent translation of owner and group into symbolic names > +using name-switch services, instead the raw numeric values are printed. > +.El > +.Sh EXIT STATUS > +.Ex -std > +.Sh EXAMPLES > +.Bl -bullet > +.It > +To show content of the shared memory segment with the path > +.Pa /1 , > +use the command > +.Dl "posixshmcontrol dump /q | hexdump -C" > +.It > +To create a segment with the path > +.Pa /2 > +and then enlarge it to 1M, use the sequence of commands > +.Dl "posixshmcontrol create /2" > +.Dl "posixshmcontrol truncate -s 1m /2" > +.El > +.Sh SEE ALSO > +.Xr hexdump 1 , > +.Xr stat 1 , > +.Xr ftruncate 2 , > +.Xr read 2 , > +.Xr shm_open 2 , > +.Xr shm_unlink 2 , > +.Xr stat 2 , > +.Xr expand_number 3 , > +.Xr humanize_number 3 , > +.Xr sysctl 3 > +.Sh HISTORY > +The > +.Nm > +command appeared in > +.Fx 13.0 . > +.Sh AUTHORS > +The > +.Nm > +command and this manual page were written by > +.An Konstantin Belousov Aq Mt kib@freebsd.org > +under sponsorship from The FreeBSD Foundation. > > -- Rod Grimes rgrimes@freebsd.org From owner-svn-src-head@freebsd.org Wed May 29 14:05:29 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C4EC215C39BE; Wed, 29 May 2019 14:05:28 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 68DD66DA02; Wed, 29 May 2019 14:05:28 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 440042AED; Wed, 29 May 2019 14:05:28 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x4TE5S6j023378; Wed, 29 May 2019 14:05:28 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4TE5RSD023376; Wed, 29 May 2019 14:05:27 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201905291405.x4TE5RSD023376@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Wed, 29 May 2019 14:05:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r348360 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 348360 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 68DD66DA02 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.96)[-0.961,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 29 May 2019 14:05:29 -0000 Author: kib Date: Wed May 29 14:05:27 2019 New Revision: 348360 URL: https://svnweb.freebsd.org/changeset/base/348360 Log: Do not go into sleep in sleepq_catch_signals() when SIGSTOP from PT_ATTACH was consumed. In particular, do not clear TDP_FSTP in ptracestop() if td_wchan is non-NULL. Leave it to sleepq_catch_signal() to clear and convert zero return code to EINTR. Otherwise, per submitter report, if the PT_ATTACH SIGSTOP was delivered right after the thread was added to the sleepqueue but not yet really sleep, and cursig() caused debugger attach, the thread sleeps instead of returning to the userspace boundary with EINTR. PR: 231445 Reported by: Efi Weiss Reviewed by: markj Sponsored by: The FreeBSD Foundation MFC after: 2 weeks Differential revision: https://reviews.freebsd.org/D20381 Modified: head/sys/kern/kern_sig.c head/sys/kern/subr_sleepqueue.c Modified: head/sys/kern/kern_sig.c ============================================================================== --- head/sys/kern/kern_sig.c Wed May 29 13:51:18 2019 (r348359) +++ head/sys/kern/kern_sig.c Wed May 29 14:05:27 2019 (r348360) @@ -2576,7 +2576,15 @@ ptracestop(struct thread *td, int sig, ksiginfo_t *si) p->p_xthread == NULL)) { p->p_xsig = sig; p->p_xthread = td; - td->td_dbgflags &= ~TDB_FSTP; + + /* + * If we are on sleepqueue already, + * let sleepqueue code decide if it + * needs to go sleep after attach. + */ + if (td->td_wchan == NULL) + td->td_dbgflags &= ~TDB_FSTP; + p->p_flag2 &= ~P2_PTRACE_FSTP; p->p_flag |= P_STOPPED_SIG | P_STOPPED_TRACE; sig_suspend_threads(td, p, 0); Modified: head/sys/kern/subr_sleepqueue.c ============================================================================== --- head/sys/kern/subr_sleepqueue.c Wed May 29 13:51:18 2019 (r348359) +++ head/sys/kern/subr_sleepqueue.c Wed May 29 14:05:27 2019 (r348360) @@ -498,6 +498,19 @@ sleepq_catch_signals(void *wchan, int pri) } else { mtx_unlock(&ps->ps_mtx); } + + /* + * Do not go into sleep if this thread was the + * ptrace(2) attach leader. cursig() consumed + * SIGSTOP from PT_ATTACH, but we usually act + * on the signal by interrupting sleep, and + * should do that here as well. + */ + if ((td->td_dbgflags & TDB_FSTP) != 0) { + if (ret == 0) + ret = EINTR; + td->td_dbgflags &= ~TDB_FSTP; + } } /* * Lock the per-process spinlock prior to dropping the PROC_LOCK From owner-svn-src-head@freebsd.org Wed May 29 14:26:36 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7557515C4382; Wed, 29 May 2019 14:26:36 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 1CB6F6EAAD; Wed, 29 May 2019 14:26: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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E573F2E45; Wed, 29 May 2019 14:26:35 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x4TEQZp9034396; Wed, 29 May 2019 14:26:35 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4TEQZMI034395; Wed, 29 May 2019 14:26:35 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201905291426.x4TEQZMI034395@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Wed, 29 May 2019 14:26:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r348361 - head/usr.bin/posixshmcontrol X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: head/usr.bin/posixshmcontrol X-SVN-Commit-Revision: 348361 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 1CB6F6EAAD X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.96)[-0.961,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 29 May 2019 14:26:36 -0000 Author: kib Date: Wed May 29 14:26:35 2019 New Revision: 348361 URL: https://svnweb.freebsd.org/changeset/base/348361 Log: Remove "All rights reserved." from FF copyright. Requested by: rgrimes Sponsored by: The FreeBSD Foundation MFC after: 1 week Modified: head/usr.bin/posixshmcontrol/posixshmcontrol.1 Modified: head/usr.bin/posixshmcontrol/posixshmcontrol.1 ============================================================================== --- head/usr.bin/posixshmcontrol/posixshmcontrol.1 Wed May 29 14:05:27 2019 (r348360) +++ head/usr.bin/posixshmcontrol/posixshmcontrol.1 Wed May 29 14:26:35 2019 (r348361) @@ -1,5 +1,4 @@ .\" Copyright (c) 2019 The FreeBSD Foundation, Inc. -.\" All rights reserved. .\" .\" This documentation was written by .\" Konstantin Belousov under sponsorship From owner-svn-src-head@freebsd.org Wed May 29 15:53:34 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 31CF015A5BAC; Wed, 29 May 2019 15:53:34 +0000 (UTC) (envelope-from br@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id CAEA3726F0; Wed, 29 May 2019 15:53:33 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A10974032; Wed, 29 May 2019 15:53:33 +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 x4TFrXfA082129; Wed, 29 May 2019 15:53:33 GMT (envelope-from br@FreeBSD.org) Received: (from br@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4TFrXSp082128; Wed, 29 May 2019 15:53:33 GMT (envelope-from br@FreeBSD.org) Message-Id: <201905291553.x4TFrXSp082128@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: br set sender to br@FreeBSD.org using -f From: Ruslan Bukin Date: Wed, 29 May 2019 15:53:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r348363 - head/sys/dev/pci X-SVN-Group: head X-SVN-Commit-Author: br X-SVN-Commit-Paths: head/sys/dev/pci X-SVN-Commit-Revision: 348363 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: CAEA3726F0 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.97)[-0.973,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 29 May 2019 15:53:34 -0000 Author: br Date: Wed May 29 15:53:33 2019 New Revision: 348363 URL: https://svnweb.freebsd.org/changeset/base/348363 Log: Pass pci_base address instead of physical address to rman_manage_region(). This should had been part of r347930 ("pci: ecam: Correctly parse memory and IO region"). Sponsored by: DARPA, AFRL Modified: head/sys/dev/pci/pci_host_generic_fdt.c Modified: head/sys/dev/pci/pci_host_generic_fdt.c ============================================================================== --- head/sys/dev/pci/pci_host_generic_fdt.c Wed May 29 14:28:13 2019 (r348362) +++ head/sys/dev/pci/pci_host_generic_fdt.c Wed May 29 15:53:33 2019 (r348363) @@ -167,11 +167,11 @@ pci_host_generic_attach(device_t dev) continue; /* empty range element */ if (sc->base.ranges[tuple].flags & FLAG_MEM) { error = rman_manage_region(&sc->base.mem_rman, - phys_base, phys_base + size - 1); + pci_base, pci_base + size - 1); } else if (sc->base.ranges[tuple].flags & FLAG_IO) { error = rman_manage_region(&sc->base.io_rman, - pci_base + PCI_IO_WINDOW_OFFSET, - pci_base + PCI_IO_WINDOW_OFFSET + size - 1); + pci_base + PCI_IO_WINDOW_OFFSET, + pci_base + PCI_IO_WINDOW_OFFSET + size - 1); } else continue; if (error) { From owner-svn-src-head@freebsd.org Wed May 29 16:01:35 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 49CED15A5F5C; Wed, 29 May 2019 16:01:35 +0000 (UTC) (envelope-from br@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id E264672C58; Wed, 29 May 2019 16:01:34 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id BF0414089; Wed, 29 May 2019 16:01:34 +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 x4TG1Y20084084; Wed, 29 May 2019 16:01:34 GMT (envelope-from br@FreeBSD.org) Received: (from br@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4TG1YDx084083; Wed, 29 May 2019 16:01:34 GMT (envelope-from br@FreeBSD.org) Message-Id: <201905291601.x4TG1YDx084083@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: br set sender to br@FreeBSD.org using -f From: Ruslan Bukin Date: Wed, 29 May 2019 16:01:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r348364 - head/sys/dev/xdma X-SVN-Group: head X-SVN-Commit-Author: br X-SVN-Commit-Paths: head/sys/dev/xdma X-SVN-Commit-Revision: 348364 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: E264672C58 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.97)[-0.973,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 29 May 2019 16:01:35 -0000 Author: br Date: Wed May 29 16:01:34 2019 New Revision: 348364 URL: https://svnweb.freebsd.org/changeset/base/348364 Log: Don't copy the data from bounce buffer back to the mbuf if channel does not use bounce buffering. Sponsored by: DARPA, AFRL Modified: head/sys/dev/xdma/xdma_sg.c Modified: head/sys/dev/xdma/xdma_sg.c ============================================================================== --- head/sys/dev/xdma/xdma_sg.c Wed May 29 15:53:33 2019 (r348363) +++ head/sys/dev/xdma/xdma_sg.c Wed May 29 16:01:34 2019 (r348364) @@ -348,7 +348,8 @@ xchan_seg_done(xdma_channel_t *xchan, BUS_DMASYNC_POSTREAD); bus_dmamap_unload(xchan->dma_tag_bufs, b->map); } else { - if (xr->req_type == XR_TYPE_MBUF && + if ((xchan->caps & XCHAN_CAP_NOBUFS) == 0 && + xr->req_type == XR_TYPE_MBUF && xr->direction == XDMA_DEV_TO_MEM) m_copyback(xr->m, 0, st->transferred, (void *)xr->buf.vaddr); From owner-svn-src-head@freebsd.org Wed May 29 16:07:02 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A897B15A629F; Wed, 29 May 2019 16:07:02 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from smtp.freebsd.org (smtp.freebsd.org [IPv6:2610:1c1:1:606c::24b:4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4624F732DB; Wed, 29 May 2019 16:07:02 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from John-Baldwins-MacBook-Pro-4.local (ralph.baldwin.cx [66.234.199.215]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) (Authenticated sender: jhb) by smtp.freebsd.org (Postfix) with ESMTPSA id AE4A11EAA4; Wed, 29 May 2019 16:06:56 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Subject: Re: svn commit: r348338 - head/sys/fs/pseudofs To: Johannes Lundberg , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201905282054.x4SKsxZ2083779@repo.freebsd.org> From: John Baldwin Openpgp: preference=signencrypt Autocrypt: addr=jhb@FreeBSD.org; keydata= mQGiBETQ+XcRBADMFybiq69u+fJRy/0wzqTNS8jFfWaBTs5/OfcV7wWezVmf9sgwn8TW0Dk0 c9MBl0pz+H01dA2ZSGZ5fXlmFIsee1WEzqeJzpiwd/pejPgSzXB9ijbLHZ2/E0jhGBcVy5Yo /Tw5+U/+laeYKu2xb0XPvM0zMNls1ah5OnP9a6Ql6wCgupaoMySb7DXm2LHD1Z9jTsHcAQMD /1jzh2BoHriy/Q2s4KzzjVp/mQO5DSm2z14BvbQRcXU48oAosHA1u3Wrov6LfPY+0U1tG47X 1BGfnQH+rNAaH0livoSBQ0IPI/8WfIW7ub4qV6HYwWKVqkDkqwcpmGNDbz3gfaDht6nsie5Z pcuCcul4M9CW7Md6zzyvktjnbz61BADGDCopfZC4of0Z3Ka0u8Wik6UJOuqShBt1WcFS8ya1 oB4rc4tXfSHyMF63aPUBMxHR5DXeH+EO2edoSwViDMqWk1jTnYza51rbGY+pebLQOVOxAY7k do5Ordl3wklBPMVEPWoZ61SdbcjhHVwaC5zfiskcxj5wwXd2E9qYlBqRg7QeSm9obiBCYWxk d2luIDxqaGJARnJlZUJTRC5vcmc+iGAEExECACAFAkTQ+awCGwMGCwkIBwMCBBUCCAMEFgID AQIeAQIXgAAKCRBy3lIGd+N/BI6RAJ9S97fvbME+3hxzE3JUyUZ6vTewDACdE1stFuSfqMvM jomvZdYxIYyTUpC5Ag0ERND5ghAIAPwsO0B7BL+bz8sLlLoQktGxXwXQfS5cInvL17Dsgnr3 1AKa94j9EnXQyPEj7u0d+LmEe6CGEGDh1OcGFTMVrof2ZzkSy4+FkZwMKJpTiqeaShMh+Goj XlwIMDxyADYvBIg3eN5YdFKaPQpfgSqhT+7El7w+wSZZD8pPQuLAnie5iz9C8iKy4/cMSOrH YUK/tO+Nhw8Jjlw94Ik0T80iEhI2t+XBVjwdfjbq3HrJ0ehqdBwukyeJRYKmbn298KOFQVHO EVbHA4rF/37jzaMadK43FgJ0SAhPPF5l4l89z5oPu0b/+5e2inA3b8J3iGZxywjM+Csq1tqz hltEc7Q+E08AAwUIAL+15XH8bPbjNJdVyg2CMl10JNW2wWg2Q6qdljeaRqeR6zFus7EZTwtX sNzs5bP8y51PSUDJbeiy2RNCNKWFMndM22TZnk3GNG45nQd4OwYK0RZVrikalmJY5Q6m7Z16 4yrZgIXFdKj2t8F+x613/SJW1lIr9/bDp4U9tw0V1g3l2dFtD3p3ZrQ3hpoDtoK70ioIAjjH aIXIAcm3FGZFXy503DOA0KaTWwvOVdYCFLm3zWuSOmrX/GsEc7ovasOWwjPn878qVjbUKWwx Q4QkF4OhUV9zPtf9tDSAZ3x7QSwoKbCoRCZ/xbyTUPyQ1VvNy/mYrBcYlzHodsaqUDjHuW+I SQQYEQIACQUCRND5ggIbDAAKCRBy3lIGd+N/BCO8AJ9j1dWVQWxw/YdTbEyrRKOY8YZNwwCf afMAg8QvmOWnHx3wl8WslCaXaE8= Message-ID: <746b1976-2627-ad0d-e4b2-4607d944f87d@FreeBSD.org> Date: Wed, 29 May 2019 09:06:54 -0700 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.12; rv:60.0) Gecko/20100101 Thunderbird/60.6.1 MIME-Version: 1.0 In-Reply-To: <201905282054.x4SKsxZ2083779@repo.freebsd.org> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 4624F732DB X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.96 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.96)[-0.956,0]; REPLY(-4.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 29 May 2019 16:07:03 -0000 On 5/28/19 1:54 PM, Johannes Lundberg wrote: > Author: johalun > Date: Tue May 28 20:54:59 2019 > New Revision: 348338 > URL: https://svnweb.freebsd.org/changeset/base/348338 > > Log: > pseudofs: Ignore unsupported commands in vop_setattr. > > Users of pseudofs (e.g. lindebugfs), should be able to receive > input from command line via commands like "echo 1 > /path/to/file". > Currently this fails because sh tries to truncate the file first and > vop_setattr returns not supported error for this. This patch simply > ignores the error and returns 0 instead. > > Reviewed by: imp (mentor), asomers > Approved by: imp (mentor), asomers > MFC after: 1 week > Differential Revision: D20451 FYI, this is supposed to be the URL which makes it easier to click in many e-mail clients. It seems a recent change in phab that it honors just the 'Dxxxx' tag as previously the URL was required for auto-close. (I sure wish the phab team would communicate when they change things like this.) > Modified: > head/sys/fs/pseudofs/pseudofs_vnops.c > > Modified: head/sys/fs/pseudofs/pseudofs_vnops.c > ============================================================================== > --- head/sys/fs/pseudofs/pseudofs_vnops.c Tue May 28 20:44:23 2019 (r348337) > +++ head/sys/fs/pseudofs/pseudofs_vnops.c Tue May 28 20:54:59 2019 (r348338) > @@ -967,7 +967,8 @@ pfs_setattr(struct vop_setattr_args *va) > PFS_TRACE(("%s", pn->pn_name)); > pfs_assert_not_owned(pn); > > - PFS_RETURN (EOPNOTSUPP); > + /* Silently ignore unchangeable attributes. */ > + PFS_RETURN (0); Did you consider only whitelisting setattr calls that set the size? This allows things like chown/chmod that won't actually work which might be confusing to users. You can see examples of how to do this in, e.g. ufs_setattr. The interface for VOP_SETATTR is that the various fields in vattr are set to VNOVAL by via VATTR_NULL and then the caller sets the fields they want to change. You can then reject attempts to set attributes you don't support. (e.g. see how ufs_setattr fails with EINVAL if fields it doesn't support aren't set to VNOVAL). You should also likely validate the passed in size and only permit a size of 0 for [f]truncate(). -- John Baldwin From owner-svn-src-head@freebsd.org Wed May 29 17:58:20 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BF4B415A8D4F; Wed, 29 May 2019 17:58:20 +0000 (UTC) (envelope-from bu7cher@yandex.ru) Received: from forward100p.mail.yandex.net (forward100p.mail.yandex.net [IPv6:2a02:6b8:0:1472:2741:0:8b7:100]) (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 301F3774CE; Wed, 29 May 2019 17:58:20 +0000 (UTC) (envelope-from bu7cher@yandex.ru) Received: from mxback16j.mail.yandex.net (mxback16j.mail.yandex.net [IPv6:2a02:6b8:0:1619::92]) by forward100p.mail.yandex.net (Yandex) with ESMTP id 7806D59802CC; Wed, 29 May 2019 20:58:16 +0300 (MSK) Received: from smtp1p.mail.yandex.net (smtp1p.mail.yandex.net [2a02:6b8:0:1472:2741:0:8b6:6]) by mxback16j.mail.yandex.net (nwsmtp/Yandex) with ESMTP id E7nLS46MOT-wGPWEgG8; Wed, 29 May 2019 20:58:16 +0300 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yandex.ru; s=mail; t=1559152696; bh=cSzKUIc9EOpG9tRDs+4jaP9EBNcDeaFWxPZm8oLXgOY=; h=In-Reply-To:From:To:Subject:Cc:Date:References:Message-ID; b=U4s90LGK8FEdHGQ3dVYlJcUG6/MjmieKyveolVRmEzNN/iZyXQefR02onMd8RbRDj TyhTGUAnQNssEGWM7TwvtbVQgOUmYpbYRe4HuUNMc38qNdKDGu4z4D0mZ13SQw+wFJ trj7Z0LMT/Ts/WdMtdiQopNMkZejCJnvkedm6zkI= Received: by smtp1p.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id VLGhcR82j2-wF7SwKZH; Wed, 29 May 2019 20:58:15 +0300 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (Client certificate not present) Subject: Re: svn commit: r348303 - head/sys/net To: Gleb Smirnoff Cc: "Andrey V. Elsukov" , kib@freebsd.org, src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201905271241.x4RCffTm047128@repo.freebsd.org> <20190529001046.GC21836@FreeBSD.org> <20190529031256.GE21836@FreeBSD.org> From: "Andrey V. Elsukov" Openpgp: id=E6591E1B41DA1516F0C9BC0001C5EA0410C8A17A Autocrypt: addr=bu7cher@yandex.ru; prefer-encrypt=mutual; keydata= mQENBEwBF1kBCADB9sXFhBEUy8qQ4X63Y8eBatYMHGEFWN9ypS5lI3RE6qQW2EYbxNk7qUC5 21YIIS1mMFVBEfvR7J9uc7yaYgFCEb6Sce1RSO4ULN2mRKGHP3/Sl0ijZEjWHV91hY1YTHEF ZW/0GYinDf56sYpDDehaBF5wkWIo1+QK5nmj3vl0DIDCMNd7QEiWpyLVwECgLX2eOAXByT8B bCqVhJGcG6iFP7/B9Ll6uX5gb8thM9LM+ibwErDBVDGiOgvfxqidab7fdkh893IBCXa82H9N CNwnEtcgzh+BSKK5BgvPohFMgRwjti37TSxwLu63QejRGbZWSz3OK3jMOoF63tCgn7FvABEB AAG0JUFuZHJleSBWLiBFbHN1a292IDxidTdjaGVyQHlhbmRleC5ydT6JATgEEwECACIFAkwB F1kCGwMGCwkIBwMCBhUIAgkKCwQWAgMBAh4BAheAAAoJEAHF6gQQyKF6qmYIAI6ekfm1VA4T vqankI1ISE6ku4jV7UlpIQlEbE7/8n3Zd6teJ+pGOQhN5qk8QE7utdPdbktAzi+x7LIJVzUw 4TywZLXGrkP7VKYkfg6oyCGyzITghefQeJtr2TN4hYCkzPWpylkue8MtmqfZv/6royqwTbN+ +E09FQNvTgRUYJYTeQ1qOsxNRycwvw3dr2rOfuxShbzaHBB1pBIjGrMg8fC5pd65ACH5zuFV A0CoTNGMDrEZSfBkTW604UUHFFXeCoC3dwDZRKOWJ3GmMXns65Ai5YkA63BSHEE1Qle3VBhd cG1w0CB5FBV3pB27UVnf0jEbysrDqW4qN7XMRFSWNAy5AQ0ETAEXWQEIAJ2p6l9LBoqdH/0J PEFDY2t2gTvAuzz+8zs3R03dFuHcNbOwjvWCG0aOmVpAzkRa8egn5JB4sZaFUtKPYJEQ1Iu+ LUBwgvtXf4vWpzC67zs2dDuiW4LamH5p6xkTD61aHR7mCB3bg2TUjrDWn2Jt44cvoYxj3dz4 S49U1rc9ZPgD5axCNv45j72tggWlZvpefThP7xT1OlNTUqye2gAwQravXpZkl5JG4eOqJVIU X316iE3qso0iXRUtO7OseBf0PiVmk+wCahdreHOeOxK5jMhYkPKVn7z1sZiB7W2H2TojbmcK HZC22sz7Z/H36Lhg1+/RCnGzdEcjGc8oFHXHCxUAEQEAAYkBHwQYAQIACQUCTAEXWQIbDAAK CRABxeoEEMihegkYCAC3ivGYNe2taNm/4Nx5GPdzuaAJGKWksV+w9mo7dQvU+NmI2az5w8vw 98OmX7G0OV9snxMW+6cyNqBrVFTu33VVNzz9pnqNCHxGvj5dL5ltP160JV2zw2bUwJBYsgYQ WfyJJIM7l3gv5ZS3DGqaGIm9gOK1ANxfrR5PgPzvI9VxDhlr2juEVMZYAqPLEJe+SSxbwLoz BcFCNdDAyXcaAzXsx/E02YWm1hIWNRxanAe7Vlg7OL+gvLpdtrYCMg28PNqKNyrQ87LQ49O9 50IIZDOtNFeR0FGucjcLPdS9PiEqCoH7/waJxWp6ydJ+g4OYRBYNM0EmMgy1N85JJrV1mi5i Message-ID: Date: Wed, 29 May 2019 20:56:23 +0300 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:60.0) Gecko/20100101 Thunderbird/60.6.1 MIME-Version: 1.0 In-Reply-To: <20190529031256.GE21836@FreeBSD.org> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="cKcieXbcb4bVmsLGjhHNDXEpG0pEqqRMD" X-Rspamd-Queue-Id: 301F3774CE X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.99 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; REPLY(-4.00)[]; NEURAL_HAM_SHORT(-0.99)[-0.986,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 29 May 2019 17:58:21 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --cKcieXbcb4bVmsLGjhHNDXEpG0pEqqRMD Content-Type: multipart/mixed; boundary="1yIXOl0T3sasaEySMN3w17uEFk0Mn5Yu1"; protected-headers="v1" From: "Andrey V. Elsukov" To: Gleb Smirnoff Cc: "Andrey V. Elsukov" , kib@freebsd.org, src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Message-ID: Subject: Re: svn commit: r348303 - head/sys/net References: <201905271241.x4RCffTm047128@repo.freebsd.org> <20190529001046.GC21836@FreeBSD.org> <20190529031256.GE21836@FreeBSD.org> In-Reply-To: <20190529031256.GE21836@FreeBSD.org> --1yIXOl0T3sasaEySMN3w17uEFk0Mn5Yu1 Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: quoted-printable On 29.05.2019 06:12, Gleb Smirnoff wrote: > A> bpf_mtap() is not the only consumer of bd_bif, some of them expect i= t > A> becomes NULL when descriptor is detached. >=20 > May be then make a flag attached/detached? Do you have benchmark results that show some benefits in performance? :) I prefer to wait some time after MFC to get a bit wide testing, before doing another performance optimizations. --=20 WBR, Andrey V. Elsukov --1yIXOl0T3sasaEySMN3w17uEFk0Mn5Yu1-- --cKcieXbcb4bVmsLGjhHNDXEpG0pEqqRMD Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Comment: Using GnuPG with Thunderbird - https://www.enigmail.net/ iQEzBAEBCAAdFiEE5lkeG0HaFRbwybwAAcXqBBDIoXoFAlzux8cACgkQAcXqBBDI oXqeugf/a5+aa8+3tPqwqt814mLIthrbiC9KEYKPngMrMIHxFuDM62BV8dTCIHH5 BMxxtOmoh2NNjbxhcu0DkFmQuljpUZXj0V2x/6julvMA33Q5WBAnk1sAAKupwZSi At2HhqVZVCm5Gv+HJmnO++0pUTSJ9IWAeF6RCIiXuU3bM8iDEjFlu6kscB5/RnaQ sp/OG0/kt5K3TSjRuq8TIrUOkQ7l4Z2JYJYG5VW+FnmKm+9ScAdT9nMnKjmFSRtU 0tGqr1snTAknWDsMweGE3tOgLPlI4ewPnuwdhQKNPyqXOvf+xYzpAovqHEY2yI2T T2aqgGbFtL2adR0T452CKPHmpvFaUA== =dn1L -----END PGP SIGNATURE----- --cKcieXbcb4bVmsLGjhHNDXEpG0pEqqRMD-- From owner-svn-src-head@freebsd.org Wed May 29 18:11:18 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2E99615A9074; Wed, 29 May 2019 18:11:18 +0000 (UTC) (envelope-from lwhsu@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id C0FB577C18; Wed, 29 May 2019 18:11:17 +0000 (UTC) (envelope-from lwhsu@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 9E6A85625; Wed, 29 May 2019 18:11:17 +0000 (UTC) (envelope-from lwhsu@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x4TIBHQ5054198; Wed, 29 May 2019 18:11:17 GMT (envelope-from lwhsu@FreeBSD.org) Received: (from lwhsu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4TIBHsa054136; Wed, 29 May 2019 18:11:17 GMT (envelope-from lwhsu@FreeBSD.org) Message-Id: <201905291811.x4TIBHsa054136@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: lwhsu set sender to lwhsu@FreeBSD.org using -f From: Li-Wen Hsu Date: Wed, 29 May 2019 18:11:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r348366 - head/sys/dev/ips X-SVN-Group: head X-SVN-Commit-Author: lwhsu X-SVN-Commit-Paths: head/sys/dev/ips X-SVN-Commit-Revision: 348366 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: C0FB577C18 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.97)[-0.968,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 29 May 2019 18:11:18 -0000 Author: lwhsu Date: Wed May 29 18:11:17 2019 New Revision: 348366 URL: https://svnweb.freebsd.org/changeset/base/348366 Log: Add the likely missing braces in ips(4). This is found by gcc warning that the code is not guarded by the if clause and has misleading indentation. Approved by: scottl MFC after: 3 days Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D20427 Modified: head/sys/dev/ips/ips.c Modified: head/sys/dev/ips/ips.c ============================================================================== --- head/sys/dev/ips/ips.c Wed May 29 16:39:52 2019 (r348365) +++ head/sys/dev/ips/ips.c Wed May 29 18:11:17 2019 (r348366) @@ -287,10 +287,11 @@ static int ips_diskdev_free(ips_softc_t *sc) int i; int error = 0; for(i = 0; i < IPS_MAX_NUM_DRIVES; i++){ - if(sc->diskdev[i]) + if(sc->diskdev[i]) { error = device_delete_child(sc->dev, sc->diskdev[i]); if(error) return error; + } } bus_generic_detach(sc->dev); return 0; From owner-svn-src-head@freebsd.org Wed May 29 20:34:36 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 237FC15AC900; Wed, 29 May 2019 20:34:36 +0000 (UTC) (envelope-from allanjude@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id B6CDC85CA9; Wed, 29 May 2019 20:34:35 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 8656A6EE0; Wed, 29 May 2019 20:34: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 x4TKYZGm034793; Wed, 29 May 2019 20:34:35 GMT (envelope-from allanjude@FreeBSD.org) Received: (from allanjude@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4TKYZMn034792; Wed, 29 May 2019 20:34:35 GMT (envelope-from allanjude@FreeBSD.org) Message-Id: <201905292034.x4TKYZMn034792@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: allanjude set sender to allanjude@FreeBSD.org using -f From: Allan Jude Date: Wed, 29 May 2019 20:34:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r348370 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Group: head X-SVN-Commit-Author: allanjude X-SVN-Commit-Paths: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Commit-Revision: 348370 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: B6CDC85CA9 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.96)[-0.959,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 29 May 2019 20:34:36 -0000 Author: allanjude Date: Wed May 29 20:34:35 2019 New Revision: 348370 URL: https://svnweb.freebsd.org/changeset/base/348370 Log: Fix assertion in ZFS TRIM code Due to an attempt to check two conditions at once in a macro not designed as such, the assertion would always evaluate to true. #define VERIFY3_IMPL(LEFT, OP, RIGHT, TYPE) do { \ const TYPE __left = (TYPE)(LEFT); \ const TYPE __right = (TYPE)(RIGHT); \ if (!(__left OP __right)) \ assfail3(#LEFT " " #OP " " #RIGHT, \ (uintmax_t)__left, #OP, (uintmax_t)__right, \ __FILE__, __LINE__); \ _NOTE(CONSTCOND) } while (0) #define ASSERT3U(x, y, z) VERIFY3_IMPL(x, y, z, uint64_t) Mean that we compared: left = (type == ZIO_TYPE_FREE || psize) OP = "<=" right = (SPA_MAXBLOCKSIZE) If the type was not FREE, 0 is less than SPA_MAXBLOCKSIZE (16MB) If the type is ZIO_TYPE_FREE, 1 is less than SPA_MAXBLOCKSIZE The constraint on psize (physical size of the FREE operation) is never checked against SPA_MAXBLOCKSIZE Reported by: Ka Ho Ng Reviewed by: kevans MFC after: 2 weeks Sponsored by: Klara Systems Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio.c Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio.c Wed May 29 19:11:09 2019 (r348369) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio.c Wed May 29 20:34:35 2019 (r348370) @@ -643,7 +643,7 @@ zio_create(zio_t *pio, spa_t *spa, uint64_t txg, const { zio_t *zio; - ASSERT3U(type == ZIO_TYPE_FREE || psize, <=, SPA_MAXBLOCKSIZE); + IMPLY(type != ZIO_TYPE_FREE, psize <= SPA_MAXBLOCKSIZE); ASSERT(P2PHASE(psize, SPA_MINBLOCKSIZE) == 0); ASSERT(P2PHASE(offset, SPA_MINBLOCKSIZE) == 0); From owner-svn-src-head@freebsd.org Wed May 29 20:52:17 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BF80C15AD288 for ; Wed, 29 May 2019 20:52:16 +0000 (UTC) (envelope-from ian@freebsd.org) Received: from outbound1a.eu.mailhop.org (outbound1a.eu.mailhop.org [52.58.109.202]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 22F6F86DB3 for ; Wed, 29 May 2019 20:52:15 +0000 (UTC) (envelope-from ian@freebsd.org) ARC-Seal: i=1; a=rsa-sha256; t=1559163124; cv=none; d=outbound.mailhop.org; s=arc-outbound20181012; b=G/ngsGVi30e0gf2iuEvhl5TWPPryrpGrzLmWeKlsuRGEzG14cmLpB3HydnjkoOkEcDxFKfA1lFI43 /CKZqKg8znzp0qoJMbZcVLqB1pnvsaRoKT87qoQRZwxVtPTdto8KacOm9TdUdsah4XOfPnUKxuX76D V/Lf1xfz5DkUxlC5O0MCLCDUGjIwhuHpZoq4DkaE3J8EZRtZwoBAtIXEH14PJI/IAmgUxAXwxDDnbM wsCzMZl3J+E4X7uK6BVASZTCD+yomZ7074/Be/kRhUYWO1wOtuNWFO9nvbOsTXbTX5vICITgxA8/BR ezhU6dptIvphsGMKNgQv2ndTyq0Zrdg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=outbound.mailhop.org; s=arc-outbound20181012; h=content-transfer-encoding:mime-version:content-type:references:in-reply-to: date:to:from:subject:message-id:dkim-signature:from; bh=XAg3i3rPBzahmcDf2Qnsd6gUTTZpWADMSIiPeRYPMYI=; b=Gw9sk027bk4pakARLG4ug/AAeE1xduvqBAsBeUGF0dKKDyg+bf7DG2g4wQufjo1Yw4Oeklv5zmeuM GM3KrZSdj0sQtFsWD1n4YpTLUQ7BrwwA4OldK5ptGI3jsNJsPRF/7vcPhQtnjDt9oN6FTpQpg3MPOT mYsENQPjzbtaRcnN8KO0r6sfbI4MIaCBZ3Ze4n289GGutNIbHkSCUE+OzYap8Fx19QTAZ4wk3oYv1Y veHdwx4s1uWxx5DY1LfUrHybm/I4dYxRASjO82SHlrTEatm5pxRsX+0AwbzcadNQAu8DjJcrRzktDG +9Hfx/MwL/fMYb0f39sxKVNXy5vNlHQ== ARC-Authentication-Results: i=1; outbound2.eu.mailhop.org; spf=softfail smtp.mailfrom=freebsd.org smtp.remote-ip=67.177.211.60; dmarc=none header.from=freebsd.org; arc=none header.oldest-pass=0; DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=outbound.mailhop.org; s=dkim-high; h=content-transfer-encoding:mime-version:content-type:references:in-reply-to: date:to:from:subject:message-id:from; bh=XAg3i3rPBzahmcDf2Qnsd6gUTTZpWADMSIiPeRYPMYI=; b=e64deZmyG9cYEFBRoxFGGd49Q1wK4iPhSyPADUBUXE2+Tpmrzhlt98ZTNzsF0Gnzjsubg7tqOUVAS x3EJHYNAOc5JRAfnCIqIoZG9GfLW1kumMKv3wDQX3U2ZFw86TEJkU0lD1XZSuOoALasdZ7hpLW2stI P68ME8cdJydgYlTS1634H/c+INcT/HXNhaufcB0wqBvqDXtxeiGuar3TE43A0vz7a1s9zJikn5Csip B+Fnaq6I7n61VAdQAgRwCmSxk6pahtIZL3d04/Jbl+ZzZRP5Agmwc58RbS7169W4OM1+u7htPjmc7W HFATncUvlSCXjQmdOSvmbWgapeEkX4A== X-MHO-RoutePath: aGlwcGll X-MHO-User: 9b08a4f0-8253-11e9-85c6-c97e5c048ed3 X-Report-Abuse-To: https://support.duocircle.com/support/solutions/articles/5000540958-duocircle-standard-smtp-abuse-information X-Originating-IP: 67.177.211.60 X-Mail-Handler: DuoCircle Outbound SMTP Received: from ilsoft.org (unknown [67.177.211.60]) by outbound2.eu.mailhop.org (Halon) with ESMTPSA id 9b08a4f0-8253-11e9-85c6-c97e5c048ed3; Wed, 29 May 2019 20:52:02 +0000 (UTC) Received: from rev (rev [172.22.42.240]) by ilsoft.org (8.15.2/8.15.2) with ESMTP id x4TKq0j6036036; Wed, 29 May 2019 14:52:00 -0600 (MDT) (envelope-from ian@freebsd.org) Message-ID: Subject: Re: svn commit: r348355 - head/sys/dev/iicbus From: Ian Lepore To: Andriy Gapon , Niclas Zeising , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Date: Wed, 29 May 2019 14:52:00 -0600 In-Reply-To: References: <201905290908.x4T98L89066643@repo.freebsd.org> Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.28.5 FreeBSD GNOME Team Mime-Version: 1.0 Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: 22F6F86DB3 X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.99 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.99)[-0.990,0]; REPLY(-4.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 29 May 2019 20:52:17 -0000 On Wed, 2019-05-29 at 15:12 +0300, Andriy Gapon wrote: > On 29/05/2019 14:54, Niclas Zeising wrote: > > On 2019-05-29 11:08, Andriy Gapon wrote: > > > Author: avg > > > Date: Wed May 29 09:08:20 2019 > > > New Revision: 348355 > > > URL: https://svnweb.freebsd.org/changeset/base/348355 > > > > > > Log: > > > revert r273728 and parts of r306589, iicbus no-stop by default feature > > > Since drm2 removal, there has not been any consumer of the feature in the > > > tree. I am also unaware of any out-of-tree consumer. > > > More importantly, the feature has been broken from the very start, both > > > before and after r306589, because the ivar was set on a device that does > > > not support it and it was read from another device that also does not > > > support it. > > > A bus-wide no-stop flag cannot be implemented as an ivar as iicbus > > > attaches as a child of various drivers. Implementing the ivar in each > > > and every I2C driver is just impractical. > > > If we ever want to implement this feature properly, then probably the > > > easiest way to do it would be via a flag in the softc of iicbus. > > > In fact, we might have to do that in the stable branches if we want to > > > fix the code for them. > > > Reported by: ian (long time ago) > > > MFC after: 1 month (maybe) > > > X-MFC-note: cannot just merge the change, must keep drm2 happy > > > > > > > Hi! > > Just a note, be aware that drm2 lives on in ports as drm-legacy-kmod. I haven't > > tested, but, from the description above I worry that it will affect the port. > > What do you think? > > Oh, I forgot about that one... > I think that it could be affected if it still uses FreeBSD iic code. > I guess I might have to revert the change. > > I don't think so, because I don't think this change ever worked. I'm not sure how anybody convinced themselves that it did. It attempts to retrieve ivars from a device that doesn't have them, so the net effect is that the nostop variable is initialized from stack garbage. Maybe whoever wrote and tested it was lucky enough to have that accidentally be consistently zero or non-zero, so their testing appeared to work. Looking at the drm2 code that is the only user of this, it appears that the nostop value is only used in the case where the driver falls back to using the builtin intel_iicbb_driver. That driver relies on iicbus_transfer_gen() which is where the nostop kludge was added. That's the fundamental problem in all of this: the right thing to do, IMO, would have been to implement the iicbus_transfer method directly in the intel_iicbb_driver (probably by just cut-and-pasting the code from iicconf.c then doing whatever is necessary to ignore stops). And we can still do that, pretty trivially, if necessary. -- Ian From owner-svn-src-head@freebsd.org Wed May 29 21:55:36 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9EDB815AEB31; Wed, 29 May 2019 21:55:36 +0000 (UTC) (envelope-from glebius@freebsd.org) Received: from cell.glebi.us (glebi.us [162.251.186.162]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "cell.glebi.us", Issuer "cell.glebi.us" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id EE80E897ED; Wed, 29 May 2019 21:55:35 +0000 (UTC) (envelope-from glebius@freebsd.org) Received: from cell.glebi.us (localhost [127.0.0.1]) by cell.glebi.us (8.15.2/8.15.2) with ESMTPS id x4TLtWu0028427 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NO); Wed, 29 May 2019 14:55:33 -0700 (PDT) (envelope-from glebius@freebsd.org) Received: (from glebius@localhost) by cell.glebi.us (8.15.2/8.15.2/Submit) id x4TLtWwR028426; Wed, 29 May 2019 14:55:32 -0700 (PDT) (envelope-from glebius@freebsd.org) X-Authentication-Warning: cell.glebi.us: glebius set sender to glebius@freebsd.org using -f Date: Wed, 29 May 2019 14:55:32 -0700 From: Gleb Smirnoff To: "Andrey V. Elsukov" Cc: "Andrey V. Elsukov" , kib@freebsd.org, src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r348303 - head/sys/net Message-ID: <20190529215532.GG21836@FreeBSD.org> References: <201905271241.x4RCffTm047128@repo.freebsd.org> <20190529001046.GC21836@FreeBSD.org> <20190529031256.GE21836@FreeBSD.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.11.4 (2019-03-13) X-Rspamd-Queue-Id: EE80E897ED X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.99 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.99)[-0.988,0]; REPLY(-4.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 29 May 2019 21:55:36 -0000 On Wed, May 29, 2019 at 08:56:23PM +0300, Andrey V. Elsukov wrote: A> On 29.05.2019 06:12, Gleb Smirnoff wrote: A> > A> bpf_mtap() is not the only consumer of bd_bif, some of them expect it A> > A> becomes NULL when descriptor is detached. A> > A> > May be then make a flag attached/detached? A> A> Do you have benchmark results that show some benefits in performance? :) A> I prefer to wait some time after MFC to get a bit wide testing, before A> doing another performance optimizations. I was mostly motivated not by performance but by design, so that it conforms to delayed free architecture. Btw, now I see that my one liner isn't sufficient, since we bpfif_rele() not in the deferred context but right after CK_LIST_REMOVE(). -- Gleb Smirnoff From owner-svn-src-head@freebsd.org Wed May 29 22:24:11 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B581E15AF384; Wed, 29 May 2019 22:24:11 +0000 (UTC) (envelope-from erj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 58B908A588; Wed, 29 May 2019 22:24:11 +0000 (UTC) (envelope-from erj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 364E78154; Wed, 29 May 2019 22:24:11 +0000 (UTC) (envelope-from erj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x4TMOBmi092880; Wed, 29 May 2019 22:24:11 GMT (envelope-from erj@FreeBSD.org) Received: (from erj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4TMOAoT092879; Wed, 29 May 2019 22:24:10 GMT (envelope-from erj@FreeBSD.org) Message-Id: <201905292224.x4TMOAoT092879@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: erj set sender to erj@FreeBSD.org using -f From: Eric Joyner Date: Wed, 29 May 2019 22:24:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r348372 - head/sys/net X-SVN-Group: head X-SVN-Commit-Author: erj X-SVN-Commit-Paths: head/sys/net X-SVN-Commit-Revision: 348372 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 58B908A588 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.96)[-0.960,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 29 May 2019 22:24:12 -0000 Author: erj Date: Wed May 29 22:24:10 2019 New Revision: 348372 URL: https://svnweb.freebsd.org/changeset/base/348372 Log: iflib: provide probe wrapper for vendor drivers From Jake: Vendor drivers that exist out-of-tree generally should return BUS_PROBE_VENDOR from their device probe functions. This helps ensure that a vendor replacement driver will supersede the in-kernel driver for a given device. Currently, if a vendor wants to implement a driver based on iflib, it will always report BUS_PROBE_DEFAULT. Add a wrapper function, iflib_device_probe_vendor() which can be used in place of iflib_device_probe(). This function will just return BUS_PROBE_VENDOR whenever iflib_device_probe() would return BUS_PROBE_DEFAULT. While vendor drivers can already implement such a wrapper themselves, providing it in the iflib.h header makes it easier for the vendor driver to do the right thing. Submitted by: Jacob Keller Reviewed by: erj@, gallatin@, marius@ MFC after: 1 week Sponsored by: Intel Corporation Differential Revision: https://reviews.freebsd.org/D20221 Modified: head/sys/net/iflib.c head/sys/net/iflib.h Modified: head/sys/net/iflib.c ============================================================================== --- head/sys/net/iflib.c Wed May 29 20:45:31 2019 (r348371) +++ head/sys/net/iflib.c Wed May 29 22:24:10 2019 (r348372) @@ -4377,6 +4377,18 @@ iflib_device_probe(device_t dev) return (ENXIO); } +int +iflib_device_probe_vendor(device_t dev) +{ + int probe; + + probe = iflib_device_probe(dev); + if (probe == BUS_PROBE_DEFAULT) + return (BUS_PROBE_VENDOR); + else + return (probe); +} + static void iflib_reset_qvalues(if_ctx_t ctx) { Modified: head/sys/net/iflib.h ============================================================================== --- head/sys/net/iflib.h Wed May 29 20:45:31 2019 (r348371) +++ head/sys/net/iflib.h Wed May 29 22:24:10 2019 (r348372) @@ -399,6 +399,13 @@ int iflib_device_suspend(device_t); int iflib_device_resume(device_t); int iflib_device_shutdown(device_t); +/* + * Use this instead of iflib_device_probe if the driver should report + * BUS_PROBE_VENDOR instead of BUS_PROBE_DEFAULT. (For example, an out-of-tree + * driver based on iflib). + */ +int iflib_device_probe_vendor(device_t); + int iflib_device_iov_init(device_t, uint16_t, const nvlist_t *); void iflib_device_iov_uninit(device_t); From owner-svn-src-head@freebsd.org Wed May 29 22:33:38 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2599615AF647; Wed, 29 May 2019 22:33:38 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id BDA8D8AA4F; Wed, 29 May 2019 22:33:37 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 91A0E8327; Wed, 29 May 2019 22:33:37 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x4TMXbI5097821; Wed, 29 May 2019 22:33:37 GMT (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4TMXbPT097820; Wed, 29 May 2019 22:33:37 GMT (envelope-from glebius@FreeBSD.org) Message-Id: <201905292233.x4TMXbPT097820@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: glebius set sender to glebius@FreeBSD.org using -f From: Gleb Smirnoff Date: Wed, 29 May 2019 22:33:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r348373 - head/sys/vm X-SVN-Group: head X-SVN-Commit-Author: glebius X-SVN-Commit-Paths: head/sys/vm X-SVN-Commit-Revision: 348373 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: BDA8D8AA4F X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.95)[-0.953,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 29 May 2019 22:33:38 -0000 Author: glebius Date: Wed May 29 22:33:37 2019 New Revision: 348373 URL: https://svnweb.freebsd.org/changeset/base/348373 Log: In r343857 the referred comment moved to uma_vm_zone_stats(). Modified: head/sys/vm/uma_core.c Modified: head/sys/vm/uma_core.c ============================================================================== --- head/sys/vm/uma_core.c Wed May 29 22:24:10 2019 (r348372) +++ head/sys/vm/uma_core.c Wed May 29 22:33:37 2019 (r348373) @@ -3396,7 +3396,7 @@ uma_zone_get_cur(uma_zone_t zone) counter_u64_fetch(zone->uz_frees); CPU_FOREACH(i) { /* - * See the comment in sysctl_vm_zone_stats() regarding the + * See the comment in uma_vm_zone_stats() regarding the * safety of accessing the per-cpu caches. With the zone lock * held, it is safe, but can potentially result in stale data. */ From owner-svn-src-head@freebsd.org Wed May 29 23:50:32 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 429F115B0FDB; Wed, 29 May 2019 23:50:32 +0000 (UTC) (envelope-from rpokala@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id DAA008D415; Wed, 29 May 2019 23:50:31 +0000 (UTC) (envelope-from rpokala@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A7AF38ED1; Wed, 29 May 2019 23:50:31 +0000 (UTC) (envelope-from rpokala@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x4TNoVhx035491; Wed, 29 May 2019 23:50:31 GMT (envelope-from rpokala@FreeBSD.org) Received: (from rpokala@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4TNoV3R035490; Wed, 29 May 2019 23:50:31 GMT (envelope-from rpokala@FreeBSD.org) Message-Id: <201905292350.x4TNoV3R035490@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rpokala set sender to rpokala@FreeBSD.org using -f From: Ravi Pokala Date: Wed, 29 May 2019 23:50:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r348376 - head/sys/sys X-SVN-Group: head X-SVN-Commit-Author: rpokala X-SVN-Commit-Paths: head/sys/sys X-SVN-Commit-Revision: 348376 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: DAA008D415 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.97)[-0.974,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 29 May 2019 23:50:32 -0000 Author: rpokala Date: Wed May 29 23:50:31 2019 New Revision: 348376 URL: https://svnweb.freebsd.org/changeset/base/348376 Log: Add bits related to SANITIZE, SED, and form-factor to (struct ata_params) Based on ATA-ACS-4, recognize several bit-fields related to the ATA SANITIZE feature-set, Self-Encrypting Drives, and form-factor identification. As part of this change, the name of word 48 of (struct ata_params) is being changed. The previous name, "usedmovsd" does not appear to be related to the previous definition of the word ("double-word IO supported"). The word was defined that way in ATA-1 (1994), but it was marked "Reserved" (meaning "unused, but might be used in the future") in ATA-2 (1996). It stayed that way until ATA-8 (2008), which re-defined it as implemented in this change. The field is not used in-tree. Reviewed by: mav Sponsored by: Panasas Differential Revision: https://reviews.freebsd.org/D20455 Modified: head/sys/sys/ata.h Modified: head/sys/sys/ata.h ============================================================================== --- head/sys/sys/ata.h Wed May 29 23:11:07 2019 (r348375) +++ head/sys/sys/ata.h Wed May 29 23:50:31 2019 (r348376) @@ -66,7 +66,8 @@ struct ata_params { /*023*/ u_int8_t revision[8]; /* firmware revision */ /*027*/ u_int8_t model[40]; /* model name */ /*047*/ u_int16_t sectors_intr; /* sectors per interrupt */ -/*048*/ u_int16_t usedmovsd; /* double word read/write? */ +/*048*/ u_int16_t tcg; /* Trusted Computing Group */ +#define ATA_SUPPORT_TCG 0x0001 /*049*/ u_int16_t capabilities1; #define ATA_SUPPORT_DMA 0x0100 #define ATA_SUPPORT_LBA 0x0200 @@ -92,6 +93,10 @@ struct ata_params { /*057*/ u_int16_t current_size_1; /*058*/ u_int16_t current_size_2; /*059*/ u_int16_t multi; +#define ATA_SUPPORT_BLOCK_ERASE_EXT 0x8000 +#define ATA_SUPPORT_OVERWRITE_EXT 0x4000 +#define ATA_SUPPORT_CRYPTO_SCRAMBLE_EXT 0x2000 +#define ATA_SUPPORT_SANITIZE 0x1000 #define ATA_MULTI_VALID 0x0100 /*060*/ u_int16_t lba_size_1; @@ -107,6 +112,7 @@ struct ata_params { /*069*/ u_int16_t support3; #define ATA_SUPPORT_RZAT 0x0020 #define ATA_SUPPORT_DRAT 0x4000 +#define ATA_ENCRYPTS_ALL_USER_DATA 0x0010 /* Self-encrypting drive */ #define ATA_SUPPORT_ZONE_MASK 0x0003 #define ATA_SUPPORT_ZONE_NR 0x0000 #define ATA_SUPPORT_ZONE_HOST_AWARE 0x0001 @@ -259,7 +265,19 @@ struct ata_params { /*162*/ u_int16_t cfa_kms_support; /*163*/ u_int16_t cfa_trueide_modes; /*164*/ u_int16_t cfa_memory_modes; - u_int16_t reserved165[4]; + u_int16_t reserved165[3]; +/*168*/ u_int16_t form_factor; +#define ATA_FORM_FACTOR_MASK 0x000f +#define ATA_FORM_FACTOR_NOT_REPORTED 0x0000 +#define ATA_FORM_FACTOR_5_25 0x0001 +#define ATA_FORM_FACTOR_3_5 0x0002 +#define ATA_FORM_FACTOR_2_5 0x0003 +#define ATA_FORM_FACTOR_1_8 0x0004 +#define ATA_FORM_FACTOR_SUB_1_8 0x0005 +#define ATA_FORM_FACTOR_MSATA 0x0006 +#define ATA_FORM_FACTOR_M_2 0x0007 +#define ATA_FORM_FACTOR_MICRO_SSD 0x0008 +#define ATA_FORM_FACTOR_C_FAST 0x0009 /*169*/ u_int16_t support_dsm; #define ATA_SUPPORT_DSM_TRIM 0x0001 u_int16_t reserved170[6]; From owner-svn-src-head@freebsd.org Thu May 30 01:21:09 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BA6F915B2EA2; Thu, 30 May 2019 01:21:09 +0000 (UTC) (envelope-from jchandra@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 60DEF8FA7D; Thu, 30 May 2019 01:21:09 +0000 (UTC) (envelope-from jchandra@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 3BD459E07; Thu, 30 May 2019 01:21:09 +0000 (UTC) (envelope-from jchandra@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x4U1L9x2083035; Thu, 30 May 2019 01:21:09 GMT (envelope-from jchandra@FreeBSD.org) Received: (from jchandra@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4U1L8eJ083032; Thu, 30 May 2019 01:21:08 GMT (envelope-from jchandra@FreeBSD.org) Message-Id: <201905300121.x4U1L8eJ083032@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jchandra set sender to jchandra@FreeBSD.org using -f From: "Jayachandran C." Date: Thu, 30 May 2019 01:21:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r348377 - head/sys/arm64/arm64 X-SVN-Group: head X-SVN-Commit-Author: jchandra X-SVN-Commit-Paths: head/sys/arm64/arm64 X-SVN-Commit-Revision: 348377 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 60DEF8FA7D X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.97)[-0.971,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 30 May 2019 01:21:10 -0000 Author: jchandra Date: Thu May 30 01:21:08 2019 New Revision: 348377 URL: https://svnweb.freebsd.org/changeset/base/348377 Log: gic_v3: consolidate per-cpu redistributor information Update 'struct gic_redists' to consolidate all per-cpu redistributor information into a new 'struct redist_pcpu'. Provide a new interface (GICV3_IVAR_REDIST) for the GIC driver, which can be used to retrieve the per-cpu data. This per-cpu redistributor struct will be later used to improve the GIC ITS setup. While there, remove some unused fields in gic_v3_var.h interface. No functional changes. Reviewed by: andrew Differential Revision: https://reviews.freebsd.org/D19842 Modified: head/sys/arm64/arm64/gic_v3.c head/sys/arm64/arm64/gic_v3_var.h head/sys/arm64/arm64/gicv3_its.c Modified: head/sys/arm64/arm64/gic_v3.c ============================================================================== --- head/sys/arm64/arm64/gic_v3.c Wed May 29 23:50:31 2019 (r348376) +++ head/sys/arm64/arm64/gic_v3.c Thu May 30 01:21:08 2019 (r348377) @@ -183,36 +183,44 @@ uint32_t gic_r_read_4(device_t dev, bus_size_t offset) { struct gic_v3_softc *sc; + struct resource *rdist; sc = device_get_softc(dev); - return (bus_read_4(sc->gic_redists.pcpu[PCPU_GET(cpuid)], offset)); + rdist = &sc->gic_redists.pcpu[PCPU_GET(cpuid)]->res; + return (bus_read_4(rdist, offset)); } uint64_t gic_r_read_8(device_t dev, bus_size_t offset) { struct gic_v3_softc *sc; + struct resource *rdist; sc = device_get_softc(dev); - return (bus_read_8(sc->gic_redists.pcpu[PCPU_GET(cpuid)], offset)); + rdist = &sc->gic_redists.pcpu[PCPU_GET(cpuid)]->res; + return (bus_read_8(rdist, offset)); } void gic_r_write_4(device_t dev, bus_size_t offset, uint32_t val) { struct gic_v3_softc *sc; + struct resource *rdist; sc = device_get_softc(dev); - bus_write_4(sc->gic_redists.pcpu[PCPU_GET(cpuid)], offset, val); + rdist = &sc->gic_redists.pcpu[PCPU_GET(cpuid)]->res; + bus_write_4(rdist, offset, val); } void gic_r_write_8(device_t dev, bus_size_t offset, uint64_t val) { struct gic_v3_softc *sc; + struct resource *rdist; sc = device_get_softc(dev); - bus_write_8(sc->gic_redists.pcpu[PCPU_GET(cpuid)], offset, val); + rdist = &sc->gic_redists.pcpu[PCPU_GET(cpuid)]->res; + bus_write_8(rdist, offset, val); } /* @@ -384,8 +392,11 @@ gic_v3_read_ivar(device_t dev, device_t child, int whi return (0); case GICV3_IVAR_REDIST_VADDR: *result = (uintptr_t)rman_get_virtual( - sc->gic_redists.pcpu[PCPU_GET(cpuid)]); + &sc->gic_redists.pcpu[PCPU_GET(cpuid)]->res); return (0); + case GICV3_IVAR_REDIST: + *result = (uintptr_t)sc->gic_redists.pcpu[PCPU_GET(cpuid)]; + return (0); case GIC_IVAR_HW_REV: KASSERT( GICR_PIDR2_ARCH(sc->gic_pidr2) == GICR_PIDR2_ARCH_GICv3 || @@ -979,7 +990,7 @@ gic_v3_wait_for_rwp(struct gic_v3_softc *sc, enum gic_ res = sc->gic_dist; break; case REDIST: - res = sc->gic_redists.pcpu[cpuid]; + res = &sc->gic_redists.pcpu[cpuid]->res; break; default: KASSERT(0, ("%s: Attempt to wait for unknown RWP", __func__)); @@ -1173,7 +1184,7 @@ gic_v3_redist_find(struct gic_v3_softc *sc) KASSERT(sc->gic_redists.pcpu[cpuid] != NULL, ("Invalid pointer to per-CPU redistributor")); /* Copy res contents to its final destination */ - *sc->gic_redists.pcpu[cpuid] = r_res; + sc->gic_redists.pcpu[cpuid]->res = r_res; if (bootverbose) { device_printf(sc->dev, "CPU%u Re-Distributor has been found\n", Modified: head/sys/arm64/arm64/gic_v3_var.h ============================================================================== --- head/sys/arm64/arm64/gic_v3_var.h Wed May 29 23:50:31 2019 (r348376) +++ head/sys/arm64/arm64/gic_v3_var.h Thu May 30 01:21:08 2019 (r348377) @@ -40,10 +40,9 @@ DECLARE_CLASS(gic_v3_driver); struct gic_v3_irqsrc; -struct redist_lpis { - vm_offset_t conf_base; - vm_offset_t pend_base[MAXCPU]; - uint64_t flags; +struct redist_pcpu { + struct resource res; + vm_offset_t pend_base; }; struct gic_redists { @@ -55,10 +54,8 @@ struct gic_redists { struct resource ** regions; /* Number of Re-Distributor regions */ u_int nregions; - /* Per-CPU Re-Distributor handler */ - struct resource * pcpu[MAXCPU]; - /* LPIs data */ - struct redist_lpis lpis; + /* Per-CPU Re-Distributor data */ + struct redist_pcpu *pcpu[MAXCPU]; }; struct gic_v3_softc { @@ -97,9 +94,11 @@ MALLOC_DECLARE(M_GIC_V3); /* ivars */ #define GICV3_IVAR_NIRQS 1000 #define GICV3_IVAR_REDIST_VADDR 1001 +#define GICV3_IVAR_REDIST 1002 __BUS_ACCESSOR(gicv3, nirqs, GICV3, NIRQS, u_int); __BUS_ACCESSOR(gicv3, redist_vaddr, GICV3, REDIST_VADDR, void *); +__BUS_ACCESSOR(gicv3, redist, GICV3, REDIST, void *); /* Device methods */ int gic_v3_attach(device_t dev); @@ -131,7 +130,7 @@ void gic_r_write_8(device_t, bus_size_t, uint64_t var) u_int cpu = PCPU_GET(cpuid); \ \ bus_read_##len( \ - sc->gic_redists.pcpu[cpu], \ + &sc->gic_redists.pcpu[cpu]->res, \ reg); \ }) @@ -140,7 +139,7 @@ void gic_r_write_8(device_t, bus_size_t, uint64_t var) u_int cpu = PCPU_GET(cpuid); \ \ bus_write_##len( \ - sc->gic_redists.pcpu[cpu], \ + &sc->gic_redists.pcpu[cpu]->res, \ reg, val); \ }) Modified: head/sys/arm64/arm64/gicv3_its.c ============================================================================== --- head/sys/arm64/arm64/gicv3_its.c Wed May 29 23:50:31 2019 (r348376) +++ head/sys/arm64/arm64/gicv3_its.c Thu May 30 01:21:08 2019 (r348377) @@ -577,6 +577,7 @@ gicv3_its_pendtables_init(struct gicv3_its_softc *sc) static int its_init_cpu(device_t dev, struct gicv3_its_softc *sc) { + struct redist_pcpu *rpcpu; device_t gicv3; vm_paddr_t target; uint64_t xbaser, tmp; @@ -664,7 +665,8 @@ its_init_cpu(device_t dev, struct gicv3_its_softc *sc) if ((gic_its_read_8(sc, GITS_TYPER) & GITS_TYPER_PTA) != 0) { /* This ITS wants the redistributor physical address */ - target = vtophys(gicv3_get_redist_vaddr(dev)); + rpcpu = gicv3_get_redist(dev); + target = vtophys(rman_get_virtual(&rpcpu->res)); } else { /* This ITS wants the unique processor number */ target = GICR_TYPER_CPUNUM(gic_r_read_8(gicv3, GICR_TYPER)); From owner-svn-src-head@freebsd.org Thu May 30 01:24:48 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6B9D015B30EA; Thu, 30 May 2019 01:24:48 +0000 (UTC) (envelope-from jchandra@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 098DC8FE28; Thu, 30 May 2019 01:24:48 +0000 (UTC) (envelope-from jchandra@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D50AA9F71; Thu, 30 May 2019 01:24:47 +0000 (UTC) (envelope-from jchandra@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x4U1OleR087036; Thu, 30 May 2019 01:24:47 GMT (envelope-from jchandra@FreeBSD.org) Received: (from jchandra@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4U1OlP4087035; Thu, 30 May 2019 01:24:47 GMT (envelope-from jchandra@FreeBSD.org) Message-Id: <201905300124.x4U1OlP4087035@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jchandra set sender to jchandra@FreeBSD.org using -f From: "Jayachandran C." Date: Thu, 30 May 2019 01:24:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r348378 - head/sys/arm64/arm64 X-SVN-Group: head X-SVN-Commit-Author: jchandra X-SVN-Commit-Paths: head/sys/arm64/arm64 X-SVN-Commit-Revision: 348378 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 098DC8FE28 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.97)[-0.970,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 30 May 2019 01:24:48 -0000 Author: jchandra Date: Thu May 30 01:24:47 2019 New Revision: 348378 URL: https://svnweb.freebsd.org/changeset/base/348378 Log: gicv3_its: refactor LPI init into a new function Move the per-cpu LPI intialization to a separate function. This is in preparation for a commit that does LPI init only once for a CPU, even when there are multiple ITS blocks associated with the CPU. No functional changes in this commit. Reviewed by: andrew Differential Revision: https://reviews.freebsd.org/D19843 Modified: head/sys/arm64/arm64/gicv3_its.c Modified: head/sys/arm64/arm64/gicv3_its.c ============================================================================== --- head/sys/arm64/arm64/gicv3_its.c Thu May 30 01:21:08 2019 (r348377) +++ head/sys/arm64/arm64/gicv3_its.c Thu May 30 01:24:47 2019 (r348378) @@ -574,26 +574,17 @@ gicv3_its_pendtables_init(struct gicv3_its_softc *sc) } } -static int -its_init_cpu(device_t dev, struct gicv3_its_softc *sc) +static void +its_init_cpu_lpi(device_t dev, struct gicv3_its_softc *sc) { - struct redist_pcpu *rpcpu; device_t gicv3; - vm_paddr_t target; uint64_t xbaser, tmp; uint32_t ctlr; u_int cpuid; gicv3 = device_get_parent(dev); cpuid = PCPU_GET(cpuid); - if (!CPU_ISSET(cpuid, &sc->sc_cpus)) - return (0); - /* Check if the ITS is enabled on this CPU */ - if ((gic_r_read_4(gicv3, GICR_TYPER) & GICR_TYPER_PLPIS) == 0) { - return (ENXIO); - } - /* Disable LPIs */ ctlr = gic_r_read_4(gicv3, GICR_CTLR); ctlr &= ~GICR_CTLR_LPI_ENABLE; @@ -662,6 +653,26 @@ its_init_cpu(device_t dev, struct gicv3_its_softc *sc) /* Make sure the GIC has seen everything */ dsb(sy); +} + +static int +its_init_cpu(device_t dev, struct gicv3_its_softc *sc) +{ + device_t gicv3; + vm_paddr_t target; + u_int cpuid; + struct redist_pcpu *rpcpu; + + gicv3 = device_get_parent(dev); + cpuid = PCPU_GET(cpuid); + if (!CPU_ISSET(cpuid, &sc->sc_cpus)) + return (0); + + /* Check if the ITS is enabled on this CPU */ + if ((gic_r_read_4(gicv3, GICR_TYPER) & GICR_TYPER_PLPIS) == 0) + return (ENXIO); + + its_init_cpu_lpi(dev, sc); if ((gic_its_read_8(sc, GITS_TYPER) & GITS_TYPER_PTA) != 0) { /* This ITS wants the redistributor physical address */ From owner-svn-src-head@freebsd.org Thu May 30 01:32:01 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9BCAC15B3657; Thu, 30 May 2019 01:32:01 +0000 (UTC) (envelope-from jchandra@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 3F57A683F6; Thu, 30 May 2019 01:32:01 +0000 (UTC) (envelope-from jchandra@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 19ADB9FE7; Thu, 30 May 2019 01:32:01 +0000 (UTC) (envelope-from jchandra@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x4U1W0WD088204; Thu, 30 May 2019 01:32:00 GMT (envelope-from jchandra@FreeBSD.org) Received: (from jchandra@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4U1W0OD088201; Thu, 30 May 2019 01:32:00 GMT (envelope-from jchandra@FreeBSD.org) Message-Id: <201905300132.x4U1W0OD088201@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jchandra set sender to jchandra@FreeBSD.org using -f From: "Jayachandran C." Date: Thu, 30 May 2019 01:32:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r348379 - head/sys/arm64/arm64 X-SVN-Group: head X-SVN-Commit-Author: jchandra X-SVN-Commit-Paths: head/sys/arm64/arm64 X-SVN-Commit-Revision: 348379 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 3F57A683F6 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.97)[-0.971,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 30 May 2019 01:32:01 -0000 Author: jchandra Date: Thu May 30 01:32:00 2019 New Revision: 348379 URL: https://svnweb.freebsd.org/changeset/base/348379 Log: gicv3_its: do LPI init only once per CPU The initialization required for LPIs (setting up pending tables etc.) has to be done just once per CPU, even in the case where there are multiple ITS blocks associated with the CPU. Add a flag lpi_enabled in the per-cpu distributor info for this and use it to ensure that we call its_init_cpu_lpi() just once. This enables us to support platforms where multiple GIC ITS blocks can generate LPIs to a CPU. Reviewed by: andrew Differential Revision: https://reviews.freebsd.org/D19844 Modified: head/sys/arm64/arm64/gic_v3.c head/sys/arm64/arm64/gic_v3_var.h head/sys/arm64/arm64/gicv3_its.c Modified: head/sys/arm64/arm64/gic_v3.c ============================================================================== --- head/sys/arm64/arm64/gic_v3.c Thu May 30 01:24:47 2019 (r348378) +++ head/sys/arm64/arm64/gic_v3.c Thu May 30 01:32:00 2019 (r348379) @@ -1185,6 +1185,7 @@ gic_v3_redist_find(struct gic_v3_softc *sc) ("Invalid pointer to per-CPU redistributor")); /* Copy res contents to its final destination */ sc->gic_redists.pcpu[cpuid]->res = r_res; + sc->gic_redists.pcpu[cpuid]->lpi_enabled = false; if (bootverbose) { device_printf(sc->dev, "CPU%u Re-Distributor has been found\n", Modified: head/sys/arm64/arm64/gic_v3_var.h ============================================================================== --- head/sys/arm64/arm64/gic_v3_var.h Thu May 30 01:24:47 2019 (r348378) +++ head/sys/arm64/arm64/gic_v3_var.h Thu May 30 01:32:00 2019 (r348379) @@ -41,8 +41,9 @@ DECLARE_CLASS(gic_v3_driver); struct gic_v3_irqsrc; struct redist_pcpu { - struct resource res; + struct resource res; /* mem resource for redist */ vm_offset_t pend_base; + bool lpi_enabled; /* redist LPI configured? */ }; struct gic_redists { Modified: head/sys/arm64/arm64/gicv3_its.c ============================================================================== --- head/sys/arm64/arm64/gicv3_its.c Thu May 30 01:24:47 2019 (r348378) +++ head/sys/arm64/arm64/gicv3_its.c Thu May 30 01:32:00 2019 (r348379) @@ -672,11 +672,16 @@ its_init_cpu(device_t dev, struct gicv3_its_softc *sc) if ((gic_r_read_4(gicv3, GICR_TYPER) & GICR_TYPER_PLPIS) == 0) return (ENXIO); - its_init_cpu_lpi(dev, sc); + rpcpu = gicv3_get_redist(dev); + /* Do per-cpu LPI init once */ + if (!rpcpu->lpi_enabled) { + its_init_cpu_lpi(dev, sc); + rpcpu->lpi_enabled = true; + } + if ((gic_its_read_8(sc, GITS_TYPER) & GITS_TYPER_PTA) != 0) { /* This ITS wants the redistributor physical address */ - rpcpu = gicv3_get_redist(dev); target = vtophys(rman_get_virtual(&rpcpu->res)); } else { /* This ITS wants the unique processor number */ From owner-svn-src-head@freebsd.org Thu May 30 01:39:08 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BAFE715B385D; Thu, 30 May 2019 01:39:08 +0000 (UTC) (envelope-from jchandra@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 5A00469ADB; Thu, 30 May 2019 01:39:08 +0000 (UTC) (envelope-from jchandra@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id ED72FA14D; Thu, 30 May 2019 01:39:07 +0000 (UTC) (envelope-from jchandra@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x4U1d77w092379; Thu, 30 May 2019 01:39:07 GMT (envelope-from jchandra@FreeBSD.org) Received: (from jchandra@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4U1d7ZW092378; Thu, 30 May 2019 01:39:07 GMT (envelope-from jchandra@FreeBSD.org) Message-Id: <201905300139.x4U1d7ZW092378@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jchandra set sender to jchandra@FreeBSD.org using -f From: "Jayachandran C." Date: Thu, 30 May 2019 01:39:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r348380 - head/sys/arm64/arm64 X-SVN-Group: head X-SVN-Commit-Author: jchandra X-SVN-Commit-Paths: head/sys/arm64/arm64 X-SVN-Commit-Revision: 348380 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 5A00469ADB X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.97)[-0.970,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 30 May 2019 01:39:08 -0000 Author: jchandra Date: Thu May 30 01:39:07 2019 New Revision: 348380 URL: https://svnweb.freebsd.org/changeset/base/348380 Log: arm64 gicv3_its: Fix a typo Fix 'Cavium' spelling in errata description. Reviewed by: andrew Differential Revision: https://reviews.freebsd.org/D20418 Modified: head/sys/arm64/arm64/gicv3_its.c Modified: head/sys/arm64/arm64/gicv3_its.c ============================================================================== --- head/sys/arm64/arm64/gicv3_its.c Thu May 30 01:32:00 2019 (r348379) +++ head/sys/arm64/arm64/gicv3_its.c Thu May 30 01:39:07 2019 (r348380) @@ -274,7 +274,7 @@ static const struct { } its_quirks[] = { { /* Cavium ThunderX Pass 1.x */ - .desc = "Cavoum ThunderX errata: 22375, 24313", + .desc = "Cavium ThunderX errata: 22375, 24313", .iidr = GITS_IIDR_RAW(GITS_IIDR_IMPL_CAVIUM, GITS_IIDR_PROD_THUNDER, GITS_IIDR_VAR_THUNDER_1, 0), .iidr_mask = ~GITS_IIDR_REVISION_MASK, From owner-svn-src-head@freebsd.org Thu May 30 02:23:58 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B5AE915B464F; Thu, 30 May 2019 02:23:58 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4D0E36B2C3; Thu, 30 May 2019 02:23:58 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E5EAFA9A5; Thu, 30 May 2019 02:23:57 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x4U2NvSN019065; Thu, 30 May 2019 02:23:57 GMT (envelope-from delphij@FreeBSD.org) Received: (from delphij@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4U2NvIl019064; Thu, 30 May 2019 02:23:57 GMT (envelope-from delphij@FreeBSD.org) Message-Id: <201905300223.x4U2NvIl019064@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: delphij set sender to delphij@FreeBSD.org using -f From: Xin LI Date: Thu, 30 May 2019 02:23:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r348381 - head/stand/libsa/zfs X-SVN-Group: head X-SVN-Commit-Author: delphij X-SVN-Commit-Paths: head/stand/libsa/zfs X-SVN-Commit-Revision: 348381 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 4D0E36B2C3 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.97)[-0.970,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 30 May 2019 02:23:58 -0000 Author: delphij Date: Thu May 30 02:23:57 2019 New Revision: 348381 URL: https://svnweb.freebsd.org/changeset/base/348381 Log: Unexpand be32dec(). MFC after: 2 weeks Modified: head/stand/libsa/zfs/zfsimpl.c Modified: head/stand/libsa/zfs/zfsimpl.c ============================================================================== --- head/stand/libsa/zfs/zfsimpl.c Thu May 30 01:39:07 2019 (r348380) +++ head/stand/libsa/zfs/zfsimpl.c Thu May 30 02:23:57 2019 (r348381) @@ -31,6 +31,7 @@ __FBSDID("$FreeBSD$"); * Stand-alone ZFS file reader. */ +#include #include #include @@ -128,10 +129,7 @@ zfs_free(void *ptr, size_t size) static int xdr_int(const unsigned char **xdr, int *ip) { - *ip = ((*xdr)[0] << 24) - | ((*xdr)[1] << 16) - | ((*xdr)[2] << 8) - | ((*xdr)[3] << 0); + *ip = be32dec(*xdr); (*xdr) += 4; return (0); } @@ -139,10 +137,7 @@ xdr_int(const unsigned char **xdr, int *ip) static int xdr_u_int(const unsigned char **xdr, u_int *ip) { - *ip = ((*xdr)[0] << 24) - | ((*xdr)[1] << 16) - | ((*xdr)[2] << 8) - | ((*xdr)[3] << 0); + *ip = be32dec(*xdr); (*xdr) += 4; return (0); } From owner-svn-src-head@freebsd.org Thu May 30 13:01:47 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3005915C17F7; Thu, 30 May 2019 13:01:47 +0000 (UTC) (envelope-from mw@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id D1598879E2; Thu, 30 May 2019 13:01:46 +0000 (UTC) (envelope-from mw@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id AAD9619620; Thu, 30 May 2019 13:01:46 +0000 (UTC) (envelope-from mw@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x4UD1kGU055055; Thu, 30 May 2019 13:01:46 GMT (envelope-from mw@FreeBSD.org) Received: (from mw@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4UD1kMB055054; Thu, 30 May 2019 13:01:46 GMT (envelope-from mw@FreeBSD.org) Message-Id: <201905301301.x4UD1kMB055054@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mw set sender to mw@FreeBSD.org using -f From: Marcin Wojtas Date: Thu, 30 May 2019 13:01:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r348385 - in head/sys: contrib/ena-com contrib/ena-com/ena_defs dev/ena X-SVN-Group: head X-SVN-Commit-Author: mw X-SVN-Commit-Paths: in head/sys: contrib/ena-com contrib/ena-com/ena_defs dev/ena X-SVN-Commit-Revision: 348385 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: D1598879E2 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.96)[-0.962,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 30 May 2019 13:01:47 -0000 Author: mw Date: Thu May 30 13:01:46 2019 New Revision: 348385 URL: https://svnweb.freebsd.org/changeset/base/348385 Log: Adjust ENA driver to the new ena-com Recent HAL change preparing to support ENAv2 required minor driver modifications. The ena_com_sq_empty_space() is not available in this ena-com, so it had to be replaced with ena_com_free_desc(). Moreover, the ena_com_admin_init() is no longer using 3rd argument indicating if the spin lock should be initialized, so it was removed. Submitted by: Michal Krawczyk Obtained from: Semihalf Sponsored by: Amazon, Inc. Modified: head/sys/contrib/ena-com/ena_com.c head/sys/contrib/ena-com/ena_com.h head/sys/contrib/ena-com/ena_defs/ena_admin_defs.h head/sys/contrib/ena-com/ena_defs/ena_common_defs.h head/sys/contrib/ena-com/ena_defs/ena_eth_io_defs.h head/sys/contrib/ena-com/ena_defs/ena_gen_info.h head/sys/contrib/ena-com/ena_defs/ena_regs_defs.h head/sys/contrib/ena-com/ena_eth_com.c head/sys/contrib/ena-com/ena_eth_com.h head/sys/contrib/ena-com/ena_plat.h head/sys/dev/ena/ena.c Directory Properties: head/sys/contrib/ena-com/ (props changed) Modified: head/sys/contrib/ena-com/ena_com.c ============================================================================== --- head/sys/contrib/ena-com/ena_com.c Thu May 30 12:31:51 2019 (r348384) +++ head/sys/contrib/ena-com/ena_com.c Thu May 30 13:01:46 2019 (r348385) @@ -1,7 +1,7 @@ /*- * BSD LICENSE * - * Copyright (c) 2015-2017 Amazon.com, Inc. or its affiliates. + * Copyright (c) 2015-2019 Amazon.com, Inc. or its affiliates. * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -32,9 +32,6 @@ */ #include "ena_com.h" -#ifdef ENA_INTERNAL -#include "ena_gen_info.h" -#endif /*****************************************************************************/ /*****************************************************************************/ @@ -52,9 +49,6 @@ #define ENA_EXTENDED_STAT_GET_QUEUE(_funct_queue) (_funct_queue >> 16) #endif /* ENA_EXTENDED_STATS */ -#define MIN_ENA_VER (((ENA_COMMON_SPEC_VERSION_MAJOR) << \ - ENA_REGS_VERSION_MAJOR_VERSION_SHIFT) \ - | (ENA_COMMON_SPEC_VERSION_MINOR)) #define ENA_CTRL_MAJOR 0 #define ENA_CTRL_MINOR 0 @@ -76,6 +70,8 @@ #define ENA_REGS_ADMIN_INTR_MASK 1 +#define ENA_POLL_MS 5 + /*****************************************************************************/ /*****************************************************************************/ /*****************************************************************************/ @@ -112,8 +108,8 @@ static inline int ena_com_mem_addr_set(struct ena_com_ return ENA_COM_INVAL; } - ena_addr->mem_addr_low = (u32)addr; - ena_addr->mem_addr_high = (u16)((u64)addr >> 32); + ena_addr->mem_addr_low = lower_32_bits(addr); + ena_addr->mem_addr_high = (u16)upper_32_bits(addr); return 0; } @@ -127,7 +123,7 @@ static int ena_com_admin_init_sq(struct ena_com_admin_ sq->mem_handle); if (!sq->entries) { - ena_trc_err("memory allocation failed"); + ena_trc_err("memory allocation failed\n"); return ENA_COM_NO_MEM; } @@ -149,7 +145,7 @@ static int ena_com_admin_init_cq(struct ena_com_admin_ cq->mem_handle); if (!cq->entries) { - ena_trc_err("memory allocation failed"); + ena_trc_err("memory allocation failed\n"); return ENA_COM_NO_MEM; } @@ -174,7 +170,7 @@ static int ena_com_admin_init_aenq(struct ena_com_dev aenq->mem_handle); if (!aenq->entries) { - ena_trc_err("memory allocation failed"); + ena_trc_err("memory allocation failed\n"); return ENA_COM_NO_MEM; } @@ -249,7 +245,7 @@ static struct ena_comp_ctx *__ena_com_submit_admin_cmd tail_masked = admin_queue->sq.tail & queue_size_mask; /* In case of queue FULL */ - cnt = ATOMIC32_READ(&admin_queue->outstanding_cmds); + cnt = (u16)ATOMIC32_READ(&admin_queue->outstanding_cmds); if (cnt >= admin_queue->q_depth) { ena_trc_dbg("admin queue is full.\n"); admin_queue->stats.out_of_space++; @@ -301,7 +297,7 @@ static inline int ena_com_init_comp_ctxt(struct ena_co queue->comp_ctx = ENA_MEM_ALLOC(queue->q_dmadev, size); if (unlikely(!queue->comp_ctx)) { - ena_trc_err("memory allocation failed"); + ena_trc_err("memory allocation failed\n"); return ENA_COM_NO_MEM; } @@ -320,7 +316,7 @@ static struct ena_comp_ctx *ena_com_submit_admin_cmd(s struct ena_admin_acq_entry *comp, size_t comp_size_in_bytes) { - unsigned long flags; + unsigned long flags = 0; struct ena_comp_ctx *comp_ctx; ENA_SPINLOCK_LOCK(admin_queue->q_lock, flags); @@ -332,7 +328,7 @@ static struct ena_comp_ctx *ena_com_submit_admin_cmd(s cmd_size_in_bytes, comp, comp_size_in_bytes); - if (unlikely(IS_ERR(comp_ctx))) + if (IS_ERR(comp_ctx)) admin_queue->running_state = false; ENA_SPINLOCK_UNLOCK(admin_queue->q_lock, flags); @@ -348,6 +344,7 @@ static int ena_com_init_io_sq(struct ena_com_dev *ena_ memset(&io_sq->desc_addr, 0x0, sizeof(io_sq->desc_addr)); + io_sq->dma_addr_bits = (u8)ena_dev->dma_addr_bits; io_sq->desc_entry_size = (io_sq->direction == ENA_COM_IO_QUEUE_DIRECTION_TX) ? sizeof(struct ena_eth_io_tx_desc) : @@ -373,18 +370,21 @@ static int ena_com_init_io_sq(struct ena_com_dev *ena_ } if (!io_sq->desc_addr.virt_addr) { - ena_trc_err("memory allocation failed"); + ena_trc_err("memory allocation failed\n"); return ENA_COM_NO_MEM; } } if (io_sq->mem_queue_type == ENA_ADMIN_PLACEMENT_POLICY_DEV) { /* Allocate bounce buffers */ - io_sq->bounce_buf_ctrl.buffer_size = ena_dev->llq_info.desc_list_entry_size; - io_sq->bounce_buf_ctrl.buffers_num = ENA_COM_BOUNCE_BUFFER_CNTRL_CNT; + io_sq->bounce_buf_ctrl.buffer_size = + ena_dev->llq_info.desc_list_entry_size; + io_sq->bounce_buf_ctrl.buffers_num = + ENA_COM_BOUNCE_BUFFER_CNTRL_CNT; io_sq->bounce_buf_ctrl.next_to_use = 0; - size = io_sq->bounce_buf_ctrl.buffer_size * io_sq->bounce_buf_ctrl.buffers_num; + size = io_sq->bounce_buf_ctrl.buffer_size * + io_sq->bounce_buf_ctrl.buffers_num; ENA_MEM_ALLOC_NODE(ena_dev->dmadev, size, @@ -395,11 +395,12 @@ static int ena_com_init_io_sq(struct ena_com_dev *ena_ io_sq->bounce_buf_ctrl.base_buffer = ENA_MEM_ALLOC(ena_dev->dmadev, size); if (!io_sq->bounce_buf_ctrl.base_buffer) { - ena_trc_err("bounce buffer memory allocation failed"); + ena_trc_err("bounce buffer memory allocation failed\n"); return ENA_COM_NO_MEM; } - memcpy(&io_sq->llq_info, &ena_dev->llq_info, sizeof(io_sq->llq_info)); + memcpy(&io_sq->llq_info, &ena_dev->llq_info, + sizeof(io_sq->llq_info)); /* Initiate the first bounce buffer */ io_sq->llq_buf_ctrl.curr_bounce_buf = @@ -408,6 +409,10 @@ static int ena_com_init_io_sq(struct ena_com_dev *ena_ 0x0, io_sq->llq_info.desc_list_entry_size); io_sq->llq_buf_ctrl.descs_left_in_line = io_sq->llq_info.descs_num_before_header; + + if (io_sq->llq_info.max_entries_in_tx_burst > 0) + io_sq->entries_in_tx_burst_left = + io_sq->llq_info.max_entries_in_tx_burst; } io_sq->tail = 0; @@ -451,7 +456,7 @@ static int ena_com_init_io_cq(struct ena_com_dev *ena_ } if (!io_cq->cdesc_addr.virt_addr) { - ena_trc_err("memory allocation failed"); + ena_trc_err("memory allocation failed\n"); return ENA_COM_NO_MEM; } @@ -500,12 +505,12 @@ static void ena_com_handle_admin_completion(struct ena cqe = &admin_queue->cq.entries[head_masked]; /* Go over all the completions */ - while ((cqe->acq_common_descriptor.flags & + while ((READ_ONCE8(cqe->acq_common_descriptor.flags) & ENA_ADMIN_ACQ_COMMON_DESC_PHASE_MASK) == phase) { /* Do not read the rest of the completion entry before the * phase bit was validated */ - rmb(); + dma_rmb(); ena_com_handle_single_admin_completion(admin_queue, cqe); head_masked++; @@ -552,7 +557,8 @@ static int ena_com_comp_status_to_errno(u8 comp_status static int ena_com_wait_and_process_admin_cq_polling(struct ena_comp_ctx *comp_ctx, struct ena_com_admin_queue *admin_queue) { - unsigned long flags, timeout; + unsigned long flags = 0; + unsigned long timeout; int ret; timeout = ENA_GET_SYSTEM_TIMEOUT(admin_queue->completion_timeout); @@ -577,7 +583,7 @@ static int ena_com_wait_and_process_admin_cq_polling(s goto err; } - ENA_MSLEEP(100); + ENA_MSLEEP(ENA_POLL_MS); } if (unlikely(comp_ctx->status == ENA_CMD_ABORTED)) { @@ -598,42 +604,113 @@ err: return ret; } +/** + * Set the LLQ configurations of the firmware + * + * The driver provides only the enabled feature values to the device, + * which in turn, checks if they are supported. + */ +static int ena_com_set_llq(struct ena_com_dev *ena_dev) +{ + struct ena_com_admin_queue *admin_queue; + struct ena_admin_set_feat_cmd cmd; + struct ena_admin_set_feat_resp resp; + struct ena_com_llq_info *llq_info = &ena_dev->llq_info; + int ret; + + memset(&cmd, 0x0, sizeof(cmd)); + admin_queue = &ena_dev->admin_queue; + + cmd.aq_common_descriptor.opcode = ENA_ADMIN_SET_FEATURE; + cmd.feat_common.feature_id = ENA_ADMIN_LLQ; + + cmd.u.llq.header_location_ctrl_enabled = llq_info->header_location_ctrl; + cmd.u.llq.entry_size_ctrl_enabled = llq_info->desc_list_entry_size_ctrl; + cmd.u.llq.desc_num_before_header_enabled = llq_info->descs_num_before_header; + cmd.u.llq.descriptors_stride_ctrl_enabled = llq_info->desc_stride_ctrl; + + ret = ena_com_execute_admin_command(admin_queue, + (struct ena_admin_aq_entry *)&cmd, + sizeof(cmd), + (struct ena_admin_acq_entry *)&resp, + sizeof(resp)); + + if (unlikely(ret)) + ena_trc_err("Failed to set LLQ configurations: %d\n", ret); + + return ret; +} + static int ena_com_config_llq_info(struct ena_com_dev *ena_dev, - struct ena_admin_feature_llq_desc *llq_desc) + struct ena_admin_feature_llq_desc *llq_features, + struct ena_llq_configurations *llq_default_cfg) { struct ena_com_llq_info *llq_info = &ena_dev->llq_info; + u16 supported_feat; + int rc; memset(llq_info, 0, sizeof(*llq_info)); - switch (llq_desc->header_location_ctrl) { - case ENA_ADMIN_INLINE_HEADER: - llq_info->inline_header = true; - break; - case ENA_ADMIN_HEADER_RING: - llq_info->inline_header = false; - break; - default: - ena_trc_err("Invalid header location control\n"); + supported_feat = llq_features->header_location_ctrl_supported; + + if (likely(supported_feat & llq_default_cfg->llq_header_location)) { + llq_info->header_location_ctrl = + llq_default_cfg->llq_header_location; + } else { + ena_trc_err("Invalid header location control, supported: 0x%x\n", + supported_feat); return -EINVAL; } - switch (llq_desc->entry_size_ctrl) { - case ENA_ADMIN_LIST_ENTRY_SIZE_128B: - llq_info->desc_list_entry_size = 128; - break; - case ENA_ADMIN_LIST_ENTRY_SIZE_192B: - llq_info->desc_list_entry_size = 192; - break; - case ENA_ADMIN_LIST_ENTRY_SIZE_256B: - llq_info->desc_list_entry_size = 256; - break; - default: - ena_trc_err("Invalid entry_size_ctrl %d\n", - llq_desc->entry_size_ctrl); - return -EINVAL; + if (likely(llq_info->header_location_ctrl == ENA_ADMIN_INLINE_HEADER)) { + supported_feat = llq_features->descriptors_stride_ctrl_supported; + if (likely(supported_feat & llq_default_cfg->llq_stride_ctrl)) { + llq_info->desc_stride_ctrl = llq_default_cfg->llq_stride_ctrl; + } else { + if (supported_feat & ENA_ADMIN_MULTIPLE_DESCS_PER_ENTRY) { + llq_info->desc_stride_ctrl = ENA_ADMIN_MULTIPLE_DESCS_PER_ENTRY; + } else if (supported_feat & ENA_ADMIN_SINGLE_DESC_PER_ENTRY) { + llq_info->desc_stride_ctrl = ENA_ADMIN_SINGLE_DESC_PER_ENTRY; + } else { + ena_trc_err("Invalid desc_stride_ctrl, supported: 0x%x\n", + supported_feat); + return -EINVAL; + } + + ena_trc_err("Default llq stride ctrl is not supported, performing fallback, default: 0x%x, supported: 0x%x, used: 0x%x\n", + llq_default_cfg->llq_stride_ctrl, + supported_feat, + llq_info->desc_stride_ctrl); + } + } else { + llq_info->desc_stride_ctrl = 0; } - if ((llq_info->desc_list_entry_size & 0x7)) { + supported_feat = llq_features->entry_size_ctrl_supported; + if (likely(supported_feat & llq_default_cfg->llq_ring_entry_size)) { + llq_info->desc_list_entry_size_ctrl = llq_default_cfg->llq_ring_entry_size; + llq_info->desc_list_entry_size = llq_default_cfg->llq_ring_entry_size_value; + } else { + if (supported_feat & ENA_ADMIN_LIST_ENTRY_SIZE_128B) { + llq_info->desc_list_entry_size_ctrl = ENA_ADMIN_LIST_ENTRY_SIZE_128B; + llq_info->desc_list_entry_size = 128; + } else if (supported_feat & ENA_ADMIN_LIST_ENTRY_SIZE_192B) { + llq_info->desc_list_entry_size_ctrl = ENA_ADMIN_LIST_ENTRY_SIZE_192B; + llq_info->desc_list_entry_size = 192; + } else if (supported_feat & ENA_ADMIN_LIST_ENTRY_SIZE_256B) { + llq_info->desc_list_entry_size_ctrl = ENA_ADMIN_LIST_ENTRY_SIZE_256B; + llq_info->desc_list_entry_size = 256; + } else { + ena_trc_err("Invalid entry_size_ctrl, supported: 0x%x\n", supported_feat); + return -EINVAL; + } + + ena_trc_err("Default llq ring entry size is not supported, performing fallback, default: 0x%x, supported: 0x%x, used: 0x%x\n", + llq_default_cfg->llq_ring_entry_size, + supported_feat, + llq_info->desc_list_entry_size); + } + if (unlikely(llq_info->desc_list_entry_size & 0x7)) { /* The desc list entry size should be whole multiply of 8 * This requirement comes from __iowrite64_copy() */ @@ -642,35 +719,50 @@ static int ena_com_config_llq_info(struct ena_com_dev return -EINVAL; } - if (llq_info->inline_header) { - llq_info->desc_stride_ctrl = llq_desc->descriptors_stride_ctrl; - if ((llq_info->desc_stride_ctrl != ENA_ADMIN_SINGLE_DESC_PER_ENTRY) && - (llq_info->desc_stride_ctrl != ENA_ADMIN_MULTIPLE_DESCS_PER_ENTRY)) { - ena_trc_err("Invalid desc_stride_ctrl %d\n", - llq_info->desc_stride_ctrl); - return -EINVAL; - } - } else { - llq_info->desc_stride_ctrl = ENA_ADMIN_SINGLE_DESC_PER_ENTRY; - } - - if (llq_info->desc_stride_ctrl == ENA_ADMIN_SINGLE_DESC_PER_ENTRY) + if (llq_info->desc_stride_ctrl == ENA_ADMIN_MULTIPLE_DESCS_PER_ENTRY) llq_info->descs_per_entry = llq_info->desc_list_entry_size / sizeof(struct ena_eth_io_tx_desc); else llq_info->descs_per_entry = 1; - llq_info->descs_num_before_header = llq_desc->desc_num_before_header_ctrl; + supported_feat = llq_features->desc_num_before_header_supported; + if (likely(supported_feat & llq_default_cfg->llq_num_decs_before_header)) { + llq_info->descs_num_before_header = llq_default_cfg->llq_num_decs_before_header; + } else { + if (supported_feat & ENA_ADMIN_LLQ_NUM_DESCS_BEFORE_HEADER_2) { + llq_info->descs_num_before_header = ENA_ADMIN_LLQ_NUM_DESCS_BEFORE_HEADER_2; + } else if (supported_feat & ENA_ADMIN_LLQ_NUM_DESCS_BEFORE_HEADER_1) { + llq_info->descs_num_before_header = ENA_ADMIN_LLQ_NUM_DESCS_BEFORE_HEADER_1; + } else if (supported_feat & ENA_ADMIN_LLQ_NUM_DESCS_BEFORE_HEADER_4) { + llq_info->descs_num_before_header = ENA_ADMIN_LLQ_NUM_DESCS_BEFORE_HEADER_4; + } else if (supported_feat & ENA_ADMIN_LLQ_NUM_DESCS_BEFORE_HEADER_8) { + llq_info->descs_num_before_header = ENA_ADMIN_LLQ_NUM_DESCS_BEFORE_HEADER_8; + } else { + ena_trc_err("Invalid descs_num_before_header, supported: 0x%x\n", + supported_feat); + return -EINVAL; + } - return 0; -} + ena_trc_err("Default llq num descs before header is not supported, performing fallback, default: 0x%x, supported: 0x%x, used: 0x%x\n", + llq_default_cfg->llq_num_decs_before_header, + supported_feat, + llq_info->descs_num_before_header); + } + llq_info->max_entries_in_tx_burst = + (u16)(llq_features->max_tx_burst_size / llq_default_cfg->llq_ring_entry_size_value); + rc = ena_com_set_llq(ena_dev); + if (rc) + ena_trc_err("Cannot set LLQ configuration: %d\n", rc); + return 0; +} + static int ena_com_wait_and_process_admin_cq_interrupts(struct ena_comp_ctx *comp_ctx, struct ena_com_admin_queue *admin_queue) { - unsigned long flags; + unsigned long flags = 0; int ret; ENA_WAIT_EVENT_WAIT(comp_ctx->wait_event, @@ -715,7 +807,7 @@ static u32 ena_com_reg_bar_read32(struct ena_com_dev * volatile struct ena_admin_ena_mmio_req_read_less_resp *read_resp = mmio_read->read_resp; u32 mmio_read_reg, ret, i; - unsigned long flags; + unsigned long flags = 0; u32 timeout = mmio_read->reg_read_to; ENA_MIGHT_SLEEP(); @@ -736,15 +828,11 @@ static u32 ena_com_reg_bar_read32(struct ena_com_dev * mmio_read_reg |= mmio_read->seq_num & ENA_REGS_MMIO_REG_READ_REQ_ID_MASK; - /* make sure read_resp->req_id get updated before the hw can write - * there - */ - wmb(); + ENA_REG_WRITE32(ena_dev->bus, mmio_read_reg, + ena_dev->reg_bar + ENA_REGS_MMIO_REG_READ_OFF); - ENA_REG_WRITE32(ena_dev->bus, mmio_read_reg, ena_dev->reg_bar + ENA_REGS_MMIO_REG_READ_OFF); - for (i = 0; i < timeout; i++) { - if (read_resp->req_id == mmio_read->seq_num) + if (READ_ONCE16(read_resp->req_id) == mmio_read->seq_num) break; ENA_UDELAY(1); @@ -761,7 +849,7 @@ static u32 ena_com_reg_bar_read32(struct ena_com_dev * } if (read_resp->reg_off != offset) { - ena_trc_err("Read failure: wrong offset provided"); + ena_trc_err("Read failure: wrong offset provided\n"); ret = ENA_MMIO_READ_TIMEOUT; } else { ret = read_resp->reg_val; @@ -856,7 +944,6 @@ static void ena_com_io_queue_free(struct ena_com_dev * } if (io_sq->bounce_buf_ctrl.base_buffer) { - size = io_sq->llq_info.desc_list_entry_size * ENA_COM_BOUNCE_BUFFER_CNTRL_CNT; ENA_MEM_FREE(ena_dev->dmadev, io_sq->bounce_buf_ctrl.base_buffer); io_sq->bounce_buf_ctrl.base_buffer = NULL; } @@ -867,6 +954,9 @@ static int wait_for_reset_state(struct ena_com_dev *en { u32 val, i; + /* Convert timeout from resolution of 100ms to ENA_POLL_MS */ + timeout = (timeout * 100) / ENA_POLL_MS; + for (i = 0; i < timeout; i++) { val = ena_com_reg_bar_read32(ena_dev, ENA_REGS_DEV_STS_OFF); @@ -879,8 +969,7 @@ static int wait_for_reset_state(struct ena_com_dev *en exp_state) return 0; - /* The resolution of the timeout is 100ms */ - ENA_MSLEEP(100); + ENA_MSLEEP(ENA_POLL_MS); } return ENA_COM_TIMER_EXPIRED; @@ -903,7 +992,8 @@ static int ena_com_get_feature_ex(struct ena_com_dev * struct ena_admin_get_feat_resp *get_resp, enum ena_admin_aq_feature_id feature_id, dma_addr_t control_buf_dma_addr, - u32 control_buff_size) + u32 control_buff_size, + u8 feature_ver) { struct ena_com_admin_queue *admin_queue; struct ena_admin_get_feat_cmd get_cmd; @@ -934,7 +1024,7 @@ static int ena_com_get_feature_ex(struct ena_com_dev * } get_cmd.control_buffer.length = control_buff_size; - + get_cmd.feat_common.feature_version = feature_ver; get_cmd.feat_common.feature_id = feature_id; ret = ena_com_execute_admin_command(admin_queue, @@ -954,13 +1044,15 @@ static int ena_com_get_feature_ex(struct ena_com_dev * static int ena_com_get_feature(struct ena_com_dev *ena_dev, struct ena_admin_get_feat_resp *get_resp, - enum ena_admin_aq_feature_id feature_id) + enum ena_admin_aq_feature_id feature_id, + u8 feature_ver) { return ena_com_get_feature_ex(ena_dev, get_resp, feature_id, 0, - 0); + 0, + feature_ver); } static int ena_com_hash_key_allocate(struct ena_com_dev *ena_dev) @@ -1030,7 +1122,7 @@ static int ena_com_indirect_table_allocate(struct ena_ int ret; ret = ena_com_get_feature(ena_dev, &get_resp, - ENA_ADMIN_RSS_REDIRECTION_TABLE_CONFIG); + ENA_ADMIN_RSS_REDIRECTION_TABLE_CONFIG, 0); if (unlikely(ret)) return ret; @@ -1269,7 +1361,7 @@ int ena_com_execute_admin_command(struct ena_com_admin comp_ctx = ena_com_submit_admin_cmd(admin_queue, cmd, cmd_size, comp, comp_size); - if (unlikely(IS_ERR(comp_ctx))) { + if (IS_ERR(comp_ctx)) { if (comp_ctx == ERR_PTR(ENA_COM_NO_DEVICE)) ena_trc_dbg("Failed to submit command [%ld]\n", PTR_ERR(comp_ctx)); @@ -1389,12 +1481,12 @@ void ena_com_abort_admin_commands(struct ena_com_dev * void ena_com_wait_for_abort_completion(struct ena_com_dev *ena_dev) { struct ena_com_admin_queue *admin_queue = &ena_dev->admin_queue; - unsigned long flags; + unsigned long flags = 0; ENA_SPINLOCK_LOCK(admin_queue->q_lock, flags); while (ATOMIC32_READ(&admin_queue->outstanding_cmds) != 0) { ENA_SPINLOCK_UNLOCK(admin_queue->q_lock, flags); - ENA_MSLEEP(20); + ENA_MSLEEP(ENA_POLL_MS); ENA_SPINLOCK_LOCK(admin_queue->q_lock, flags); } ENA_SPINLOCK_UNLOCK(admin_queue->q_lock, flags); @@ -1433,7 +1525,7 @@ bool ena_com_get_admin_running_state(struct ena_com_de void ena_com_set_admin_running_state(struct ena_com_dev *ena_dev, bool state) { struct ena_com_admin_queue *admin_queue = &ena_dev->admin_queue; - unsigned long flags; + unsigned long flags = 0; ENA_SPINLOCK_LOCK(admin_queue->q_lock, flags); ena_dev->admin_queue.running_state = state; @@ -1460,14 +1552,14 @@ int ena_com_set_aenq_config(struct ena_com_dev *ena_de struct ena_admin_get_feat_resp get_resp; int ret; - ret = ena_com_get_feature(ena_dev, &get_resp, ENA_ADMIN_AENQ_CONFIG); + ret = ena_com_get_feature(ena_dev, &get_resp, ENA_ADMIN_AENQ_CONFIG, 0); if (ret) { ena_trc_info("Can't get aenq configuration\n"); return ret; } if ((get_resp.u.aenq.supported_groups & groups_flag) != groups_flag) { - ena_trc_warn("Trying to set unsupported aenq events. supported flag: %x asked flag: %x\n", + ena_trc_warn("Trying to set unsupported aenq events. supported flag: 0x%x asked flag: 0x%x\n", get_resp.u.aenq.supported_groups, groups_flag); return ENA_COM_UNSUPPORTED; @@ -1542,11 +1634,6 @@ int ena_com_validate_version(struct ena_com_dev *ena_d ENA_REGS_VERSION_MAJOR_VERSION_SHIFT, ver & ENA_REGS_VERSION_MINOR_VERSION_MASK); - if (ver < MIN_ENA_VER) { - ena_trc_err("ENA version is lower than the minimal version the driver supports\n"); - return -1; - } - ena_trc_info("ena controller version: %d.%d.%d implementation version %d\n", (ctrl_ver & ENA_REGS_CONTROLLER_VERSION_MAJOR_VERSION_MASK) >> ENA_REGS_CONTROLLER_VERSION_MAJOR_VERSION_SHIFT, @@ -1579,9 +1666,6 @@ void ena_com_admin_destroy(struct ena_com_dev *ena_dev u16 size; ENA_WAIT_EVENT_DESTROY(admin_queue->comp_ctx->wait_event); - - ENA_SPINLOCK_DESTROY(admin_queue->q_lock); - if (admin_queue->comp_ctx) ENA_MEM_FREE(ena_dev->dmadev, admin_queue->comp_ctx); admin_queue->comp_ctx = NULL; @@ -1602,6 +1686,7 @@ void ena_com_admin_destroy(struct ena_com_dev *ena_dev ENA_MEM_FREE_COHERENT(ena_dev->dmadev, size, aenq->entries, aenq->dma_addr, aenq->mem_handle); aenq->entries = NULL; + ENA_SPINLOCK_DESTROY(admin_queue->q_lock); } void ena_com_set_admin_polling_mode(struct ena_com_dev *ena_dev, bool polling) @@ -1611,7 +1696,8 @@ void ena_com_set_admin_polling_mode(struct ena_com_dev if (polling) mask_value = ENA_REGS_ADMIN_INTR_MASK; - ENA_REG_WRITE32(ena_dev->bus, mask_value, ena_dev->reg_bar + ENA_REGS_INTR_MASK_OFF); + ENA_REG_WRITE32(ena_dev->bus, mask_value, + ena_dev->reg_bar + ENA_REGS_INTR_MASK_OFF); ena_dev->admin_queue.polling = polling; } @@ -1626,7 +1712,7 @@ int ena_com_mmio_reg_read_request_init(struct ena_com_ mmio_read->read_resp_dma_addr, mmio_read->read_resp_mem_handle); if (unlikely(!mmio_read->read_resp)) - return ENA_COM_NO_MEM; + goto err; ena_com_mmio_reg_read_request_write_dev_addr(ena_dev); @@ -1635,6 +1721,10 @@ int ena_com_mmio_reg_read_request_init(struct ena_com_ mmio_read->readless_supported = true; return 0; + +err: + ENA_SPINLOCK_DESTROY(mmio_read->lock); + return ENA_COM_NO_MEM; } void ena_com_set_mmio_read_mode(struct ena_com_dev *ena_dev, bool readless_supported) @@ -1658,7 +1748,6 @@ void ena_com_mmio_reg_read_request_destroy(struct ena_ mmio_read->read_resp_mem_handle); mmio_read->read_resp = NULL; - ENA_SPINLOCK_DESTROY(mmio_read->lock); } @@ -1675,17 +1764,12 @@ void ena_com_mmio_reg_read_request_write_dev_addr(stru } int ena_com_admin_init(struct ena_com_dev *ena_dev, - struct ena_aenq_handlers *aenq_handlers, - bool init_spinlock) + struct ena_aenq_handlers *aenq_handlers) { struct ena_com_admin_queue *admin_queue = &ena_dev->admin_queue; u32 aq_caps, acq_caps, dev_sts, addr_low, addr_high; int ret; -#ifdef ENA_INTERNAL - ena_trc_info("ena_defs : Version:[%s] Build date [%s]", - ENA_GEN_COMMIT, ENA_GEN_DATE); -#endif dev_sts = ena_com_reg_bar_read32(ena_dev, ENA_REGS_DEV_STS_OFF); if (unlikely(dev_sts == ENA_MMIO_READ_TIMEOUT)) { @@ -1707,8 +1791,7 @@ int ena_com_admin_init(struct ena_com_dev *ena_dev, ATOMIC32_SET(&admin_queue->outstanding_cmds, 0); - if (init_spinlock) - ENA_SPINLOCK_INIT(admin_queue->q_lock); + ENA_SPINLOCK_INIT(admin_queue->q_lock); ret = ena_com_init_comp_ctxt(admin_queue); if (ret) @@ -1848,9 +1931,65 @@ void ena_com_destroy_io_queue(struct ena_com_dev *ena_ int ena_com_get_link_params(struct ena_com_dev *ena_dev, struct ena_admin_get_feat_resp *resp) { - return ena_com_get_feature(ena_dev, resp, ENA_ADMIN_LINK_CONFIG); + return ena_com_get_feature(ena_dev, resp, ENA_ADMIN_LINK_CONFIG, 0); } +int ena_com_extra_properties_strings_init(struct ena_com_dev *ena_dev) +{ + struct ena_admin_get_feat_resp resp; + struct ena_extra_properties_strings *extra_properties_strings = + &ena_dev->extra_properties_strings; + u32 rc; + extra_properties_strings->size = ENA_ADMIN_EXTRA_PROPERTIES_COUNT * + ENA_ADMIN_EXTRA_PROPERTIES_STRING_LEN; + + ENA_MEM_ALLOC_COHERENT(ena_dev->dmadev, + extra_properties_strings->size, + extra_properties_strings->virt_addr, + extra_properties_strings->dma_addr, + extra_properties_strings->dma_handle); + if (unlikely(!extra_properties_strings->virt_addr)) { + ena_trc_err("Failed to allocate extra properties strings\n"); + return 0; + } + + rc = ena_com_get_feature_ex(ena_dev, &resp, + ENA_ADMIN_EXTRA_PROPERTIES_STRINGS, + extra_properties_strings->dma_addr, + extra_properties_strings->size, 0); + if (rc) { + ena_trc_dbg("Failed to get extra properties strings\n"); + goto err; + } + + return resp.u.extra_properties_strings.count; +err: + ena_com_delete_extra_properties_strings(ena_dev); + return 0; +} + +void ena_com_delete_extra_properties_strings(struct ena_com_dev *ena_dev) +{ + struct ena_extra_properties_strings *extra_properties_strings = + &ena_dev->extra_properties_strings; + + if (extra_properties_strings->virt_addr) { + ENA_MEM_FREE_COHERENT(ena_dev->dmadev, + extra_properties_strings->size, + extra_properties_strings->virt_addr, + extra_properties_strings->dma_addr, + extra_properties_strings->dma_handle); + extra_properties_strings->virt_addr = NULL; + } +} + +int ena_com_get_extra_properties_flags(struct ena_com_dev *ena_dev, + struct ena_admin_get_feat_resp *resp) +{ + return ena_com_get_feature(ena_dev, resp, + ENA_ADMIN_EXTRA_PROPERTIES_FLAGS, 0); +} + int ena_com_get_dev_attr_feat(struct ena_com_dev *ena_dev, struct ena_com_dev_get_features_ctx *get_feat_ctx) { @@ -1858,7 +1997,7 @@ int ena_com_get_dev_attr_feat(struct ena_com_dev *ena_ int rc; rc = ena_com_get_feature(ena_dev, &get_resp, - ENA_ADMIN_DEVICE_ATTRIBUTES); + ENA_ADMIN_DEVICE_ATTRIBUTES, 0); if (rc) return rc; @@ -1866,17 +2005,34 @@ int ena_com_get_dev_attr_feat(struct ena_com_dev *ena_ sizeof(get_resp.u.dev_attr)); ena_dev->supported_features = get_resp.u.dev_attr.supported_features; - rc = ena_com_get_feature(ena_dev, &get_resp, - ENA_ADMIN_MAX_QUEUES_NUM); - if (rc) - return rc; + if (ena_dev->supported_features & BIT(ENA_ADMIN_MAX_QUEUES_EXT)) { + rc = ena_com_get_feature(ena_dev, &get_resp, + ENA_ADMIN_MAX_QUEUES_EXT, + ENA_FEATURE_MAX_QUEUE_EXT_VER); + if (rc) + return rc; - memcpy(&get_feat_ctx->max_queues, &get_resp.u.max_queue, - sizeof(get_resp.u.max_queue)); - ena_dev->tx_max_header_size = get_resp.u.max_queue.max_header_size; + if (get_resp.u.max_queue_ext.version != ENA_FEATURE_MAX_QUEUE_EXT_VER) + return -EINVAL; + memcpy(&get_feat_ctx->max_queue_ext, &get_resp.u.max_queue_ext, + sizeof(get_resp.u.max_queue_ext)); + ena_dev->tx_max_header_size = + get_resp.u.max_queue_ext.max_queue_ext.max_tx_header_size; + } else { + rc = ena_com_get_feature(ena_dev, &get_resp, + ENA_ADMIN_MAX_QUEUES_NUM, 0); + memcpy(&get_feat_ctx->max_queues, &get_resp.u.max_queue, + sizeof(get_resp.u.max_queue)); + ena_dev->tx_max_header_size = + get_resp.u.max_queue.max_header_size; + + if (rc) + return rc; + } + rc = ena_com_get_feature(ena_dev, &get_resp, - ENA_ADMIN_AENQ_CONFIG); + ENA_ADMIN_AENQ_CONFIG, 0); if (rc) return rc; @@ -1884,7 +2040,7 @@ int ena_com_get_dev_attr_feat(struct ena_com_dev *ena_ sizeof(get_resp.u.aenq)); rc = ena_com_get_feature(ena_dev, &get_resp, - ENA_ADMIN_STATELESS_OFFLOAD_CONFIG); + ENA_ADMIN_STATELESS_OFFLOAD_CONFIG, 0); if (rc) return rc; @@ -1894,7 +2050,7 @@ int ena_com_get_dev_attr_feat(struct ena_com_dev *ena_ /* Driver hints isn't mandatory admin command. So in case the * command isn't supported set driver hints to 0 */ - rc = ena_com_get_feature(ena_dev, &get_resp, ENA_ADMIN_HW_HINTS); + rc = ena_com_get_feature(ena_dev, &get_resp, ENA_ADMIN_HW_HINTS, 0); if (!rc) memcpy(&get_feat_ctx->hw_hints, &get_resp.u.hw_hints, @@ -1904,7 +2060,7 @@ int ena_com_get_dev_attr_feat(struct ena_com_dev *ena_ else return rc; - rc = ena_com_get_feature(ena_dev, &get_resp, ENA_ADMIN_LLQ); + rc = ena_com_get_feature(ena_dev, &get_resp, ENA_ADMIN_LLQ, 0); if (!rc) memcpy(&get_feat_ctx->llq, &get_resp.u.llq, sizeof(get_resp.u.llq)); @@ -1913,6 +2069,17 @@ int ena_com_get_dev_attr_feat(struct ena_com_dev *ena_ else return rc; + rc = ena_com_get_feature(ena_dev, &get_resp, + ENA_ADMIN_RSS_REDIRECTION_TABLE_CONFIG, 0); + if (!rc) + memcpy(&get_feat_ctx->ind_table, &get_resp.u.ind_table, + sizeof(get_resp.u.ind_table)); + else if (rc == ENA_COM_UNSUPPORTED) + memset(&get_feat_ctx->ind_table, 0x0, + sizeof(get_feat_ctx->ind_table)); + else + return rc; + return 0; } @@ -1944,8 +2111,8 @@ void ena_com_aenq_intr_handler(struct ena_com_dev *dev struct ena_admin_aenq_entry *aenq_e; struct ena_admin_aenq_common_desc *aenq_common; struct ena_com_aenq *aenq = &dev->aenq; - ena_aenq_handler handler_cb; unsigned long long timestamp; + ena_aenq_handler handler_cb; u16 masked_head, processed = 0; u8 phase; @@ -1955,8 +2122,13 @@ void ena_com_aenq_intr_handler(struct ena_com_dev *dev aenq_common = &aenq_e->aenq_common_desc; /* Go over all the events */ - while ((aenq_common->flags & ENA_ADMIN_AENQ_COMMON_DESC_PHASE_MASK) == - phase) { + while ((READ_ONCE8(aenq_common->flags) & + ENA_ADMIN_AENQ_COMMON_DESC_PHASE_MASK) == phase) { + /* Make sure the phase bit (ownership) is as expected before + * reading the rest of the descriptor. + */ + dma_rmb(); + timestamp = (unsigned long long)aenq_common->timestamp_low | ((unsigned long long)aenq_common->timestamp_high << 32); ena_trc_dbg("AENQ! Group[%x] Syndrom[%x] timestamp: [%llus]\n", @@ -1990,7 +2162,9 @@ void ena_com_aenq_intr_handler(struct ena_com_dev *dev /* write the aenq doorbell after all AENQ descriptors were read */ mb(); - ENA_REG_WRITE32(dev->bus, (u32)aenq->head, dev->reg_bar + ENA_REGS_AENQ_HEAD_DB_OFF); + ENA_REG_WRITE32_RELAXED(dev->bus, (u32)aenq->head, + dev->reg_bar + ENA_REGS_AENQ_HEAD_DB_OFF); + mmiowb(); } #ifdef ENA_EXTENDED_STATS /* @@ -2141,7 +2315,7 @@ int ena_com_get_dev_extended_stats(struct ena_com_dev phys_addr); if (unlikely(ret)) { ena_trc_err("memory address set failed\n"); - return ret; + goto free_ext_stats_mem; } get_cmd->u.control_buffer.length = len; @@ -2202,7 +2376,7 @@ int ena_com_get_offload_settings(struct ena_com_dev *e struct ena_admin_get_feat_resp resp; ret = ena_com_get_feature(ena_dev, &resp, - ENA_ADMIN_STATELESS_OFFLOAD_CONFIG); + ENA_ADMIN_STATELESS_OFFLOAD_CONFIG, 0); if (unlikely(ret)) { ena_trc_err("Failed to get offload capabilities %d\n", ret); return ret; @@ -2231,11 +2405,11 @@ int ena_com_set_hash_function(struct ena_com_dev *ena_ /* Validate hash function is supported */ ret = ena_com_get_feature(ena_dev, &get_resp, - ENA_ADMIN_RSS_HASH_FUNCTION); + ENA_ADMIN_RSS_HASH_FUNCTION, 0); if (unlikely(ret)) return ret; - if (get_resp.u.flow_hash_func.supported_func & (1 << rss->hash_func)) { + if (!(get_resp.u.flow_hash_func.supported_func & BIT(rss->hash_func))) { ena_trc_err("Func hash %d isn't supported by device, abort\n", rss->hash_func); return ENA_COM_UNSUPPORTED; @@ -2291,7 +2465,7 @@ int ena_com_fill_hash_function(struct ena_com_dev *ena rc = ena_com_get_feature_ex(ena_dev, &get_resp, ENA_ADMIN_RSS_HASH_FUNCTION, rss->hash_key_dma_addr, - sizeof(*rss->hash_key)); + sizeof(*rss->hash_key), 0); if (unlikely(rc)) return rc; @@ -2320,6 +2494,7 @@ int ena_com_fill_hash_function(struct ena_com_dev *ena return ENA_COM_INVAL; } + rss->hash_func = func; rc = ena_com_set_hash_function(ena_dev); /* Restore the old function */ @@ -2342,7 +2517,7 @@ int ena_com_get_hash_function(struct ena_com_dev *ena_ rc = ena_com_get_feature_ex(ena_dev, &get_resp, ENA_ADMIN_RSS_HASH_FUNCTION, rss->hash_key_dma_addr, - sizeof(*rss->hash_key)); + sizeof(*rss->hash_key), 0); if (unlikely(rc)) return rc; @@ -2367,7 +2542,7 @@ int ena_com_get_hash_ctrl(struct ena_com_dev *ena_dev, rc = ena_com_get_feature_ex(ena_dev, &get_resp, ENA_ADMIN_RSS_HASH_INPUT, rss->hash_ctrl_dma_addr, - sizeof(*rss->hash_ctrl)); + sizeof(*rss->hash_ctrl), 0); if (unlikely(rc)) return rc; @@ -2603,7 +2778,7 @@ int ena_com_indirect_table_get(struct ena_com_dev *ena rc = ena_com_get_feature_ex(ena_dev, &get_resp, ENA_ADMIN_RSS_REDIRECTION_TABLE_CONFIG, rss->rss_ind_tbl_dma_addr, - tbl_size); + tbl_size, 0); if (unlikely(rc)) return rc; @@ -2670,6 +2845,10 @@ int ena_com_allocate_host_info(struct ena_com_dev *ena if (unlikely(!host_attr->host_info)) return ENA_COM_NO_MEM; + host_attr->host_info->ena_spec_version = ((ENA_COMMON_SPEC_VERSION_MAJOR << + ENA_REGS_VERSION_MAJOR_VERSION_SHIFT) | + (ENA_COMMON_SPEC_VERSION_MINOR)); + return 0; } @@ -2822,7 +3001,7 @@ int ena_com_init_interrupt_moderation(struct ena_com_d int rc; rc = ena_com_get_feature(ena_dev, &get_resp, - ENA_ADMIN_INTERRUPT_MODERATION); + ENA_ADMIN_INTERRUPT_MODERATION, 0); if (rc) { if (rc == ENA_COM_UNSUPPORTED) { @@ -2950,17 +3129,18 @@ void ena_com_get_intr_moderation_entry(struct ena_com_ } int ena_com_config_dev_mode(struct ena_com_dev *ena_dev, - struct ena_admin_feature_llq_desc *llq) + struct ena_admin_feature_llq_desc *llq_features, + struct ena_llq_configurations *llq_default_cfg) { int rc; int size; - if (llq->max_llq_num == 0) { + if (!llq_features->max_llq_num) { ena_dev->tx_mem_queue_type = ENA_ADMIN_PLACEMENT_POLICY_HOST; return 0; } - rc = ena_com_config_llq_info(ena_dev, llq); + rc = ena_com_config_llq_info(ena_dev, llq_features, llq_default_cfg); if (rc) return rc; *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@freebsd.org Thu May 30 13:06:08 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6E1F215C1ADC; Thu, 30 May 2019 13:06:08 +0000 (UTC) (envelope-from mw@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 098B087D76; Thu, 30 May 2019 13:06:08 +0000 (UTC) (envelope-from mw@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 98F0F1977E; Thu, 30 May 2019 13:06:07 +0000 (UTC) (envelope-from mw@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x4UD67ov055312; Thu, 30 May 2019 13:06:07 GMT (envelope-from mw@FreeBSD.org) Received: (from mw@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4UD67AG055311; Thu, 30 May 2019 13:06:07 GMT (envelope-from mw@FreeBSD.org) Message-Id: <201905301306.x4UD67AG055311@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mw set sender to mw@FreeBSD.org using -f From: Marcin Wojtas Date: Thu, 30 May 2019 13:06:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r348386 - head/sys/dev/ena X-SVN-Group: head X-SVN-Commit-Author: mw X-SVN-Commit-Paths: head/sys/dev/ena X-SVN-Commit-Revision: 348386 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 098B087D76 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.96)[-0.960,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 30 May 2019 13:06:08 -0000 Author: mw Date: Thu May 30 13:06:07 2019 New Revision: 348386 URL: https://svnweb.freebsd.org/changeset/base/348386 Log: Do not specify active media type in ENA As the ENA is working only in virtualized environment, the active media is not specified. Instead, the active link type is set as unknown. Submitted by: Michal Krawczyk Obtained from: Semihalf Sponsored by: Amazon, Inc. Modified: head/sys/dev/ena/ena.c Modified: head/sys/dev/ena/ena.c ============================================================================== --- head/sys/dev/ena/ena.c Thu May 30 13:01:46 2019 (r348385) +++ head/sys/dev/ena/ena.c Thu May 30 13:06:07 2019 (r348386) @@ -2336,7 +2336,7 @@ ena_media_status(if_t ifp, struct ifmediareq *ifmr) } ifmr->ifm_status |= IFM_ACTIVE; - ifmr->ifm_active |= IFM_10G_T | IFM_FDX; + ifmr->ifm_active |= IFM_UNKNOWN | IFM_FDX; mtx_unlock(&adapter->global_mtx); } From owner-svn-src-head@freebsd.org Thu May 30 13:08:01 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2671215C1B96; Thu, 30 May 2019 13:08:01 +0000 (UTC) (envelope-from mw@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id B84B987EED; Thu, 30 May 2019 13:08:00 +0000 (UTC) (envelope-from mw@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 9249A19782; Thu, 30 May 2019 13:08:00 +0000 (UTC) (envelope-from mw@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x4UD802X055424; Thu, 30 May 2019 13:08:00 GMT (envelope-from mw@FreeBSD.org) Received: (from mw@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4UD80gV055423; Thu, 30 May 2019 13:08:00 GMT (envelope-from mw@FreeBSD.org) Message-Id: <201905301308.x4UD80gV055423@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mw set sender to mw@FreeBSD.org using -f From: Marcin Wojtas Date: Thu, 30 May 2019 13:08:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r348387 - head/sys/dev/ena X-SVN-Group: head X-SVN-Commit-Author: mw X-SVN-Commit-Paths: head/sys/dev/ena X-SVN-Commit-Revision: 348387 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: B84B987EED X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.96)[-0.960,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 30 May 2019 13:08:01 -0000 Author: mw Date: Thu May 30 13:08:00 2019 New Revision: 348387 URL: https://svnweb.freebsd.org/changeset/base/348387 Log: Print information when ENA admin error occurs ENA_ADMIN_FATAL_ERROR and ENA_ADMIN_WARNING aenq groups were indicated as supported, so the unimplemented_aenq_handler() will print out error message, whenever an error will occur within the ENA admin context. Submitted by: Michal Krawczyk Obtained from: Semihalf Sponsored by: Amazon, Inc. Modified: head/sys/dev/ena/ena.c Modified: head/sys/dev/ena/ena.c ============================================================================== --- head/sys/dev/ena/ena.c Thu May 30 13:06:07 2019 (r348386) +++ head/sys/dev/ena/ena.c Thu May 30 13:08:00 2019 (r348387) @@ -3254,7 +3254,10 @@ ena_device_init(struct ena_adapter *adapter, device_t goto err_admin_init; } - aenq_groups = BIT(ENA_ADMIN_LINK_CHANGE) | BIT(ENA_ADMIN_KEEP_ALIVE); + aenq_groups = BIT(ENA_ADMIN_LINK_CHANGE) | + BIT(ENA_ADMIN_FATAL_ERROR) | + BIT(ENA_ADMIN_WARNING) | + BIT(ENA_ADMIN_KEEP_ALIVE); aenq_groups &= get_feat_ctx->aenq.supported_groups; rc = ena_com_set_aenq_config(ena_dev, aenq_groups); @@ -3916,10 +3919,13 @@ ena_update_on_link_change(void *adapter_data, * This handler will called for unknown event group or unimplemented handlers **/ static void -unimplemented_aenq_handler(void *data, +unimplemented_aenq_handler(void *adapter_data, struct ena_admin_aenq_entry *aenq_e) { - return; + struct ena_adapter *adapter = (struct ena_adapter *)adapter_data; + + device_printf(adapter->pdev, + "Unknown event was received or event with unimplemented handler\n"); } static struct ena_aenq_handlers aenq_handlers = { From owner-svn-src-head@freebsd.org Thu May 30 13:09:55 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D1A6B15C1C54; Thu, 30 May 2019 13:09:54 +0000 (UTC) (envelope-from mw@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 5807D88076; Thu, 30 May 2019 13:09:54 +0000 (UTC) (envelope-from mw@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 42A2019783; Thu, 30 May 2019 13:09:54 +0000 (UTC) (envelope-from mw@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x4UD9sgt055536; Thu, 30 May 2019 13:09:54 GMT (envelope-from mw@FreeBSD.org) Received: (from mw@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4UD9sEd055535; Thu, 30 May 2019 13:09:54 GMT (envelope-from mw@FreeBSD.org) Message-Id: <201905301309.x4UD9sEd055535@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mw set sender to mw@FreeBSD.org using -f From: Marcin Wojtas Date: Thu, 30 May 2019 13:09:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r348388 - head/sys/dev/ena X-SVN-Group: head X-SVN-Commit-Author: mw X-SVN-Commit-Paths: head/sys/dev/ena X-SVN-Commit-Revision: 348388 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 5807D88076 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.96)[-0.960,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 30 May 2019 13:09:55 -0000 Author: mw Date: Thu May 30 13:09:53 2019 New Revision: 348388 URL: https://svnweb.freebsd.org/changeset/base/348388 Log: Add notification AENQ handler for ENA Notification AENQ handler is responsible for handling requests from ENA device. Missing Tx threshold, Tx timeout and keep alive timeout can be set using hints from the aenq descriptor which can be delivered in the ENA admin notification. The queue suspending and resuming tasks are not supported by the driver. Submitted by: Michal Krawczyk Obtained from: Semihalf Sponsored by: Amazon, Inc. Modified: head/sys/dev/ena/ena.c Modified: head/sys/dev/ena/ena.c ============================================================================== --- head/sys/dev/ena/ena.c Thu May 30 13:08:00 2019 (r348387) +++ head/sys/dev/ena/ena.c Thu May 30 13:09:53 2019 (r348388) @@ -3257,6 +3257,7 @@ ena_device_init(struct ena_adapter *adapter, device_t aenq_groups = BIT(ENA_ADMIN_LINK_CHANGE) | BIT(ENA_ADMIN_FATAL_ERROR) | BIT(ENA_ADMIN_WARNING) | + BIT(ENA_ADMIN_NOTIFICATION) | BIT(ENA_ADMIN_KEEP_ALIVE); aenq_groups &= get_feat_ctx->aenq.supported_groups; @@ -3338,7 +3339,7 @@ static void check_for_missing_keep_alive(struct ena_ad if (adapter->wd_active == 0) return; - if (likely(adapter->keep_alive_timeout == 0)) + if (adapter->keep_alive_timeout == ENA_HW_HINTS_NO_TIMEOUT) return; timestamp = atomic_load_acq_64(&adapter->keep_alive_timestamp); @@ -3436,7 +3437,7 @@ check_for_missing_tx_completions(struct ena_adapter *a if (adapter->trigger_reset) return; - if (adapter->missing_tx_timeout == 0) + if (adapter->missing_tx_timeout == ENA_HW_HINTS_NO_TIMEOUT) return; budget = adapter->missing_tx_max_queues; @@ -3506,6 +3507,42 @@ check_for_empty_rx_ring(struct ena_adapter *adapter) } } +static void ena_update_hints(struct ena_adapter *adapter, + struct ena_admin_ena_hw_hints *hints) +{ + struct ena_com_dev *ena_dev = adapter->ena_dev; + + if (hints->admin_completion_tx_timeout) + ena_dev->admin_queue.completion_timeout = + hints->admin_completion_tx_timeout * 1000; + + if (hints->mmio_read_timeout) + /* convert to usec */ + ena_dev->mmio_read.reg_read_to = + hints->mmio_read_timeout * 1000; + + if (hints->missed_tx_completion_count_threshold_to_reset) + adapter->missing_tx_threshold = + hints->missed_tx_completion_count_threshold_to_reset; + + if (hints->missing_tx_completion_timeout) { + if (hints->missing_tx_completion_timeout == + ENA_HW_HINTS_NO_TIMEOUT) + adapter->missing_tx_timeout = ENA_HW_HINTS_NO_TIMEOUT; + else + adapter->missing_tx_timeout = + SBT_1MS * hints->missing_tx_completion_timeout; + } + + if (hints->driver_watchdog_timeout) { + if (hints->driver_watchdog_timeout == ENA_HW_HINTS_NO_TIMEOUT) + adapter->keep_alive_timeout = ENA_HW_HINTS_NO_TIMEOUT; + else + adapter->keep_alive_timeout = + SBT_1MS * hints->driver_watchdog_timeout; + } +} + static void ena_timer_service(void *data) { @@ -3915,6 +3952,29 @@ ena_update_on_link_change(void *adapter_data, adapter->link_status = status; } +static void ena_notification(void *adapter_data, + struct ena_admin_aenq_entry *aenq_e) +{ + struct ena_adapter *adapter = (struct ena_adapter *)adapter_data; + struct ena_admin_ena_hw_hints *hints; + + ENA_WARN(aenq_e->aenq_common_desc.group != ENA_ADMIN_NOTIFICATION, + "Invalid group(%x) expected %x\n", aenq_e->aenq_common_desc.group, + ENA_ADMIN_NOTIFICATION); + + switch (aenq_e->aenq_common_desc.syndrom) { + case ENA_ADMIN_UPDATE_HINTS: + hints = + (struct ena_admin_ena_hw_hints *)(&aenq_e->inline_data_w4); + ena_update_hints(adapter, hints); + break; + default: + device_printf(adapter->pdev, + "Invalid aenq notification link state %d\n", + aenq_e->aenq_common_desc.syndrom); + } +} + /** * This handler will called for unknown event group or unimplemented handlers **/ @@ -3931,6 +3991,7 @@ unimplemented_aenq_handler(void *adapter_data, static struct ena_aenq_handlers aenq_handlers = { .handlers = { [ENA_ADMIN_LINK_CHANGE] = ena_update_on_link_change, + [ENA_ADMIN_NOTIFICATION] = ena_notification, [ENA_ADMIN_KEEP_ALIVE] = ena_keep_alive_wd, }, .unimplemented_handler = unimplemented_aenq_handler From owner-svn-src-head@freebsd.org Thu May 30 13:12:15 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3EB6715C1E26; Thu, 30 May 2019 13:12:15 +0000 (UTC) (envelope-from mw@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id D45FE885C3; Thu, 30 May 2019 13:12:14 +0000 (UTC) (envelope-from mw@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id ADDD819906; Thu, 30 May 2019 13:12:14 +0000 (UTC) (envelope-from mw@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x4UDCEFE060782; Thu, 30 May 2019 13:12:14 GMT (envelope-from mw@FreeBSD.org) Received: (from mw@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4UDCEE5060781; Thu, 30 May 2019 13:12:14 GMT (envelope-from mw@FreeBSD.org) Message-Id: <201905301312.x4UDCEE5060781@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mw set sender to mw@FreeBSD.org using -f From: Marcin Wojtas Date: Thu, 30 May 2019 13:12:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r348389 - head/sys/dev/ena X-SVN-Group: head X-SVN-Commit-Author: mw X-SVN-Commit-Paths: head/sys/dev/ena X-SVN-Commit-Revision: 348389 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: D45FE885C3 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.96)[-0.960,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 30 May 2019 13:12:15 -0000 Author: mw Date: Thu May 30 13:12:14 2019 New Revision: 348389 URL: https://svnweb.freebsd.org/changeset/base/348389 Log: Remove RSS support in ENA Receive Side Scaling is optional feature that could be enabled in kernel configuration by defining flag RSS. Kernel uses hash to store and find protocol control block which is stored in hash tables. Kernel and NIC hash functions must be consistent. Otherwise case lookup fails. To achieve this kernel provides API to set proper hash key to NIC. As it is not possible to change key for virtual ENA NIC, this driver cannot support RSS function. ENA is designed to work in virtual environments so supporting hardware version of this card is unnecessary. Submitted by: Rafal Kozik Obtained from: Semihalf Sponsored by: Amazon, Inc. Modified: head/sys/dev/ena/ena.c Modified: head/sys/dev/ena/ena.c ============================================================================== --- head/sys/dev/ena/ena.c Thu May 30 13:09:53 2019 (r348388) +++ head/sys/dev/ena/ena.c Thu May 30 13:12:14 2019 (r348389) @@ -59,11 +59,9 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include #include -#include #include #include #include @@ -585,9 +583,6 @@ ena_setup_tx_resources(struct ena_adapter *adapter, in struct ena_que *que = &adapter->que[qid]; struct ena_ring *tx_ring = que->tx_ring; int size, i, err; -#ifdef RSS - cpuset_t cpu_mask; -#endif size = sizeof(struct ena_tx_buffer) * tx_ring->ring_size; @@ -638,16 +633,8 @@ ena_setup_tx_resources(struct ena_adapter *adapter, in goto err_buf_info_unmap; } - /* RSS set cpu for thread */ -#ifdef RSS - CPU_SETOF(que->cpu, &cpu_mask); - taskqueue_start_threads_cpuset(&tx_ring->enqueue_tq, 1, PI_NET, - &cpu_mask, "%s tx_ring enq (bucket %d)", - device_get_nameunit(adapter->pdev), que->cpu); -#else /* RSS */ taskqueue_start_threads(&tx_ring->enqueue_tq, 1, PI_NET, "%s txeq %d", device_get_nameunit(adapter->pdev), que->cpu); -#endif /* RSS */ return (0); @@ -780,9 +767,6 @@ ena_setup_rx_resources(struct ena_adapter *adapter, un struct ena_que *que = &adapter->que[qid]; struct ena_ring *rx_ring = que->rx_ring; int size, err, i; -#ifdef RSS - cpuset_t cpu_mask; -#endif size = sizeof(struct ena_rx_buffer) * rx_ring->ring_size; @@ -836,16 +820,8 @@ ena_setup_rx_resources(struct ena_adapter *adapter, un rx_ring->cmpl_tq = taskqueue_create_fast("ena RX completion", M_WAITOK, taskqueue_thread_enqueue, &rx_ring->cmpl_tq); - /* RSS set cpu for thread */ -#ifdef RSS - CPU_SETOF(que->cpu, &cpu_mask); - taskqueue_start_threads_cpuset(&rx_ring->cmpl_tq, 1, PI_NET, &cpu_mask, - "%s rx_ring cmpl (bucket %d)", - device_get_nameunit(adapter->pdev), que->cpu); -#else taskqueue_start_threads(&rx_ring->cmpl_tq, 1, PI_NET, "%s rx_ring cmpl %d", device_get_nameunit(adapter->pdev), que->cpu); -#endif return (0); @@ -1908,12 +1884,9 @@ ena_setup_io_intr(struct ena_adapter *adapter) adapter->msix_entries[irq_idx].vector; ena_trace(ENA_INFO | ENA_IOQ, "ena_setup_io_intr vector: %d\n", adapter->msix_entries[irq_idx].vector); -#ifdef RSS - adapter->que[i].cpu = adapter->irq_tbl[irq_idx].cpu = - rss_getcpu(i % rss_getnumbuckets()); -#else + /* - * We still want to bind rings to the corresponding cpu + * We want to bind rings to the corresponding cpu * using something similar to the RSS round-robin technique. */ if (unlikely(last_bind_cpu < 0)) @@ -1921,7 +1894,6 @@ ena_setup_io_intr(struct ena_adapter *adapter) adapter->que[i].cpu = adapter->irq_tbl[irq_idx].cpu = last_bind_cpu; last_bind_cpu = CPU_NEXT(last_bind_cpu); -#endif } } @@ -2010,13 +1982,8 @@ ena_request_io_irq(struct ena_adapter *adapter) } irq->requested = true; -#ifdef RSS - ena_trace(ENA_INFO, "queue %d - RSS bucket %d\n", - i - ENA_IO_IRQ_FIRST_IDX, irq->cpu); -#else ena_trace(ENA_INFO, "queue %d - cpu %d\n", i - ENA_IO_IRQ_FIRST_IDX, irq->cpu); -#endif } return (rc); @@ -2952,16 +2919,7 @@ ena_mq_start(if_t ifp, struct mbuf *m) * It should improve performance. */ if (M_HASHTYPE_GET(m) != M_HASHTYPE_NONE) { -#ifdef RSS - if (rss_hash2bucket(m->m_pkthdr.flowid, - M_HASHTYPE_GET(m), &i) == 0) { - i = i % adapter->num_queues; - - } else -#endif - { - i = m->m_pkthdr.flowid % adapter->num_queues; - } + i = m->m_pkthdr.flowid % adapter->num_queues; } else { i = curcpu % adapter->num_queues; } @@ -3017,9 +2975,6 @@ ena_calc_io_queue_num(struct ena_adapter *adapter, /* 1 IRQ for for mgmnt and 1 IRQ for each TX/RX pair */ io_queue_num = min_t(int, io_queue_num, pci_msix_count(adapter->pdev) - 1); -#ifdef RSS - io_queue_num = min_t(int, io_queue_num, rss_getnumbuckets()); -#endif return (io_queue_num); } @@ -3077,12 +3032,7 @@ ena_rss_init_default(struct ena_adapter *adapter) } for (i = 0; i < ENA_RX_RSS_TABLE_SIZE; i++) { -#ifdef RSS - qid = rss_get_indirection_to_bucket(i); - qid = qid % adapter->num_queues; -#else qid = i % adapter->num_queues; -#endif rc = ena_com_indirect_table_fill_entry(ena_dev, i, ENA_IO_RXQ_IDX(qid)); if (unlikely((rc != 0) && (rc != EOPNOTSUPP))) { From owner-svn-src-head@freebsd.org Thu May 30 13:13:16 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8FE4815C1EB9; Thu, 30 May 2019 13:13:16 +0000 (UTC) (envelope-from mw@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 341A1887E0; Thu, 30 May 2019 13:13:16 +0000 (UTC) (envelope-from mw@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 0DD0119923; Thu, 30 May 2019 13:13:16 +0000 (UTC) (envelope-from mw@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x4UDDF7I060863; Thu, 30 May 2019 13:13:15 GMT (envelope-from mw@FreeBSD.org) Received: (from mw@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4UDDFrs060862; Thu, 30 May 2019 13:13:15 GMT (envelope-from mw@FreeBSD.org) Message-Id: <201905301313.x4UDDFrs060862@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mw set sender to mw@FreeBSD.org using -f From: Marcin Wojtas Date: Thu, 30 May 2019 13:13:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r348390 - head/sys/dev/ena X-SVN-Group: head X-SVN-Commit-Author: mw X-SVN-Commit-Paths: head/sys/dev/ena X-SVN-Commit-Revision: 348390 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 341A1887E0 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.96)[-0.960,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 30 May 2019 13:13:16 -0000 Author: mw Date: Thu May 30 13:13:15 2019 New Revision: 348390 URL: https://svnweb.freebsd.org/changeset/base/348390 Log: Trigger reset in ENA if there are too many Rx descriptors Whenever the driver will receive too many descriptors from the device, it should trigger the device reset, as it is indicating that the device is in invalid state. Submitted by: Michal Krawczyk Obtained from: Semihalf Sponsored by: Amazon, Inc. Modified: head/sys/dev/ena/ena.c Modified: head/sys/dev/ena/ena.c ============================================================================== --- head/sys/dev/ena/ena.c Thu May 30 13:12:14 2019 (r348389) +++ head/sys/dev/ena/ena.c Thu May 30 13:13:15 2019 (r348390) @@ -1717,7 +1717,12 @@ ena_rx_cleanup(struct ena_ring *rx_ring) error: counter_u64_add(rx_ring->rx_stats.bad_desc_num, 1); - return (RX_BUDGET - budget); + + /* Too many desc from the device. Trigger reset */ + adapter->reset_reason = ENA_REGS_RESET_TOO_MANY_RX_DESCS; + adapter->trigger_reset = true; + + return (0); } /********************************************************************* From owner-svn-src-head@freebsd.org Thu May 30 13:14:59 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A136015C1FDE; Thu, 30 May 2019 13:14:59 +0000 (UTC) (envelope-from mw@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 45B69889B0; Thu, 30 May 2019 13:14:59 +0000 (UTC) (envelope-from mw@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 13B4A19927; Thu, 30 May 2019 13:14:59 +0000 (UTC) (envelope-from mw@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x4UDEwo9060971; Thu, 30 May 2019 13:14:58 GMT (envelope-from mw@FreeBSD.org) Received: (from mw@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4UDEwkp060970; Thu, 30 May 2019 13:14:58 GMT (envelope-from mw@FreeBSD.org) Message-Id: <201905301314.x4UDEwkp060970@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mw set sender to mw@FreeBSD.org using -f From: Marcin Wojtas Date: Thu, 30 May 2019 13:14:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r348391 - head/sys/dev/ena X-SVN-Group: head X-SVN-Commit-Author: mw X-SVN-Commit-Paths: head/sys/dev/ena X-SVN-Commit-Revision: 348391 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 45B69889B0 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.96)[-0.960,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 30 May 2019 13:14:59 -0000 Author: mw Date: Thu May 30 13:14:58 2019 New Revision: 348391 URL: https://svnweb.freebsd.org/changeset/base/348391 Log: Print ENA Tx error conditionally Information about Tx error should be only displayed, if packet preparation failed due to error other than out of memory. Submitted by: Michal Krawczyk Obtained from: Semihalf Sponsored by: Amazon, Inc. Modified: head/sys/dev/ena/ena.c Modified: head/sys/dev/ena/ena.c ============================================================================== --- head/sys/dev/ena/ena.c Thu May 30 13:13:15 2019 (r348390) +++ head/sys/dev/ena/ena.c Thu May 30 13:14:58 2019 (r348391) @@ -2786,7 +2786,13 @@ ena_xmit_mbuf(struct ena_ring *tx_ring, struct mbuf ** /* Prepare the packet's descriptors and send them to device */ rc = ena_com_prepare_tx(io_sq, &ena_tx_ctx, &nb_hw_desc); if (unlikely(rc != 0)) { - ena_trace(ENA_DBG | ENA_TXPTH, "failed to prepare tx bufs\n"); + if (likely(rc == ENA_COM_NO_MEM)) { + ena_trace(ENA_DBG | ENA_TXPTH, + "tx ring[%d] if out of space\n", tx_ring->que->id); + } else { + device_printf(adapter->pdev, + "failed to prepare tx bufs\n"); + } counter_u64_add(tx_ring->tx_stats.prepare_ctx_err, 1); goto dma_error; } From owner-svn-src-head@freebsd.org Thu May 30 13:15:39 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9123C15C204E; Thu, 30 May 2019 13:15:39 +0000 (UTC) (envelope-from mw@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 33CD988B14; Thu, 30 May 2019 13:15:39 +0000 (UTC) (envelope-from mw@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 10AE119928; Thu, 30 May 2019 13:15:39 +0000 (UTC) (envelope-from mw@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x4UDFcH3061051; Thu, 30 May 2019 13:15:38 GMT (envelope-from mw@FreeBSD.org) Received: (from mw@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4UDFchM061050; Thu, 30 May 2019 13:15:38 GMT (envelope-from mw@FreeBSD.org) Message-Id: <201905301315.x4UDFchM061050@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mw set sender to mw@FreeBSD.org using -f From: Marcin Wojtas Date: Thu, 30 May 2019 13:15:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r348392 - head/sys/dev/ena X-SVN-Group: head X-SVN-Commit-Author: mw X-SVN-Commit-Paths: head/sys/dev/ena X-SVN-Commit-Revision: 348392 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 33CD988B14 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.96)[-0.960,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 30 May 2019 13:15:39 -0000 Author: mw Date: Thu May 30 13:15:38 2019 New Revision: 348392 URL: https://svnweb.freebsd.org/changeset/base/348392 Log: Fill number of CPUs field on ENA host_info structure The new ena_com allows the number of CPUs to be passed to the device in the host info structure as a hint. Submitted by: Michal Krawczyk Obtained from: Semihalf Sponsored by: Amazon, Inc. Modified: head/sys/dev/ena/ena.c Modified: head/sys/dev/ena/ena.c ============================================================================== --- head/sys/dev/ena/ena.c Thu May 30 13:14:58 2019 (r348391) +++ head/sys/dev/ena/ena.c Thu May 30 13:15:38 2019 (r348392) @@ -3130,6 +3130,7 @@ ena_config_host_info(struct ena_com_dev *ena_dev) (DRV_MODULE_VER_MAJOR) | (DRV_MODULE_VER_MINOR << ENA_ADMIN_HOST_INFO_MINOR_SHIFT) | (DRV_MODULE_VER_SUBMINOR << ENA_ADMIN_HOST_INFO_SUB_MINOR_SHIFT); + host_info->num_cpus = mp_ncpus; rc = ena_com_set_host_attributes(ena_dev); if (unlikely(rc != 0)) { From owner-svn-src-head@freebsd.org Thu May 30 13:16:57 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9755615C2170; Thu, 30 May 2019 13:16:57 +0000 (UTC) (envelope-from mw@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 36F9C88CE6; Thu, 30 May 2019 13:16:57 +0000 (UTC) (envelope-from mw@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 123FD1992A; Thu, 30 May 2019 13:16:57 +0000 (UTC) (envelope-from mw@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x4UDGu9e061148; Thu, 30 May 2019 13:16:56 GMT (envelope-from mw@FreeBSD.org) Received: (from mw@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4UDGuli061146; Thu, 30 May 2019 13:16:56 GMT (envelope-from mw@FreeBSD.org) Message-Id: <201905301316.x4UDGuli061146@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mw set sender to mw@FreeBSD.org using -f From: Marcin Wojtas Date: Thu, 30 May 2019 13:16:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r348393 - head/sys/dev/ena X-SVN-Group: head X-SVN-Commit-Author: mw X-SVN-Commit-Paths: head/sys/dev/ena X-SVN-Commit-Revision: 348393 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 36F9C88CE6 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.96)[-0.960,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 30 May 2019 13:16:57 -0000 Author: mw Date: Thu May 30 13:16:56 2019 New Revision: 348393 URL: https://svnweb.freebsd.org/changeset/base/348393 Log: Check for missing MSI-x and Tx completions in ENA If the first MSI-x won't be executed, then the timer service will detect that and trigger device reset. The checking for missing Tx completion was reworked, so it will also check for missing interrupts. Checking number of missing Tx completions can be performed after loop, instead of checking it every iteration. Submitted by: Michal Krawczyk Obtained from: Semihalf Sponsored by: Amazon, Inc. Modified: head/sys/dev/ena/ena.c head/sys/dev/ena/ena.h Modified: head/sys/dev/ena/ena.c ============================================================================== --- head/sys/dev/ena/ena.c Thu May 30 13:15:38 2019 (r348392) +++ head/sys/dev/ena/ena.c Thu May 30 13:16:56 2019 (r348393) @@ -405,6 +405,8 @@ ena_init_io_rings_common(struct ena_adapter *adapter, ring->qid = qid; ring->adapter = adapter; ring->ena_dev = adapter->ena_dev; + ring->first_interrupt = false; + ring->no_interrupt_event_cnt = 0; } static void @@ -1773,6 +1775,9 @@ ena_handle_msix(void *arg) ena_qid = ENA_IO_TXQ_IDX(qid); io_cq = &adapter->ena_dev->io_cq_queues[ena_qid]; + tx_ring->first_interrupt = true; + rx_ring->first_interrupt = true; + for (i = 0; i < CLEAN_BUDGET; ++i) { /* * If lock cannot be acquired, then deferred cleanup task was @@ -3329,13 +3334,37 @@ static void check_for_admin_com_state(struct ena_adapt } static int -check_missing_comp_in_queue(struct ena_adapter *adapter, +check_for_rx_interrupt_queue(struct ena_adapter *adapter, + struct ena_ring *rx_ring) +{ + if (likely(rx_ring->first_interrupt)) + return (0); + + if (ena_com_cq_empty(rx_ring->ena_com_io_cq)) + return (0); + + rx_ring->no_interrupt_event_cnt++; + + if (rx_ring->no_interrupt_event_cnt == ENA_MAX_NO_INTERRUPT_ITERATIONS) { + device_printf(adapter->pdev, "Potential MSIX issue on Rx side " + "Queue = %d. Reset the device\n", rx_ring->qid); + adapter->reset_reason = ENA_REGS_RESET_MISS_INTERRUPT; + adapter->trigger_reset = true; + return (EIO); + } + + return (0); +} + +static int +check_missing_comp_in_tx_queue(struct ena_adapter *adapter, struct ena_ring *tx_ring) { struct bintime curtime, time; struct ena_tx_buffer *tx_buf; + sbintime_t time_offset; uint32_t missed_tx = 0; - int i; + int i, rc = 0; getbinuptime(&curtime); @@ -3347,9 +3376,24 @@ check_missing_comp_in_queue(struct ena_adapter *adapte time = curtime; bintime_sub(&time, &tx_buf->timestamp); + time_offset = bttosbt(time); + if (unlikely(!tx_ring->first_interrupt && + time_offset > 2 * adapter->missing_tx_timeout)) { + /* + * If after graceful period interrupt is still not + * received, we schedule a reset. + */ + device_printf(adapter->pdev, + "Potential MSIX issue on Tx side Queue = %d. " + "Reset the device\n", tx_ring->qid); + adapter->reset_reason = ENA_REGS_RESET_MISS_INTERRUPT; + adapter->trigger_reset = true; + return (EIO); + } + /* Check again if packet is still waiting */ - if (unlikely(bttosbt(time) > adapter->missing_tx_timeout)) { + if (unlikely(time_offset > adapter->missing_tx_timeout)) { if (!tx_buf->print_once) ena_trace(ENA_WARNING, "Found a Tx that wasn't " @@ -3358,24 +3402,22 @@ check_missing_comp_in_queue(struct ena_adapter *adapte tx_buf->print_once = true; missed_tx++; - counter_u64_add(tx_ring->tx_stats.missing_tx_comp, 1); - - if (unlikely(missed_tx > - adapter->missing_tx_threshold)) { - device_printf(adapter->pdev, - "The number of lost tx completion " - "is above the threshold (%d > %d). " - "Reset the device\n", - missed_tx, adapter->missing_tx_threshold); - adapter->reset_reason = - ENA_REGS_RESET_MISS_TX_CMPL; - adapter->trigger_reset = true; - return (EIO); - } } } - return (0); + if (unlikely(missed_tx > adapter->missing_tx_threshold)) { + device_printf(adapter->pdev, + "The number of lost tx completion is above the threshold " + "(%d > %d). Reset the device\n", + missed_tx, adapter->missing_tx_threshold); + adapter->reset_reason = ENA_REGS_RESET_MISS_TX_CMPL; + adapter->trigger_reset = true; + rc = EIO; + } + + counter_u64_add(tx_ring->tx_stats.missing_tx_comp, missed_tx); + + return (rc); } /* @@ -3385,9 +3427,10 @@ check_missing_comp_in_queue(struct ena_adapter *adapte * transactions exceeds "missing_tx_threshold". */ static void -check_for_missing_tx_completions(struct ena_adapter *adapter) +check_for_missing_completions(struct ena_adapter *adapter) { struct ena_ring *tx_ring; + struct ena_ring *rx_ring; int i, budget, rc; /* Make sure the driver doesn't turn the device in other process */ @@ -3406,11 +3449,16 @@ check_for_missing_tx_completions(struct ena_adapter *a for (i = adapter->next_monitored_tx_qid; i < adapter->num_queues; i++) { tx_ring = &adapter->tx_ring[i]; + rx_ring = &adapter->rx_ring[i]; - rc = check_missing_comp_in_queue(adapter, tx_ring); + rc = check_missing_comp_in_tx_queue(adapter, tx_ring); if (unlikely(rc != 0)) return; + rc = check_for_rx_interrupt_queue(adapter, rx_ring); + if (unlikely(rc != 0)) + return; + budget--; if (budget == 0) { i++; @@ -3516,7 +3564,7 @@ ena_timer_service(void *data) check_for_admin_com_state(adapter); - check_for_missing_tx_completions(adapter); + check_for_missing_completions(adapter); check_for_empty_rx_ring(adapter); Modified: head/sys/dev/ena/ena.h ============================================================================== --- head/sys/dev/ena/ena.h Thu May 30 13:15:38 2019 (r348392) +++ head/sys/dev/ena/ena.h Thu May 30 13:16:56 2019 (r348393) @@ -120,6 +120,8 @@ #define ENA_IO_IRQ_FIRST_IDX 1 #define ENA_IO_IRQ_IDX(q) (ENA_IO_IRQ_FIRST_IDX + (q)) +#define ENA_MAX_NO_INTERRUPT_ITERATIONS 3 + /* * ENA device should send keep alive msg every 1 sec. * We wait for 6 sec just to be on the safe side. @@ -240,6 +242,9 @@ struct ena_ring { enum ena_admin_placement_policy_type tx_mem_queue_type; /* The maximum length the driver can push to the device (For LLQ) */ uint8_t tx_max_header_size; + + bool first_interrupt; + uint16_t no_interrupt_event_cnt; struct ena_com_rx_buf_info ena_bufs[ENA_PKT_MAX_BUFS]; From owner-svn-src-head@freebsd.org Thu May 30 13:18:24 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9588015C22F9; Thu, 30 May 2019 13:18:24 +0000 (UTC) (envelope-from mw@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 39E5889090; Thu, 30 May 2019 13:18:24 +0000 (UTC) (envelope-from mw@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 142311992B; Thu, 30 May 2019 13:18:24 +0000 (UTC) (envelope-from mw@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x4UDINtn061248; Thu, 30 May 2019 13:18:23 GMT (envelope-from mw@FreeBSD.org) Received: (from mw@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4UDINxl061247; Thu, 30 May 2019 13:18:23 GMT (envelope-from mw@FreeBSD.org) Message-Id: <201905301318.x4UDINxl061247@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mw set sender to mw@FreeBSD.org using -f From: Marcin Wojtas Date: Thu, 30 May 2019 13:18:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r348394 - head/sys/dev/ena X-SVN-Group: head X-SVN-Commit-Author: mw X-SVN-Commit-Paths: head/sys/dev/ena X-SVN-Commit-Revision: 348394 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 39E5889090 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.96)[-0.960,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 30 May 2019 13:18:24 -0000 Author: mw Date: Thu May 30 13:18:23 2019 New Revision: 348394 URL: https://svnweb.freebsd.org/changeset/base/348394 Log: Fix DMA synchronization in the ENA driver Tx and Rx paths The DMA in FreeBSD requires explicit synchronization. ENA driver was only doing PREREAD and PREWRITE synchronizations. Missing bus_dmamap_sync() calls were added. It is also required to synchronize DMA engine before unloading DMA map. Submitted by: Michal Krawczyk Obtained from: Semihalf Sponsored by: Amazon, Inc. Modified: head/sys/dev/ena/ena.c Modified: head/sys/dev/ena/ena.c ============================================================================== --- head/sys/dev/ena/ena.c Thu May 30 13:16:56 2019 (r348393) +++ head/sys/dev/ena/ena.c Thu May 30 13:18:23 2019 (r348394) @@ -268,6 +268,9 @@ ena_dma_alloc(device_t dmadev, bus_size_t size, goto fail_map_load; } + bus_dmamap_sync(dma->tag, dma->map, + BUS_DMASYNC_PREREAD | BUS_DMASYNC_PREWRITE); + return (0); fail_map_load: @@ -678,12 +681,14 @@ ena_free_tx_resources(struct ena_adapter *adapter, int /* Free buffer DMA maps, */ for (int i = 0; i < tx_ring->ring_size; i++) { - m_freem(tx_ring->tx_buffer_info[i].mbuf); - tx_ring->tx_buffer_info[i].mbuf = NULL; + bus_dmamap_sync(adapter->tx_buf_tag, + tx_ring->tx_buffer_info[i].map, BUS_DMASYNC_POSTWRITE); bus_dmamap_unload(adapter->tx_buf_tag, tx_ring->tx_buffer_info[i].map); bus_dmamap_destroy(adapter->tx_buf_tag, tx_ring->tx_buffer_info[i].map); + m_freem(tx_ring->tx_buffer_info[i].mbuf); + tx_ring->tx_buffer_info[i].mbuf = NULL; } ENA_RING_MTX_UNLOCK(tx_ring); @@ -859,6 +864,8 @@ ena_free_rx_resources(struct ena_adapter *adapter, uns /* Free buffer DMA maps, */ for (int i = 0; i < rx_ring->ring_size; i++) { + bus_dmamap_sync(adapter->rx_buf_tag, + rx_ring->rx_buffer_info[i].map, BUS_DMASYNC_POSTREAD); m_freem(rx_ring->rx_buffer_info[i].mbuf); rx_ring->rx_buffer_info[i].mbuf = NULL; bus_dmamap_unload(adapter->rx_buf_tag, @@ -993,6 +1000,8 @@ ena_free_rx_mbuf(struct ena_adapter *adapter, struct e return; } + bus_dmamap_sync(adapter->rx_buf_tag, rx_info->map, + BUS_DMASYNC_POSTREAD); bus_dmamap_unload(adapter->rx_buf_tag, rx_info->map); m_freem(rx_info->mbuf); rx_info->mbuf = NULL; @@ -1134,6 +1143,8 @@ ena_free_tx_bufs(struct ena_adapter *adapter, unsigned qid, i); } + bus_dmamap_sync(adapter->tx_buf_tag, tx_info->map, + BUS_DMASYNC_POSTWRITE); bus_dmamap_unload(adapter->tx_buf_tag, tx_info->map); m_free(tx_info->mbuf); tx_info->mbuf = NULL; @@ -1334,6 +1345,8 @@ ena_tx_cleanup(struct ena_ring *tx_ring) if (likely(tx_info->num_of_bufs != 0)) { /* Map is no longer required */ + bus_dmamap_sync(adapter->tx_buf_tag, tx_info->map, + BUS_DMASYNC_POSTWRITE); bus_dmamap_unload(adapter->tx_buf_tag, tx_info->map); } @@ -1467,6 +1480,8 @@ ena_rx_mbuf(struct ena_ring *rx_ring, struct ena_com_r ena_trace(ENA_DBG | ENA_RXPTH, "rx_info %p, mbuf %p, paddr %jx", rx_info, rx_info->mbuf, (uintmax_t)rx_info->ena_buf.paddr); + bus_dmamap_sync(adapter->rx_buf_tag, rx_info->map, + BUS_DMASYNC_POSTREAD); mbuf = rx_info->mbuf; mbuf->m_flags |= M_PKTHDR; mbuf->m_pkthdr.len = len; @@ -1522,6 +1537,8 @@ ena_rx_mbuf(struct ena_ring *rx_ring, struct ena_com_r return (NULL); } + bus_dmamap_sync(adapter->rx_buf_tag, rx_info->map, + BUS_DMASYNC_POSTREAD); if (unlikely(m_append(mbuf, len, rx_info->mbuf->m_data) == 0)) { counter_u64_add(rx_ring->rx_stats.mbuf_alloc_fail, 1); ena_trace(ENA_WARNING, "Failed to append Rx mbuf %p", @@ -1632,6 +1649,8 @@ ena_rx_cleanup(struct ena_ring *rx_ring) ena_rx_ctx.ena_bufs = rx_ring->ena_bufs; ena_rx_ctx.max_bufs = adapter->max_rx_sgl_size; ena_rx_ctx.descs = 0; + bus_dmamap_sync(io_cq->cdesc_addr.mem_handle.tag, + io_cq->cdesc_addr.mem_handle.map, BUS_DMASYNC_POSTREAD); rc = ena_com_rx_pkt(io_cq, io_sq, &ena_rx_ctx); if (unlikely(rc != 0)) @@ -1648,7 +1667,8 @@ ena_rx_cleanup(struct ena_ring *rx_ring) /* Receive mbuf from the ring */ mbuf = ena_rx_mbuf(rx_ring, rx_ring->ena_bufs, &ena_rx_ctx, &next_to_clean); - + bus_dmamap_sync(io_cq->cdesc_addr.mem_handle.tag, + io_cq->cdesc_addr.mem_handle.map, BUS_DMASYNC_PREREAD); /* Exit if we failed to retrieve a buffer */ if (unlikely(mbuf == NULL)) { for (i = 0; i < ena_rx_ctx.descs; ++i) { From owner-svn-src-head@freebsd.org Thu May 30 13:19:33 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9373E15C2405; Thu, 30 May 2019 13:19:33 +0000 (UTC) (envelope-from mw@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 33AF8891E1; Thu, 30 May 2019 13:19:33 +0000 (UTC) (envelope-from mw@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 102661992C; Thu, 30 May 2019 13:19:33 +0000 (UTC) (envelope-from mw@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x4UDJWN0061333; Thu, 30 May 2019 13:19:32 GMT (envelope-from mw@FreeBSD.org) Received: (from mw@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4UDJWwM061332; Thu, 30 May 2019 13:19:32 GMT (envelope-from mw@FreeBSD.org) Message-Id: <201905301319.x4UDJWwM061332@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mw set sender to mw@FreeBSD.org using -f From: Marcin Wojtas Date: Thu, 30 May 2019 13:19:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r348395 - head/sys/dev/ena X-SVN-Group: head X-SVN-Commit-Author: mw X-SVN-Commit-Paths: head/sys/dev/ena X-SVN-Commit-Revision: 348395 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 33AF8891E1 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.96)[-0.960,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 30 May 2019 13:19:33 -0000 Author: mw Date: Thu May 30 13:19:32 2019 New Revision: 348395 URL: https://svnweb.freebsd.org/changeset/base/348395 Log: Set vaddr and paddr as NULL when DMA alloc fails in ENA To prevent errors from assigning values from the DMA structure in case of an error, zero the vaddr and paddr values upon failure. Submitted by: Michal Krawczyk Obtained from: Semihalf Sponsored by: Amazon, Inc. Modified: head/sys/dev/ena/ena.c Modified: head/sys/dev/ena/ena.c ============================================================================== --- head/sys/dev/ena/ena.c Thu May 30 13:18:23 2019 (r348394) +++ head/sys/dev/ena/ena.c Thu May 30 13:19:32 2019 (r348395) @@ -279,6 +279,8 @@ fail_map_create: bus_dma_tag_destroy(dma->tag); fail_tag: dma->tag = NULL; + dma->vaddr = NULL; + dma->paddr = 0; return (error); } From owner-svn-src-head@freebsd.org Thu May 30 13:20:43 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CD0DD15C264D; Thu, 30 May 2019 13:20:43 +0000 (UTC) (envelope-from mw@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 713DD893E5; Thu, 30 May 2019 13:20:43 +0000 (UTC) (envelope-from mw@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4D4041993D; Thu, 30 May 2019 13:20:43 +0000 (UTC) (envelope-from mw@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x4UDKhSJ061449; Thu, 30 May 2019 13:20:43 GMT (envelope-from mw@FreeBSD.org) Received: (from mw@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4UDKhmj061448; Thu, 30 May 2019 13:20:43 GMT (envelope-from mw@FreeBSD.org) Message-Id: <201905301320.x4UDKhmj061448@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mw set sender to mw@FreeBSD.org using -f From: Marcin Wojtas Date: Thu, 30 May 2019 13:20:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r348396 - head/sys/dev/ena X-SVN-Group: head X-SVN-Commit-Author: mw X-SVN-Commit-Paths: head/sys/dev/ena X-SVN-Commit-Revision: 348396 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 713DD893E5 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.96)[-0.960,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 30 May 2019 13:20:44 -0000 Author: mw Date: Thu May 30 13:20:42 2019 New Revision: 348396 URL: https://svnweb.freebsd.org/changeset/base/348396 Log: Set error value when allocation of IO irq fails in ENA bus_alloc_resource_any() is not returning error value in case of an error. If the function call fails, the error value was not passed to the ena_up() function. Submitted by: Michal Krawczyk Obtained from: Semihalf Sponsored by: Amazon, Inc. Modified: head/sys/dev/ena/ena.c Modified: head/sys/dev/ena/ena.c ============================================================================== --- head/sys/dev/ena/ena.c Thu May 30 13:19:32 2019 (r348395) +++ head/sys/dev/ena/ena.c Thu May 30 13:20:42 2019 (r348396) @@ -1998,6 +1998,7 @@ ena_request_io_irq(struct ena_adapter *adapter) irq->res = bus_alloc_resource_any(adapter->pdev, SYS_RES_IRQ, &irq->vector, flags); if (unlikely(irq->res == NULL)) { + rc = ENOMEM; device_printf(adapter->pdev, "could not allocate " "irq vector: %d\n", irq->vector); goto err; From owner-svn-src-head@freebsd.org Thu May 30 13:22:13 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D098A15C2778; Thu, 30 May 2019 13:22:13 +0000 (UTC) (envelope-from mw@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 2BC1089890; Thu, 30 May 2019 13:22:13 +0000 (UTC) (envelope-from mw@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 0FD4219AB8; Thu, 30 May 2019 13:22:13 +0000 (UTC) (envelope-from mw@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x4UDMCCp066065; Thu, 30 May 2019 13:22:12 GMT (envelope-from mw@FreeBSD.org) Received: (from mw@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4UDMCxM066064; Thu, 30 May 2019 13:22:12 GMT (envelope-from mw@FreeBSD.org) Message-Id: <201905301322.x4UDMCxM066064@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mw set sender to mw@FreeBSD.org using -f From: Marcin Wojtas Date: Thu, 30 May 2019 13:22:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r348397 - head/sys/dev/ena X-SVN-Group: head X-SVN-Commit-Author: mw X-SVN-Commit-Paths: head/sys/dev/ena X-SVN-Commit-Revision: 348397 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 2BC1089890 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.98 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.98)[-0.980,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 30 May 2019 13:22:14 -0000 Author: mw Date: Thu May 30 13:22:12 2019 New Revision: 348397 URL: https://svnweb.freebsd.org/changeset/base/348397 Log: Check for number of MSI-x upon partial allocation in ENA The ENA driver needs at least 2 MSI-x - one for admin queue, and one for IO queues pair. If there were not enough resources to allocate more than one MSI-x, the device should not be attached. Submitted by: Michal Krawczyk Obtained from: Semihalf Sponsored by: Amazon, Inc. Modified: head/sys/dev/ena/ena.c Modified: head/sys/dev/ena/ena.c ============================================================================== --- head/sys/dev/ena/ena.c Thu May 30 13:20:42 2019 (r348396) +++ head/sys/dev/ena/ena.c Thu May 30 13:22:12 2019 (r348397) @@ -1865,6 +1865,14 @@ ena_enable_msix(struct ena_adapter *adapter) } if (msix_vecs != msix_req) { + if (msix_vecs == ENA_ADMIN_MSIX_VEC) { + device_printf(dev, + "Not enough number of MSI-x allocated: %d\n", + msix_vecs); + pci_release_msi(dev); + rc = ENOSPC; + goto err_msix_free; + } device_printf(dev, "Enable only %d MSI-x (out of %d), reduce " "the number of queues\n", msix_vecs, msix_req); adapter->num_queues = msix_vecs - ENA_ADMIN_MSIX_VEC; From owner-svn-src-head@freebsd.org Thu May 30 13:22:54 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C154515C2806; Thu, 30 May 2019 13:22:54 +0000 (UTC) (envelope-from mw@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 625BC89A32; Thu, 30 May 2019 13:22:54 +0000 (UTC) (envelope-from mw@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 3AC8219AD2; Thu, 30 May 2019 13:22:54 +0000 (UTC) (envelope-from mw@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x4UDMspN066133; Thu, 30 May 2019 13:22:54 GMT (envelope-from mw@FreeBSD.org) Received: (from mw@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4UDMss5066132; Thu, 30 May 2019 13:22:54 GMT (envelope-from mw@FreeBSD.org) Message-Id: <201905301322.x4UDMss5066132@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mw set sender to mw@FreeBSD.org using -f From: Marcin Wojtas Date: Thu, 30 May 2019 13:22:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r348398 - head/sys/dev/ena X-SVN-Group: head X-SVN-Commit-Author: mw X-SVN-Commit-Paths: head/sys/dev/ena X-SVN-Commit-Revision: 348398 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 625BC89A32 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.98 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.98)[-0.980,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 30 May 2019 13:22:54 -0000 Author: mw Date: Thu May 30 13:22:53 2019 New Revision: 348398 URL: https://svnweb.freebsd.org/changeset/base/348398 Log: Change order of ifp release on ENA detach In rare case, when the ifconfig is called just before kldunload, it is possible, that ena_up routine will be called after queue locks are released. To prevent that, ifp is detached before the last ena_down is called and further, the ifp is freed at the end of the function. Submitted by: Michal Krawczyk Obtained from: Semihalf Sponsored by: Amazon, Inc. Modified: head/sys/dev/ena/ena.c Modified: head/sys/dev/ena/ena.c ============================================================================== --- head/sys/dev/ena/ena.c Thu May 30 13:22:12 2019 (r348397) +++ head/sys/dev/ena/ena.c Thu May 30 13:22:53 2019 (r348398) @@ -3893,6 +3893,8 @@ ena_detach(device_t pdev) return (EBUSY); } + ether_ifdetach(adapter->ifp); + /* Free reset task and callout */ callout_drain(&adapter->timer_service); while (taskqueue_cancel(adapter->reset_tq, &adapter->reset_task, NULL)) @@ -3903,11 +3905,6 @@ ena_detach(device_t pdev) ena_down(adapter); sx_unlock(&adapter->ioctl_sx); - if (adapter->ifp != NULL) { - ether_ifdetach(adapter->ifp); - if_free(adapter->ifp); - } - ena_free_all_io_rings_resources(adapter); ena_free_counters((counter_u64_t *)&adapter->hw_stats, @@ -3948,6 +3945,8 @@ ena_detach(device_t pdev) mtx_destroy(&adapter->global_mtx); sx_destroy(&adapter->ioctl_sx); + + if_free(adapter->ifp); if (ena_dev->bus != NULL) free(ena_dev->bus, M_DEVBUF); From owner-svn-src-head@freebsd.org Thu May 30 13:24:48 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C74C415C292D; Thu, 30 May 2019 13:24:48 +0000 (UTC) (envelope-from mw@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 66FA089C11; Thu, 30 May 2019 13:24:48 +0000 (UTC) (envelope-from mw@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 52B0019AD3; Thu, 30 May 2019 13:24:48 +0000 (UTC) (envelope-from mw@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x4UDOmEl066249; Thu, 30 May 2019 13:24:48 GMT (envelope-from mw@FreeBSD.org) Received: (from mw@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4UDOmSL066248; Thu, 30 May 2019 13:24:48 GMT (envelope-from mw@FreeBSD.org) Message-Id: <201905301324.x4UDOmSL066248@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mw set sender to mw@FreeBSD.org using -f From: Marcin Wojtas Date: Thu, 30 May 2019 13:24:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r348399 - head/sys/dev/ena X-SVN-Group: head X-SVN-Commit-Author: mw X-SVN-Commit-Paths: head/sys/dev/ena X-SVN-Commit-Revision: 348399 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 66FA089C11 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.98 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.98)[-0.980,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 30 May 2019 13:24:49 -0000 Author: mw Date: Thu May 30 13:24:47 2019 New Revision: 348399 URL: https://svnweb.freebsd.org/changeset/base/348399 Log: Change attach order to prevent crash upon failure in ENA The if_detach was causing crash if the MSI-x configuration in the attach failed. To prevent this issue, the ifnet is being configured at the end of the attach function. Submitted by: Michal Krawczyk Obtained from: Semihalf Sponsored by: Amazon, Inc. Modified: head/sys/dev/ena/ena.c Modified: head/sys/dev/ena/ena.c ============================================================================== --- head/sys/dev/ena/ena.c Thu May 30 13:22:53 2019 (r348398) +++ head/sys/dev/ena/ena.c Thu May 30 13:24:47 2019 (r348399) @@ -3819,18 +3819,18 @@ ena_attach(device_t pdev) device_printf(pdev, "initalize %d io queues\n", io_queue_num); ena_init_io_rings(adapter); - /* setup network interface */ - rc = ena_setup_ifnet(pdev, adapter, &get_feat_ctx); + rc = ena_enable_msix_and_set_admin_interrupts(adapter, io_queue_num); if (unlikely(rc != 0)) { - device_printf(pdev, "Error with network interface setup\n"); + device_printf(pdev, + "Failed to enable and set the admin interrupts\n"); goto err_io_free; } - rc = ena_enable_msix_and_set_admin_interrupts(adapter, io_queue_num); + /* setup network interface */ + rc = ena_setup_ifnet(pdev, adapter, &get_feat_ctx); if (unlikely(rc != 0)) { - device_printf(pdev, - "Failed to enable and set the admin interrupts\n"); - goto err_ifp_free; + device_printf(pdev, "Error with network interface setup\n"); + goto err_msix_free; } /* Initialize reset task queue */ @@ -3853,9 +3853,10 @@ ena_attach(device_t pdev) adapter->running = true; return (0); -err_ifp_free: - if_detach(adapter->ifp); - if_free(adapter->ifp); +err_msix_free: + ena_com_dev_reset(adapter->ena_dev, ENA_REGS_RESET_INIT_ERR); + ena_free_mgmnt_irq(adapter); + ena_disable_msix(adapter); err_io_free: ena_free_all_io_rings_resources(adapter); ena_free_rx_dma_tag(adapter); From owner-svn-src-head@freebsd.org Thu May 30 13:26:19 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4F3F015C2A02; Thu, 30 May 2019 13:26:19 +0000 (UTC) (envelope-from mw@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id E654E89DBF; Thu, 30 May 2019 13:26:18 +0000 (UTC) (envelope-from mw@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id AEC2E19AD4; Thu, 30 May 2019 13:26:18 +0000 (UTC) (envelope-from mw@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x4UDQIeQ066358; Thu, 30 May 2019 13:26:18 GMT (envelope-from mw@FreeBSD.org) Received: (from mw@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4UDQI7x066357; Thu, 30 May 2019 13:26:18 GMT (envelope-from mw@FreeBSD.org) Message-Id: <201905301326.x4UDQI7x066357@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mw set sender to mw@FreeBSD.org using -f From: Marcin Wojtas Date: Thu, 30 May 2019 13:26:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r348400 - head/sys/dev/ena X-SVN-Group: head X-SVN-Commit-Author: mw X-SVN-Commit-Paths: head/sys/dev/ena X-SVN-Commit-Revision: 348400 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: E654E89DBF X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.98 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.98)[-0.980,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 30 May 2019 13:26:19 -0000 Author: mw Date: Thu May 30 13:26:18 2019 New Revision: 348400 URL: https://svnweb.freebsd.org/changeset/base/348400 Log: Fix error in validate_tx_req_id() in ENA If the requested ID was out of range, the tx_info structure was NULL and the function was trying to access the field of the NULL object. Submitted by: Michal Krawczyk Obtained from: Semihalf Sponsored by: Amazon, Inc. Modified: head/sys/dev/ena/ena.c Modified: head/sys/dev/ena/ena.c ============================================================================== --- head/sys/dev/ena/ena.c Thu May 30 13:24:47 2019 (r348399) +++ head/sys/dev/ena/ena.c Thu May 30 13:26:18 2019 (r348400) @@ -1203,14 +1203,11 @@ validate_tx_req_id(struct ena_ring *tx_ring, uint16_t tx_info = &tx_ring->tx_buffer_info[req_id]; if (tx_info->mbuf != NULL) return (0); - } - - if (tx_info->mbuf == NULL) device_printf(adapter->pdev, "tx_info doesn't have valid mbuf\n"); - else - device_printf(adapter->pdev, "Invalid req_id: %hu\n", req_id); + } + device_printf(adapter->pdev, "Invalid req_id: %hu\n", req_id); counter_u64_add(tx_ring->tx_stats.bad_req_id, 1); return (EFAULT); From owner-svn-src-head@freebsd.org Thu May 30 13:28:04 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6161615C2ABE; Thu, 30 May 2019 13:28:04 +0000 (UTC) (envelope-from mw@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 0F10A89F8C; Thu, 30 May 2019 13:28:04 +0000 (UTC) (envelope-from mw@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D19A219B05; Thu, 30 May 2019 13:28:03 +0000 (UTC) (envelope-from mw@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x4UDS3r9066473; Thu, 30 May 2019 13:28:03 GMT (envelope-from mw@FreeBSD.org) Received: (from mw@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4UDS3Ei066470; Thu, 30 May 2019 13:28:03 GMT (envelope-from mw@FreeBSD.org) Message-Id: <201905301328.x4UDS3Ei066470@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mw set sender to mw@FreeBSD.org using -f From: Marcin Wojtas Date: Thu, 30 May 2019 13:28:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r348401 - head/sys/dev/ena X-SVN-Group: head X-SVN-Commit-Author: mw X-SVN-Commit-Paths: head/sys/dev/ena X-SVN-Commit-Revision: 348401 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 0F10A89F8C X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.98 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.98)[-0.981,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 30 May 2019 13:28:04 -0000 Author: mw Date: Thu May 30 13:28:03 2019 New Revision: 348401 URL: https://svnweb.freebsd.org/changeset/base/348401 Log: Add tuneable drbr ring size and hw queues depth for ENA The driver now supports per adapter tuning of buffer ring size and HW Rx ring size. It can be achieved using sysctl node dev.ena.X. Submitted by: Michal Krawczyk Obtained from: Semihalf Sponsored by: Amazon, Inc. Modified: head/sys/dev/ena/ena.c head/sys/dev/ena/ena.h head/sys/dev/ena/ena_sysctl.c Modified: head/sys/dev/ena/ena.c ============================================================================== --- head/sys/dev/ena/ena.c Thu May 30 13:26:18 2019 (r348400) +++ head/sys/dev/ena/ena.c Thu May 30 13:28:03 2019 (r348401) @@ -164,8 +164,10 @@ static void ena_deferred_mq_start(void *, int); static void ena_qflush(if_t); static int ena_calc_io_queue_num(struct ena_adapter *, struct ena_com_dev_get_features_ctx *); -static int ena_calc_queue_size(struct ena_adapter *, uint16_t *, - uint16_t *, struct ena_com_dev_get_features_ctx *); +static int ena_calc_queue_size(struct ena_adapter *, + struct ena_calc_queue_size_ctx *); +static int ena_handle_updated_queues(struct ena_adapter *, + struct ena_com_dev_get_features_ctx *); static int ena_rss_init_default(struct ena_adapter *); static void ena_rss_init_default_deferred(void *); static void ena_config_host_info(struct ena_com_dev *); @@ -182,22 +184,6 @@ static void ena_timer_service(void *); static char ena_version[] = DEVICE_NAME DRV_MODULE_NAME " v" DRV_MODULE_VERSION; -static SYSCTL_NODE(_hw, OID_AUTO, ena, CTLFLAG_RD, 0, "ENA driver parameters"); - -/* - * Tuneable number of buffers in the buf-ring (drbr) - */ -static int ena_buf_ring_size = 4096; -SYSCTL_INT(_hw_ena, OID_AUTO, buf_ring_size, CTLFLAG_RWTUN, - &ena_buf_ring_size, 0, "Size of the bufring"); - -/* - * Logging level for changing verbosity of the output - */ -int ena_log_level = ENA_ALERT | ENA_WARNING; -SYSCTL_INT(_hw_ena, OID_AUTO, log_level, CTLFLAG_RWTUN, - &ena_log_level, 0, "Logging level indicating verbosity of the logs"); - static ena_vendor_info_t ena_vendor_info_array[] = { { PCI_VENDOR_ID_AMAZON, PCI_DEV_ID_ENA_PF, 0}, { PCI_VENDOR_ID_AMAZON, PCI_DEV_ID_ENA_LLQ_PF, 0}, @@ -440,7 +426,8 @@ ena_init_io_rings(struct ena_adapter *adapter) ena_com_get_nonadaptive_moderation_interval_tx(ena_dev); /* Allocate a buf ring */ - txr->br = buf_ring_alloc(ena_buf_ring_size, M_DEVBUF, + txr->buf_ring_size = adapter->buf_ring_size; + txr->br = buf_ring_alloc(txr->buf_ring_size, M_DEVBUF, M_WAITOK, &txr->ring_mtx); /* Alloc TX statistics. */ @@ -3008,11 +2995,25 @@ static int ena_calc_io_queue_num(struct ena_adapter *adapter, struct ena_com_dev_get_features_ctx *get_feat_ctx) { + struct ena_com_dev *ena_dev = adapter->ena_dev; int io_sq_num, io_cq_num, io_queue_num; - io_sq_num = get_feat_ctx->max_queues.max_sq_num; - io_cq_num = get_feat_ctx->max_queues.max_cq_num; + /* Regular queues capabilities */ + if (ena_dev->supported_features & BIT(ENA_ADMIN_MAX_QUEUES_EXT)) { + struct ena_admin_queue_ext_feature_fields *max_queue_ext = + &get_feat_ctx->max_queue_ext.max_queue_ext; + io_sq_num = max_queue_ext->max_rx_sq_num; + io_sq_num = min_t(int, io_sq_num, max_queue_ext->max_tx_sq_num); + io_cq_num = max_queue_ext->max_rx_cq_num; + io_cq_num = min_t(int, io_cq_num, max_queue_ext->max_tx_cq_num); + } else { + struct ena_admin_queue_feature_desc *max_queues = + &get_feat_ctx->max_queues; + io_sq_num = max_queues->max_sq_num; + io_cq_num = max_queues->max_cq_num; + } + io_queue_num = min_t(int, mp_ncpus, ENA_MAX_NUM_IO_QUEUES); io_queue_num = min_t(int, io_queue_num, io_sq_num); io_queue_num = min_t(int, io_queue_num, io_cq_num); @@ -3024,42 +3025,119 @@ ena_calc_io_queue_num(struct ena_adapter *adapter, } static int -ena_calc_queue_size(struct ena_adapter *adapter, uint16_t *max_tx_sgl_size, - uint16_t *max_rx_sgl_size, struct ena_com_dev_get_features_ctx *feat) +ena_calc_queue_size(struct ena_adapter *adapter, + struct ena_calc_queue_size_ctx *ctx) { - uint32_t queue_size = ENA_DEFAULT_RING_SIZE; - uint32_t v; - uint32_t q; + uint32_t tx_queue_size = ENA_DEFAULT_RING_SIZE; + uint32_t rx_queue_size = adapter->rx_ring_size; - queue_size = min_t(uint32_t, queue_size, - feat->max_queues.max_cq_depth); - queue_size = min_t(uint32_t, queue_size, - feat->max_queues.max_sq_depth); + if (ctx->ena_dev->supported_features & BIT(ENA_ADMIN_MAX_QUEUES_EXT)) { + struct ena_admin_queue_ext_feature_fields *max_queue_ext = + &ctx->get_feat_ctx->max_queue_ext.max_queue_ext; + rx_queue_size = min_t(uint32_t, rx_queue_size, + max_queue_ext->max_rx_cq_depth); + rx_queue_size = min_t(uint32_t, rx_queue_size, + max_queue_ext->max_rx_sq_depth); + tx_queue_size = min_t(uint32_t, tx_queue_size, + max_queue_ext->max_tx_cq_depth); + tx_queue_size = min_t(uint32_t, tx_queue_size, + max_queue_ext->max_tx_sq_depth); + ctx->max_rx_sgl_size = min_t(uint16_t, ENA_PKT_MAX_BUFS, + max_queue_ext->max_per_packet_rx_descs); + ctx->max_tx_sgl_size = min_t(uint16_t, ENA_PKT_MAX_BUFS, + max_queue_ext->max_per_packet_tx_descs); + } else { + struct ena_admin_queue_feature_desc *max_queues = + &ctx->get_feat_ctx->max_queues; + rx_queue_size = min_t(uint32_t, rx_queue_size, + max_queues->max_cq_depth); + rx_queue_size = min_t(uint32_t, rx_queue_size, + max_queues->max_sq_depth); + tx_queue_size = rx_queue_size; + ctx->max_rx_sgl_size = min_t(uint16_t, ENA_PKT_MAX_BUFS, + max_queues->max_packet_tx_descs); + ctx->max_tx_sgl_size = min_t(uint16_t, ENA_PKT_MAX_BUFS, + max_queues->max_packet_rx_descs); + } /* round down to the nearest power of 2 */ - v = queue_size; - while (v != 0) { - if (powerof2(queue_size) != 0) - break; - v /= 2; - q = rounddown2(queue_size, v); - if (q != 0) { - queue_size = q; - break; - } + rx_queue_size = 1 << (fls(rx_queue_size) - 1); + tx_queue_size = 1 << (fls(tx_queue_size) - 1); + + if (unlikely(rx_queue_size == 0 || tx_queue_size == 0)) { + device_printf(ctx->pdev, "Invalid queue size\n"); + return (EFAULT); } - if (unlikely(queue_size == 0)) { - device_printf(adapter->pdev, "Invalid queue size\n"); - return (ENA_COM_FAULT); + ctx->rx_queue_size = rx_queue_size; + ctx->tx_queue_size = tx_queue_size; + + return (0); +} + +static int +ena_handle_updated_queues(struct ena_adapter *adapter, + struct ena_com_dev_get_features_ctx *get_feat_ctx) +{ + struct ena_com_dev *ena_dev = adapter->ena_dev; + struct ena_calc_queue_size_ctx calc_queue_ctx = { 0 }; + device_t pdev = adapter->pdev; + bool are_queues_changed = false; + int io_queue_num, rc; + + calc_queue_ctx.ena_dev = ena_dev; + calc_queue_ctx.get_feat_ctx = get_feat_ctx; + calc_queue_ctx.pdev = pdev; + + io_queue_num = ena_calc_io_queue_num(adapter, get_feat_ctx); + rc = ena_calc_queue_size(adapter, &calc_queue_ctx); + if (unlikely(rc != 0 || io_queue_num <= 0)) + return EFAULT; + + if (adapter->tx_ring->buf_ring_size != adapter->buf_ring_size) + are_queues_changed = true; + + if (unlikely(adapter->tx_ring_size > calc_queue_ctx.tx_queue_size || + adapter->rx_ring_size > calc_queue_ctx.rx_queue_size)) { + device_printf(pdev, + "Not enough resources to allocate requested queue sizes " + "(TX,RX)=(%d,%d), falling back to queue sizes " + "(TX,RX)=(%d,%d)\n", + adapter->tx_ring_size, + adapter->rx_ring_size, + calc_queue_ctx.tx_queue_size, + calc_queue_ctx.rx_queue_size); + adapter->tx_ring_size = calc_queue_ctx.tx_queue_size; + adapter->rx_ring_size = calc_queue_ctx.rx_queue_size; + adapter->max_tx_sgl_size = calc_queue_ctx.max_tx_sgl_size; + adapter->max_rx_sgl_size = calc_queue_ctx.max_rx_sgl_size; + are_queues_changed = true; } - *max_tx_sgl_size = min_t(uint16_t, ENA_PKT_MAX_BUFS, - feat->max_queues.max_packet_tx_descs); - *max_rx_sgl_size = min_t(uint16_t, ENA_PKT_MAX_BUFS, - feat->max_queues.max_packet_rx_descs); + if (unlikely(adapter->num_queues > io_queue_num)) { + device_printf(pdev, + "Not enough resources to allocate %d queues, " + "falling back to %d queues\n", + adapter->num_queues, io_queue_num); + adapter->num_queues = io_queue_num; + if (adapter->rss_support) { + ena_com_rss_destroy(ena_dev); + rc = ena_rss_init_default(adapter); + if (unlikely(rc != 0) && (rc != EOPNOTSUPP)) { + device_printf(pdev, "Cannot init RSS rc: %d\n", + rc); + return (rc); + } + } + are_queues_changed = true; + } - return (queue_size); + if (unlikely(are_queues_changed)) { + ena_free_all_io_rings_resources(adapter); + ena_init_io_rings(adapter); + } + + return (0); } static int @@ -3653,6 +3731,10 @@ ena_reset_task(void *arg, int pending) goto err_dev_free; } + rc = ena_handle_updated_queues(adapter, &get_feat_ctx); + if (unlikely(rc != 0)) + goto err_dev_free; + rc = ena_enable_msix_and_set_admin_interrupts(adapter, adapter->num_queues); if (unlikely(rc != 0)) { @@ -3702,13 +3784,11 @@ static int ena_attach(device_t pdev) { struct ena_com_dev_get_features_ctx get_feat_ctx; + struct ena_calc_queue_size_ctx calc_queue_ctx = { 0 }; static int version_printed; struct ena_adapter *adapter; struct ena_com_dev *ena_dev = NULL; - uint16_t tx_sgl_size = 0; - uint16_t rx_sgl_size = 0; int io_queue_num; - int queue_size; int rc; adapter = device_get_softc(pdev); adapter->pdev = pdev; @@ -3774,6 +3854,10 @@ ena_attach(device_t pdev) memcpy(adapter->mac_addr, get_feat_ctx.dev_attr.mac_addr, ETHER_ADDR_LEN); + calc_queue_ctx.ena_dev = ena_dev; + calc_queue_ctx.get_feat_ctx = &get_feat_ctx; + calc_queue_ctx.pdev = pdev; + /* calculate IO queue number to create */ io_queue_num = ena_calc_io_queue_num(adapter, &get_feat_ctx); @@ -3782,23 +3866,25 @@ ena_attach(device_t pdev) adapter->num_queues = io_queue_num; adapter->max_mtu = get_feat_ctx.dev_attr.max_mtu; - + // Set the requested Rx ring size + adapter->rx_ring_size = ENA_DEFAULT_RING_SIZE; /* calculatre ring sizes */ - queue_size = ena_calc_queue_size(adapter,&tx_sgl_size, - &rx_sgl_size, &get_feat_ctx); - if (unlikely((queue_size <= 0) || (io_queue_num <= 0))) { - rc = ENA_COM_FAULT; + rc = ena_calc_queue_size(adapter, &calc_queue_ctx); + if (unlikely((rc != 0) || (io_queue_num <= 0))) { + rc = EFAULT; goto err_com_free; } adapter->reset_reason = ENA_REGS_RESET_NORMAL; - adapter->tx_ring_size = queue_size; - adapter->rx_ring_size = queue_size; + adapter->tx_ring_size = calc_queue_ctx.tx_queue_size; + adapter->rx_ring_size = calc_queue_ctx.rx_queue_size; - adapter->max_tx_sgl_size = tx_sgl_size; - adapter->max_rx_sgl_size = rx_sgl_size; + adapter->max_tx_sgl_size = calc_queue_ctx.max_tx_sgl_size; + adapter->max_rx_sgl_size = calc_queue_ctx.max_rx_sgl_size; + adapter->buf_ring_size = ENA_DEFAULT_BUF_RING_SIZE; + /* set up dma tags for rx and tx buffers */ rc = ena_setup_tx_dma_tag(adapter); if (unlikely(rc != 0)) { @@ -3813,7 +3899,11 @@ ena_attach(device_t pdev) } /* initialize rings basic information */ - device_printf(pdev, "initalize %d io queues\n", io_queue_num); + device_printf(pdev, + "Creating %d io queues. Rx queue size: %d, Tx queue size: %d\n", + io_queue_num, + calc_queue_ctx.rx_queue_size, + calc_queue_ctx.tx_queue_size); ena_init_io_rings(adapter); rc = ena_enable_msix_and_set_admin_interrupts(adapter, io_queue_num); Modified: head/sys/dev/ena/ena.h ============================================================================== --- head/sys/dev/ena/ena.h Thu May 30 13:26:18 2019 (r348400) +++ head/sys/dev/ena/ena.h Thu May 30 13:28:03 2019 (r348401) @@ -66,6 +66,8 @@ #define ENA_BUS_DMA_SEGS 32 +#define ENA_DEFAULT_BUF_RING_SIZE 4096 + #define ENA_DEFAULT_RING_SIZE 1024 #define ENA_RX_REFILL_THRESH_DIVIDER 8 @@ -178,6 +180,16 @@ struct ena_que { int cpu; }; +struct ena_calc_queue_size_ctx { + struct ena_com_dev_get_features_ctx *get_feat_ctx; + struct ena_com_dev *ena_dev; + device_t pdev; + uint16_t rx_queue_size; + uint16_t tx_queue_size; + uint16_t max_tx_sgl_size; + uint16_t max_rx_sgl_size; +}; + struct ena_tx_buffer { struct mbuf *mbuf; /* # of ena desc for this specific mbuf @@ -268,6 +280,7 @@ struct ena_ring { int ring_size; /* number of tx/rx_buffer_info's entries */ struct buf_ring *br; /* only for TX */ + uint32_t buf_ring_size; struct mtx ring_mtx; char mtx_name[16]; @@ -346,6 +359,8 @@ struct ena_adapter { unsigned int tx_ring_size; unsigned int rx_ring_size; + + uint16_t buf_ring_size; /* RSS*/ uint8_t rss_ind_tbl[ENA_RX_RSS_TABLE_SIZE]; Modified: head/sys/dev/ena/ena_sysctl.c ============================================================================== --- head/sys/dev/ena/ena_sysctl.c Thu May 30 13:26:18 2019 (r348400) +++ head/sys/dev/ena/ena_sysctl.c Thu May 30 13:28:03 2019 (r348401) @@ -34,12 +34,26 @@ __FBSDID("$FreeBSD$"); static void ena_sysctl_add_wd(struct ena_adapter *); static void ena_sysctl_add_stats(struct ena_adapter *); +static void ena_sysctl_add_tuneables(struct ena_adapter *); +static int ena_sysctl_buf_ring_size(SYSCTL_HANDLER_ARGS); +static int ena_sysctl_rx_queue_size(SYSCTL_HANDLER_ARGS); +static SYSCTL_NODE(_hw, OID_AUTO, ena, CTLFLAG_RD, 0, "ENA driver parameters"); + +/* + * Logging level for changing verbosity of the output + */ +int ena_log_level = ENA_ALERT | ENA_WARNING; +SYSCTL_INT(_hw_ena, OID_AUTO, log_level, CTLFLAG_RWTUN, + &ena_log_level, 0, "Logging level indicating verbosity of the logs"); + + void ena_sysctl_add_nodes(struct ena_adapter *adapter) { ena_sysctl_add_wd(adapter); ena_sysctl_add_stats(adapter); + ena_sysctl_add_tuneables(adapter); } static void @@ -249,3 +263,92 @@ ena_sysctl_add_stats(struct ena_adapter *adapter) &admin_stats->no_completion, 0, "Commands not completed"); } +static void +ena_sysctl_add_tuneables(struct ena_adapter *adapter) +{ + device_t dev; + + struct sysctl_ctx_list *ctx; + struct sysctl_oid *tree; + struct sysctl_oid_list *child; + + dev = adapter->pdev; + + ctx = device_get_sysctl_ctx(dev); + tree = device_get_sysctl_tree(dev); + child = SYSCTL_CHILDREN(tree); + + /* Tuneable number of buffers in the buf-ring (drbr) */ + SYSCTL_ADD_PROC(ctx, child, OID_AUTO, "buf_ring_size", CTLTYPE_INT | + CTLFLAG_RW, adapter, 0, ena_sysctl_buf_ring_size, "I", + "Size of the bufring"); + + /* Tuneable number of Rx ring size */ + SYSCTL_ADD_PROC(ctx, child, OID_AUTO, "rx_queue_size", CTLTYPE_INT | + CTLFLAG_RW, adapter, 0, ena_sysctl_rx_queue_size, "I", + "Size of the Rx ring. The size should be a power of 2. " + "Max value is 8K"); +} + + +static int +ena_sysctl_buf_ring_size(SYSCTL_HANDLER_ARGS) +{ + struct ena_adapter *adapter = arg1; + int val; + int error; + + val = 0; + error = sysctl_wire_old_buffer(req, sizeof(int)); + if (error == 0) { + val = adapter->buf_ring_size; + error = sysctl_handle_int(oidp, &val, 0, req); + } + if (error != 0 || req->newptr == NULL) + return (error); + if (val < 0) + return (EINVAL); + + device_printf(adapter->pdev, + "Requested new buf ring size: %d. Old size: %d\n", + val, adapter->buf_ring_size); + + if (val != adapter->buf_ring_size) { + adapter->buf_ring_size = val; + adapter->reset_reason = ENA_REGS_RESET_OS_TRIGGER; + adapter->trigger_reset = true; + } + + return (0); +} + +static int +ena_sysctl_rx_queue_size(SYSCTL_HANDLER_ARGS) +{ + struct ena_adapter *adapter = arg1; + int val; + int error; + + val = 0; + error = sysctl_wire_old_buffer(req, sizeof(int)); + if (error == 0) { + val = adapter->rx_ring_size; + error = sysctl_handle_int(oidp, &val, 0, req); + } + if (error != 0 || req->newptr == NULL) + return (error); + if (val < 16) + return (EINVAL); + + device_printf(adapter->pdev, + "Requested new rx queue size: %d. Old size: %d\n", + val, adapter->rx_ring_size); + + if (val != adapter->rx_ring_size) { + adapter->rx_ring_size = val; + adapter->reset_reason = ENA_REGS_RESET_OS_TRIGGER; + adapter->trigger_reset = true; + } + + return (0); +} From owner-svn-src-head@freebsd.org Thu May 30 13:29:26 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BD1B815C2B6B; Thu, 30 May 2019 13:29:25 +0000 (UTC) (envelope-from mw@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 633FD8A0F9; Thu, 30 May 2019 13:29:25 +0000 (UTC) (envelope-from mw@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 38FA019B07; Thu, 30 May 2019 13:29:25 +0000 (UTC) (envelope-from mw@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x4UDTPgN066574; Thu, 30 May 2019 13:29:25 GMT (envelope-from mw@FreeBSD.org) Received: (from mw@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4UDTOww066571; Thu, 30 May 2019 13:29:24 GMT (envelope-from mw@FreeBSD.org) Message-Id: <201905301329.x4UDTOww066571@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mw set sender to mw@FreeBSD.org using -f From: Marcin Wojtas Date: Thu, 30 May 2019 13:29:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r348402 - head/sys/dev/ena X-SVN-Group: head X-SVN-Commit-Author: mw X-SVN-Commit-Paths: head/sys/dev/ena X-SVN-Commit-Revision: 348402 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 633FD8A0F9 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.98 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.98)[-0.981,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 30 May 2019 13:29:26 -0000 Author: mw Date: Thu May 30 13:29:24 2019 New Revision: 348402 URL: https://svnweb.freebsd.org/changeset/base/348402 Log: Lock optimization in ENA Handle IO interrupts using filter routine. That way, the main cleanup task could be moved to the separate thread using taskqueue. The deferred Rx cleanup task was removed, and now the cleanup task is begin called instead. That way, the Rx lock could be removed. In addition, Queue management (wake up and stop TX ring) was added, so the TX cleanup task can be performed mostly lockless. Submitted by: Michal Krawczyk Obtained from: Semihalf Sponsored by: Amazon, Inc. Modified: head/sys/dev/ena/ena.c head/sys/dev/ena/ena.h head/sys/dev/ena/ena_sysctl.c Modified: head/sys/dev/ena/ena.c ============================================================================== --- head/sys/dev/ena/ena.c Thu May 30 13:28:03 2019 (r348401) +++ head/sys/dev/ena/ena.c Thu May 30 13:29:24 2019 (r348402) @@ -120,7 +120,6 @@ static void ena_destroy_all_rx_queues(struct ena_adapt static void ena_destroy_all_io_queues(struct ena_adapter *); static int ena_create_io_queues(struct ena_adapter *); static int ena_tx_cleanup(struct ena_ring *); -static void ena_deferred_rx_cleanup(void *, int); static int ena_rx_cleanup(struct ena_ring *); static inline int validate_tx_req_id(struct ena_ring *, uint16_t); static void ena_rx_hash_mbuf(struct ena_ring *, struct ena_com_rx_ctx *, @@ -129,7 +128,8 @@ static struct mbuf* ena_rx_mbuf(struct ena_ring *, str struct ena_com_rx_ctx *, uint16_t *); static inline void ena_rx_checksum(struct ena_ring *, struct ena_com_rx_ctx *, struct mbuf *); -static void ena_handle_msix(void *); +static void ena_cleanup(void *arg, int pending); +static int ena_handle_msix(void *); static int ena_enable_msix(struct ena_adapter *); static void ena_setup_mgmnt_intr(struct ena_adapter *); static void ena_setup_io_intr(struct ena_adapter *); @@ -450,7 +450,6 @@ ena_init_io_rings(struct ena_adapter *adapter) device_get_nameunit(adapter->pdev), i); mtx_init(&txr->ring_mtx, txr->mtx_name, NULL, MTX_DEF); - mtx_init(&rxr->ring_mtx, rxr->mtx_name, NULL, MTX_DEF); que = &adapter->que[i]; que->adapter = adapter; @@ -481,7 +480,6 @@ ena_free_io_ring_resources(struct ena_adapter *adapter ENA_RING_MTX_UNLOCK(txr); mtx_destroy(&txr->ring_mtx); - mtx_destroy(&rxr->ring_mtx); } static void @@ -627,6 +625,8 @@ ena_setup_tx_resources(struct ena_adapter *adapter, in goto err_buf_info_unmap; } + tx_ring->running = true; + taskqueue_start_threads(&tx_ring->enqueue_tq, 1, PI_NET, "%s txeq %d", device_get_nameunit(adapter->pdev), que->cpu); @@ -811,14 +811,6 @@ ena_setup_rx_resources(struct ena_adapter *adapter, un } } - /* Allocate taskqueues */ - TASK_INIT(&rx_ring->cmpl_task, 0, ena_deferred_rx_cleanup, rx_ring); - rx_ring->cmpl_tq = taskqueue_create_fast("ena RX completion", M_WAITOK, - taskqueue_thread_enqueue, &rx_ring->cmpl_tq); - - taskqueue_start_threads(&rx_ring->cmpl_tq, 1, PI_NET, - "%s rx_ring cmpl %d", device_get_nameunit(adapter->pdev), que->cpu); - return (0); err_buf_info_unmap: @@ -846,11 +838,6 @@ ena_free_rx_resources(struct ena_adapter *adapter, uns { struct ena_ring *rx_ring = &adapter->rx_ring[qid]; - while (taskqueue_cancel(rx_ring->cmpl_tq, &rx_ring->cmpl_task, NULL) != 0) - taskqueue_drain(rx_ring->cmpl_tq, &rx_ring->cmpl_task); - - taskqueue_free(rx_ring->cmpl_tq); - /* Free buffer DMA maps, */ for (int i = 0; i < rx_ring->ring_size; i++) { bus_dmamap_sync(adapter->rx_buf_tag, @@ -1176,6 +1163,18 @@ ena_destroy_all_rx_queues(struct ena_adapter *adapter) static void ena_destroy_all_io_queues(struct ena_adapter *adapter) { + struct ena_que *queue; + int i; + + for (i = 0; i < adapter->num_queues; i++) { + queue = &adapter->que[i]; + while (taskqueue_cancel(queue->cleanup_tq, + &queue->cleanup_task, NULL)) + taskqueue_drain(queue->cleanup_tq, + &queue->cleanup_task); + taskqueue_free(queue->cleanup_tq); + } + ena_destroy_all_tx_queues(adapter); ena_destroy_all_rx_queues(adapter); } @@ -1206,6 +1205,7 @@ ena_create_io_queues(struct ena_adapter *adapter) struct ena_com_dev *ena_dev = adapter->ena_dev; struct ena_com_create_io_ctx ctx; struct ena_ring *ring; + struct ena_que *queue; uint16_t ena_qid; uint32_t msix_vector; int rc, i; @@ -1267,6 +1267,18 @@ ena_create_io_queues(struct ena_adapter *adapter) } } + for (i = 0; i < adapter->num_queues; i++) { + queue = &adapter->que[i]; + + TASK_INIT(&queue->cleanup_task, 0, ena_cleanup, queue); + queue->cleanup_tq = taskqueue_create_fast("ena cleanup", + M_WAITOK, taskqueue_thread_enqueue, &queue->cleanup_tq); + + taskqueue_start_threads(&queue->cleanup_tq, 1, PI_NET, + "%s queue %d cleanup", + device_get_nameunit(adapter->pdev), i); + } + return (0); err_rx: @@ -1304,6 +1316,7 @@ ena_tx_cleanup(struct ena_ring *tx_ring) int commit = TX_COMMIT; int budget = TX_BUDGET; int work_done; + bool above_thresh; adapter = tx_ring->que->adapter; ena_qid = ENA_IO_TXQ_IDX(tx_ring->que->id); @@ -1372,8 +1385,28 @@ ena_tx_cleanup(struct ena_ring *tx_ring) ena_com_update_dev_comp_head(io_cq); } - taskqueue_enqueue(tx_ring->enqueue_tq, &tx_ring->enqueue_task); + /* + * Need to make the rings circular update visible to + * ena_xmit_mbuf() before checking for tx_ring->running. + */ + mb(); + above_thresh = ena_com_sq_have_enough_space(tx_ring->ena_com_io_sq, + ENA_TX_RESUME_THRESH); + if (unlikely(!tx_ring->running && above_thresh)) { + ENA_RING_MTX_LOCK(tx_ring); + above_thresh = + ena_com_sq_have_enough_space(tx_ring->ena_com_io_sq, + ENA_TX_RESUME_THRESH); + if (!tx_ring->running && above_thresh) { + tx_ring->running = true; + counter_u64_add(tx_ring->tx_stats.queue_wakeup, 1); + taskqueue_enqueue(tx_ring->enqueue_tq, + &tx_ring->enqueue_task); + } + ENA_RING_MTX_UNLOCK(tx_ring); + } + return (work_done); } @@ -1581,24 +1614,6 @@ ena_rx_checksum(struct ena_ring *rx_ring, struct ena_c } } -static void -ena_deferred_rx_cleanup(void *arg, int pending) -{ - struct ena_ring *rx_ring = arg; - int budget = CLEAN_BUDGET; - - ENA_RING_MTX_LOCK(rx_ring); - /* - * If deferred task was executed, perform cleanup of all awaiting - * descs (or until given budget is depleted to avoid infinite loop). - */ - while (likely(budget--)) { - if (ena_rx_cleanup(rx_ring) == 0) - break; - } - ENA_RING_MTX_UNLOCK(rx_ring); -} - /** * ena_rx_cleanup - handle rx irq * @arg: ring for which irq is being handled @@ -1753,12 +1768,8 @@ ena_intr_msix_mgmnt(void *arg) ena_com_aenq_intr_handler(adapter->ena_dev, arg); } -/** - * ena_handle_msix - MSIX Interrupt Handler for Tx/Rx - * @arg: interrupt number - **/ static void -ena_handle_msix(void *arg) +ena_cleanup(void *arg, int pending) { struct ena_que *que = arg; struct ena_adapter *adapter = que->adapter; @@ -1785,22 +1796,8 @@ ena_handle_msix(void *arg) rx_ring->first_interrupt = true; for (i = 0; i < CLEAN_BUDGET; ++i) { - /* - * If lock cannot be acquired, then deferred cleanup task was - * being executed and rx ring is being cleaned up in - * another thread. - */ - if (likely(ENA_RING_MTX_TRYLOCK(rx_ring) != 0)) { - rxc = ena_rx_cleanup(rx_ring); - ENA_RING_MTX_UNLOCK(rx_ring); - } else { - rxc = 0; - } - - /* Protection from calling ena_tx_cleanup from ena_start_xmit */ - ENA_RING_MTX_LOCK(tx_ring); + rxc = ena_rx_cleanup(rx_ring); txc = ena_tx_cleanup(tx_ring); - ENA_RING_MTX_UNLOCK(tx_ring); if (unlikely((if_getdrvflags(ifp) & IFF_DRV_RUNNING) == 0)) return; @@ -1817,7 +1814,26 @@ ena_handle_msix(void *arg) ena_com_unmask_intr(io_cq, &intr_reg); } +/** + * ena_handle_msix - MSIX Interrupt Handler for Tx/Rx + * @arg: queue + **/ static int +ena_handle_msix(void *arg) +{ + struct ena_que *queue = arg; + struct ena_adapter *adapter = queue->adapter; + if_t ifp = adapter->ifp; + + if (unlikely((if_getdrvflags(ifp) & IFF_DRV_RUNNING) == 0)) + return (FILTER_STRAY); + + taskqueue_enqueue(queue->cleanup_tq, &queue->cleanup_task); + + return (FILTER_HANDLED); +} + +static int ena_enable_msix(struct ena_adapter *adapter) { device_t dev = adapter->pdev; @@ -1997,8 +2013,8 @@ ena_request_io_irq(struct ena_adapter *adapter) } rc = bus_setup_intr(adapter->pdev, irq->res, - INTR_TYPE_NET | INTR_MPSAFE, NULL, - irq->handler, irq->data, &irq->cookie); + INTR_TYPE_NET | INTR_MPSAFE, irq->handler, NULL, + irq->data, &irq->cookie); if (unlikely(rc != 0)) { device_printf(adapter->pdev, "failed to register " "interrupt handler for irq %ju: %d\n", @@ -2834,6 +2850,34 @@ ena_xmit_mbuf(struct ena_ring *tx_ring, struct mbuf ** tx_ring->next_to_use = ENA_TX_RING_IDX_NEXT(next_to_use, tx_ring->ring_size); + /* stop the queue when no more space available, the packet can have up + * to sgl_size + 2. one for the meta descriptor and one for header + * (if the header is larger than tx_max_header_size). + */ + if (unlikely(!ena_com_sq_have_enough_space(tx_ring->ena_com_io_sq, + adapter->max_tx_sgl_size + 2))) { + ena_trace(ENA_DBG | ENA_TXPTH, "Stop queue %d\n", + tx_ring->que->id); + + tx_ring->running = false; + counter_u64_add(tx_ring->tx_stats.queue_stop, 1); + + /* There is a rare condition where this function decides to + * stop the queue but meanwhile tx_cleanup() updates + * next_to_completion and terminates. + * The queue will remain stopped forever. + * To solve this issue this function performs mb(), checks + * the wakeup condition and wakes up the queue if needed. + */ + mb(); + + if (ena_com_sq_have_enough_space(tx_ring->ena_com_io_sq, + ENA_TX_RESUME_THRESH)) { + tx_ring->running = true; + counter_u64_add(tx_ring->tx_stats.queue_wakeup, 1); + } + } + bus_dmamap_sync(adapter->tx_buf_tag, tx_info->map, BUS_DMASYNC_PREWRITE); @@ -2870,9 +2914,10 @@ ena_start_xmit(struct ena_ring *tx_ring) " header csum flags %#jx", mbuf, mbuf->m_flags, (uint64_t)mbuf->m_pkthdr.csum_flags); - if (unlikely(ena_com_free_desc(io_sq) <= - ENA_TX_CLEANUP_THRESHOLD)) - ena_tx_cleanup(tx_ring); + if (unlikely(!tx_ring->running)) { + drbr_putback(adapter->ifp, tx_ring->br, mbuf); + break; + } if (unlikely((ret = ena_xmit_mbuf(tx_ring, &mbuf)) != 0)) { if (ret == ENA_COM_NO_MEM) { @@ -2914,8 +2959,9 @@ ena_start_xmit(struct ena_ring *tx_ring) counter_u64_add(tx_ring->tx_stats.doorbells, 1); } - if (ena_com_free_desc(io_sq) <= ENA_TX_CLEANUP_THRESHOLD) - ena_tx_cleanup(tx_ring); + if (unlikely(!tx_ring->running)) + taskqueue_enqueue(tx_ring->que->cleanup_tq, + &tx_ring->que->cleanup_task); } static void @@ -2925,6 +2971,7 @@ ena_deferred_mq_start(void *arg, int pending) struct ifnet *ifp = tx_ring->adapter->ifp; while (!drbr_empty(ifp, tx_ring->br) && + tx_ring->running && (if_getdrvflags(ifp) & IFF_DRV_RUNNING) != 0) { ENA_RING_MTX_LOCK(tx_ring); ena_start_xmit(tx_ring); @@ -3575,7 +3622,7 @@ check_for_missing_completions(struct ena_adapter *adap adapter->next_monitored_tx_qid = i % adapter->num_queues; } -/* trigger deferred rx cleanup after 2 consecutive detections */ +/* trigger rx cleanup after 2 consecutive detections */ #define EMPTY_RX_REFILL 2 /* For the rare case where the device runs out of Rx descriptors and the * msix handler failed to refill new Rx descriptors (due to a lack of memory @@ -3613,8 +3660,8 @@ check_for_empty_rx_ring(struct ena_adapter *adapter) device_printf(adapter->pdev, "trigger refill for ring %d\n", i); - taskqueue_enqueue(rx_ring->cmpl_tq, - &rx_ring->cmpl_task); + taskqueue_enqueue(rx_ring->que->cleanup_tq, + &rx_ring->que->cleanup_task); rx_ring->empty_rx_queue = 0; } } else { Modified: head/sys/dev/ena/ena.h ============================================================================== --- head/sys/dev/ena/ena.h Thu May 30 13:28:03 2019 (r348401) +++ head/sys/dev/ena/ena.h Thu May 30 13:29:24 2019 (r348402) @@ -84,7 +84,7 @@ #define ENA_MAX_FRAME_LEN 10000 #define ENA_MIN_FRAME_LEN 60 -#define ENA_TX_CLEANUP_THRESHOLD 128 +#define ENA_TX_RESUME_THRESH (ENA_PKT_MAX_BUFS + 2) #define DB_THRESHOLD 64 @@ -163,7 +163,7 @@ typedef struct _ena_vendor_info_t { struct ena_irq { /* Interrupt resources */ struct resource *res; - driver_intr_t *handler; + driver_filter_t *handler; void *data; void *cookie; unsigned int vector; @@ -176,6 +176,10 @@ struct ena_que { struct ena_adapter *adapter; struct ena_ring *tx_ring; struct ena_ring *rx_ring; + + struct task cleanup_task; + struct taskqueue *cleanup_tq; + uint32_t id; int cpu; }; @@ -222,6 +226,8 @@ struct ena_stats_tx { counter_u64_t bad_req_id; counter_u64_t collapse; counter_u64_t collapse_err; + counter_u64_t queue_wakeup; + counter_u64_t queue_stop; }; struct ena_stats_rx { @@ -285,15 +291,9 @@ struct ena_ring { struct mtx ring_mtx; char mtx_name[16]; - union { - struct { - struct task enqueue_task; - struct taskqueue *enqueue_tq; - }; - struct { - struct task cmpl_task; - struct taskqueue *cmpl_tq; - }; + struct { + struct task enqueue_task; + struct taskqueue *enqueue_tq; }; union { @@ -301,7 +301,11 @@ struct ena_ring { struct ena_stats_rx rx_stats; }; - int empty_rx_queue; + union { + int empty_rx_queue; + /* For Tx ring to indicate if it's running or not */ + bool running; + }; } __aligned(CACHE_LINE_SIZE); struct ena_stats_dev { Modified: head/sys/dev/ena/ena_sysctl.c ============================================================================== --- head/sys/dev/ena/ena_sysctl.c Thu May 30 13:28:03 2019 (r348401) +++ head/sys/dev/ena/ena_sysctl.c Thu May 30 13:29:24 2019 (r348402) @@ -190,6 +190,12 @@ ena_sysctl_add_stats(struct ena_adapter *adapter) "mbuf_collapse_err", CTLFLAG_RD, &tx_stats->collapse_err, "Mbuf collapse failures"); + SYSCTL_ADD_COUNTER_U64(ctx, tx_list, OID_AUTO, + "queue_wakeups", CTLFLAG_RD, + &tx_stats->queue_wakeup, "Queue wakeups"); + SYSCTL_ADD_COUNTER_U64(ctx, tx_list, OID_AUTO, + "queue_stops", CTLFLAG_RD, + &tx_stats->queue_stop, "Queue stops"); /* RX specific stats */ rx_node = SYSCTL_ADD_NODE(ctx, queue_list, OID_AUTO, From owner-svn-src-head@freebsd.org Thu May 30 13:30:54 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 60A2215C2C69; Thu, 30 May 2019 13:30:54 +0000 (UTC) (envelope-from mw@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id E51978A471; Thu, 30 May 2019 13:30:53 +0000 (UTC) (envelope-from mw@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D74D019B1E; Thu, 30 May 2019 13:30:53 +0000 (UTC) (envelope-from mw@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x4UDUrw8066707; Thu, 30 May 2019 13:30:53 GMT (envelope-from mw@FreeBSD.org) Received: (from mw@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4UDUrMk066704; Thu, 30 May 2019 13:30:53 GMT (envelope-from mw@FreeBSD.org) Message-Id: <201905301330.x4UDUrMk066704@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mw set sender to mw@FreeBSD.org using -f From: Marcin Wojtas Date: Thu, 30 May 2019 13:30:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r348403 - head/sys/dev/ena X-SVN-Group: head X-SVN-Commit-Author: mw X-SVN-Commit-Paths: head/sys/dev/ena X-SVN-Commit-Revision: 348403 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: E51978A471 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.98 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.98)[-0.981,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 30 May 2019 13:30:54 -0000 Author: mw Date: Thu May 30 13:30:52 2019 New Revision: 348403 URL: https://svnweb.freebsd.org/changeset/base/348403 Log: Add support for the LLQv2 and WC in ENA LLQ (Low Latency Queue) is the feature, that allows pushing header directly to the device through PCI before even DMA is triggered. It reduces latency, because device can start preparing packet before payload is sent through DMA. To speed up sending data through PCI, the Write Combining is enabled, which allows hardware to buffer data before sending them on the PCI - it allows to reduce number of PCI IO operations. ENAv2 is using special descriptor for the negotiation of the LLQ. Currently, only the default configuration is supported. Submitted by: Michal Krawczyk Obtained from: Semihalf Sponsored by: Amazon, Inc. Modified: head/sys/dev/ena/ena.c head/sys/dev/ena/ena.h head/sys/dev/ena/ena_sysctl.c Modified: head/sys/dev/ena/ena.c ============================================================================== --- head/sys/dev/ena/ena.c Thu May 30 13:29:24 2019 (r348402) +++ head/sys/dev/ena/ena.c Thu May 30 13:30:52 2019 (r348403) @@ -73,6 +73,9 @@ __FBSDID("$FreeBSD$"); #include #include +#include +#include + #include "ena.h" #include "ena_sysctl.h" @@ -81,7 +84,6 @@ __FBSDID("$FreeBSD$"); *********************************************************/ static int ena_probe(device_t); static void ena_intr_msix_mgmnt(void *); -static int ena_allocate_pci_resources(struct ena_adapter*); static void ena_free_pci_resources(struct ena_adapter *); static int ena_change_mtu(if_t, int); static inline void ena_alloc_counters(counter_u64_t *, int); @@ -157,11 +159,15 @@ static int ena_setup_ifnet(device_t, struct ena_adapte static void ena_tx_csum(struct ena_com_tx_ctx *, struct mbuf *); static int ena_check_and_collapse_mbuf(struct ena_ring *tx_ring, struct mbuf **mbuf); +static void ena_dmamap_llq(void *, bus_dma_segment_t *, int, int); static int ena_xmit_mbuf(struct ena_ring *, struct mbuf **); static void ena_start_xmit(struct ena_ring *); static int ena_mq_start(if_t, struct mbuf *); static void ena_deferred_mq_start(void *, int); static void ena_qflush(if_t); +static int ena_enable_wc(struct resource *); +static int ena_set_queues_placement_policy(device_t, struct ena_com_dev *, + struct ena_admin_feature_llq_desc *, struct ena_llq_configurations *); static int ena_calc_io_queue_num(struct ena_adapter *, struct ena_com_dev_get_features_ctx *); static int ena_calc_queue_size(struct ena_adapter *, @@ -271,25 +277,6 @@ fail_tag: return (error); } -static int -ena_allocate_pci_resources(struct ena_adapter* adapter) -{ - device_t pdev = adapter->pdev; - int rid; - - rid = PCIR_BAR(ENA_REG_BAR); - adapter->memory = NULL; - adapter->registers = bus_alloc_resource_any(pdev, SYS_RES_MEMORY, - &rid, RF_ACTIVE); - if (unlikely(adapter->registers == NULL)) { - device_printf(pdev, "Unable to allocate bus resource: " - "registers\n"); - return (ENXIO); - } - - return (0); -} - static void ena_free_pci_resources(struct ena_adapter *adapter) { @@ -587,6 +574,12 @@ ena_setup_tx_resources(struct ena_adapter *adapter, in if (unlikely(tx_ring->free_tx_ids == NULL)) goto err_buf_info_free; + size = tx_ring->tx_max_header_size; + tx_ring->push_buf_intermediate_buf = malloc(size, M_DEVBUF, + M_NOWAIT | M_ZERO); + if (unlikely(tx_ring->push_buf_intermediate_buf == NULL)) + goto err_tx_ids_free; + /* Req id stack for TX OOO completions */ for (i = 0; i < tx_ring->ring_size; i++) tx_ring->free_tx_ids[i] = i; @@ -606,12 +599,24 @@ ena_setup_tx_resources(struct ena_adapter *adapter, in /* ... and create the buffer DMA maps */ for (i = 0; i < tx_ring->ring_size; i++) { err = bus_dmamap_create(adapter->tx_buf_tag, 0, - &tx_ring->tx_buffer_info[i].map); + &tx_ring->tx_buffer_info[i].map_head); if (unlikely(err != 0)) { ena_trace(ENA_ALERT, - "Unable to create Tx DMA map for buffer %d\n", i); + "Unable to create Tx DMA map_head for buffer %d\n", + i); goto err_buf_info_unmap; } + tx_ring->tx_buffer_info[i].seg_mapped = false; + + err = bus_dmamap_create(adapter->tx_buf_tag, 0, + &tx_ring->tx_buffer_info[i].map_seg); + if (unlikely(err != 0)) { + ena_trace(ENA_ALERT, + "Unable to create Tx DMA map_seg for buffer %d\n", + i); + goto err_buf_info_head_unmap; + } + tx_ring->tx_buffer_info[i].head_mapped = false; } /* Allocate taskqueues */ @@ -632,11 +637,18 @@ ena_setup_tx_resources(struct ena_adapter *adapter, in return (0); +err_buf_info_head_unmap: + bus_dmamap_destroy(adapter->tx_buf_tag, + tx_ring->tx_buffer_info[i].map_head); err_buf_info_unmap: while (i--) { bus_dmamap_destroy(adapter->tx_buf_tag, - tx_ring->tx_buffer_info[i].map); + tx_ring->tx_buffer_info[i].map_head); + bus_dmamap_destroy(adapter->tx_buf_tag, + tx_ring->tx_buffer_info[i].map_seg); } + free(tx_ring->push_buf_intermediate_buf, M_DEVBUF); +err_tx_ids_free: free(tx_ring->free_tx_ids, M_DEVBUF); tx_ring->free_tx_ids = NULL; err_buf_info_free: @@ -670,12 +682,28 @@ ena_free_tx_resources(struct ena_adapter *adapter, int /* Free buffer DMA maps, */ for (int i = 0; i < tx_ring->ring_size; i++) { - bus_dmamap_sync(adapter->tx_buf_tag, - tx_ring->tx_buffer_info[i].map, BUS_DMASYNC_POSTWRITE); - bus_dmamap_unload(adapter->tx_buf_tag, - tx_ring->tx_buffer_info[i].map); + if (tx_ring->tx_buffer_info[i].head_mapped == true) { + bus_dmamap_sync(adapter->tx_buf_tag, + tx_ring->tx_buffer_info[i].map_head, + BUS_DMASYNC_POSTWRITE); + bus_dmamap_unload(adapter->tx_buf_tag, + tx_ring->tx_buffer_info[i].map_head); + tx_ring->tx_buffer_info[i].head_mapped = false; + } bus_dmamap_destroy(adapter->tx_buf_tag, - tx_ring->tx_buffer_info[i].map); + tx_ring->tx_buffer_info[i].map_head); + + if (tx_ring->tx_buffer_info[i].seg_mapped == true) { + bus_dmamap_sync(adapter->tx_buf_tag, + tx_ring->tx_buffer_info[i].map_seg, + BUS_DMASYNC_POSTWRITE); + bus_dmamap_unload(adapter->tx_buf_tag, + tx_ring->tx_buffer_info[i].map_seg); + tx_ring->tx_buffer_info[i].seg_mapped = false; + } + bus_dmamap_destroy(adapter->tx_buf_tag, + tx_ring->tx_buffer_info[i].map_seg); + m_freem(tx_ring->tx_buffer_info[i].mbuf); tx_ring->tx_buffer_info[i].mbuf = NULL; } @@ -687,6 +715,10 @@ ena_free_tx_resources(struct ena_adapter *adapter, int free(tx_ring->free_tx_ids, M_DEVBUF); tx_ring->free_tx_ids = NULL; + + ENA_MEM_FREE(adapter->ena_dev->dmadev, + tx_ring->push_buf_intermediate_buf); + tx_ring->push_buf_intermediate_buf = NULL; } /** @@ -1119,9 +1151,22 @@ ena_free_tx_bufs(struct ena_adapter *adapter, unsigned qid, i); } - bus_dmamap_sync(adapter->tx_buf_tag, tx_info->map, - BUS_DMASYNC_POSTWRITE); - bus_dmamap_unload(adapter->tx_buf_tag, tx_info->map); + if (tx_info->head_mapped == true) { + bus_dmamap_sync(adapter->tx_buf_tag, tx_info->map_head, + BUS_DMASYNC_POSTWRITE); + bus_dmamap_unload(adapter->tx_buf_tag, + tx_info->map_head); + tx_info->head_mapped = false; + } + + if (tx_info->seg_mapped == true) { + bus_dmamap_sync(adapter->tx_buf_tag, tx_info->map_seg, + BUS_DMASYNC_POSTWRITE); + bus_dmamap_unload(adapter->tx_buf_tag, + tx_info->map_seg); + tx_info->seg_mapped = false; + } + m_free(tx_info->mbuf); tx_info->mbuf = NULL; } @@ -1342,12 +1387,21 @@ ena_tx_cleanup(struct ena_ring *tx_ring) tx_info->mbuf = NULL; bintime_clear(&tx_info->timestamp); - if (likely(tx_info->num_of_bufs != 0)) { - /* Map is no longer required */ - bus_dmamap_sync(adapter->tx_buf_tag, tx_info->map, + /* Map is no longer required */ + if (tx_info->head_mapped == true) { + bus_dmamap_sync(adapter->tx_buf_tag, tx_info->map_head, BUS_DMASYNC_POSTWRITE); - bus_dmamap_unload(adapter->tx_buf_tag, tx_info->map); + bus_dmamap_unload(adapter->tx_buf_tag, + tx_info->map_head); + tx_info->head_mapped = false; } + if (tx_info->seg_mapped == true) { + bus_dmamap_sync(adapter->tx_buf_tag, tx_info->map_seg, + BUS_DMASYNC_POSTWRITE); + bus_dmamap_unload(adapter->tx_buf_tag, + tx_info->map_seg); + tx_info->seg_mapped = false; + } ena_trace(ENA_DBG | ENA_TXPTH, "tx: q %d mbuf %p completed", tx_ring->qid, mbuf); @@ -2736,23 +2790,186 @@ ena_check_and_collapse_mbuf(struct ena_ring *tx_ring, return (0); } +static void +ena_dmamap_llq(void *arg, bus_dma_segment_t *segs, int nseg, int error) +{ + struct ena_com_buf *ena_buf = arg; + + if (unlikely(error != 0)) { + ena_buf->paddr = 0; + return; + } + + KASSERT(nseg == 1, ("Invalid num of segments for LLQ dma")); + + ena_buf->paddr = segs->ds_addr; + ena_buf->len = segs->ds_len; +} + static int +ena_tx_map_mbuf(struct ena_ring *tx_ring, struct ena_tx_buffer *tx_info, + struct mbuf *mbuf, void **push_hdr, u16 *header_len) +{ + struct ena_adapter *adapter = tx_ring->adapter; + struct ena_com_buf *ena_buf; + bus_dma_segment_t segs[ENA_BUS_DMA_SEGS]; + uint32_t mbuf_head_len, frag_len; + uint16_t push_len = 0; + uint16_t delta = 0; + int i, rc, nsegs; + + mbuf_head_len = mbuf->m_len; + tx_info->mbuf = mbuf; + ena_buf = tx_info->bufs; + + if (tx_ring->tx_mem_queue_type == ENA_ADMIN_PLACEMENT_POLICY_DEV) { + /* + * When the device is LLQ mode, the driver will copy + * the header into the device memory space. + * the ena_com layer assumes the header is in a linear + * memory space. + * This assumption might be wrong since part of the header + * can be in the fragmented buffers. + * First check if header fits in the mbuf. If not, copy it to + * separate buffer that will be holding linearized data. + */ + push_len = min_t(uint32_t, mbuf->m_pkthdr.len, + tx_ring->tx_max_header_size); + *header_len = push_len; + /* If header is in linear space, just point into mbuf's data. */ + if (likely(push_len <= mbuf_head_len)) { + *push_hdr = mbuf->m_data; + /* + * Otherwise, copy whole portion of header from multiple mbufs + * to intermediate buffer. + */ + } else { + m_copydata(mbuf, 0, push_len, + tx_ring->push_buf_intermediate_buf); + *push_hdr = tx_ring->push_buf_intermediate_buf; + + counter_u64_add(tx_ring->tx_stats.llq_buffer_copy, 1); + delta = push_len - mbuf_head_len; + } + + ena_trace(ENA_DBG | ENA_TXPTH, + "mbuf: %p header_buf->vaddr: %p push_len: %d\n", + mbuf, *push_hdr, push_len); + + /* + * If header was in linear memory space, map for the dma rest of the data + * in the first mbuf of the mbuf chain. + */ + if (mbuf_head_len > push_len) { + rc = bus_dmamap_load(adapter->tx_buf_tag, + tx_info->map_head, + mbuf->m_data + push_len, mbuf_head_len - push_len, + ena_dmamap_llq, ena_buf, BUS_DMA_NOWAIT); + if (unlikely((rc != 0) || (ena_buf->paddr == 0))) + goto single_dma_error; + + ena_buf++; + tx_info->num_of_bufs++; + + tx_info->head_mapped = true; + } + mbuf = mbuf->m_next; + } else { + *push_hdr = NULL; + /* + * header_len is just a hint for the device. Because FreeBSD is not + * giving us information about packet header length and it is not + * guaranteed that all packet headers will be in the 1st mbuf, setting + * header_len to 0 is making the device ignore this value and resolve + * header on it's own. + */ + *header_len = 0; + } + + /* + * If header is in non linear space (delta > 0), then skip mbufs + * containing header and map the last one containing both header and the + * packet data. + * The first segment is already counted in. + * If LLQ is not supported, the loop will be skipped. + */ + while (delta > 0) { + frag_len = mbuf->m_len; + + /* + * If whole segment contains header just move to the + * next one and reduce delta. + */ + if (unlikely(delta >= frag_len)) { + delta -= frag_len; + } else { + /* + * Map rest of the packet data that was contained in + * the mbuf. + */ + rc = bus_dmamap_load(adapter->tx_buf_tag, + tx_info->map_head, mbuf->m_data + delta, + frag_len - delta, ena_dmamap_llq, ena_buf, + BUS_DMA_NOWAIT); + if (unlikely((rc != 0) || (ena_buf->paddr == 0))) + goto single_dma_error; + + ena_buf++; + tx_info->num_of_bufs++; + tx_info->head_mapped = true; + + delta = 0; + } + + mbuf = mbuf->m_next; + } + + if (mbuf == NULL) { + return (0); + } + + /* Map rest of the mbufs */ + rc = bus_dmamap_load_mbuf_sg(adapter->tx_buf_tag, tx_info->map_seg, mbuf, + segs, &nsegs, BUS_DMA_NOWAIT); + if (unlikely((rc != 0) || (nsegs == 0))) { + ena_trace(ENA_WARNING, + "dmamap load failed! err: %d nsegs: %d", rc, nsegs); + goto dma_error; + } + + for (i = 0; i < nsegs; i++) { + ena_buf->len = segs[i].ds_len; + ena_buf->paddr = segs[i].ds_addr; + ena_buf++; + } + tx_info->num_of_bufs += nsegs; + tx_info->seg_mapped = true; + + return (0); + +dma_error: + if (tx_info->head_mapped == true) + bus_dmamap_unload(adapter->tx_buf_tag, tx_info->map_head); +single_dma_error: + counter_u64_add(tx_ring->tx_stats.dma_mapping_err, 1); + tx_info->mbuf = NULL; + return (rc); +} + +static int ena_xmit_mbuf(struct ena_ring *tx_ring, struct mbuf **mbuf) { struct ena_adapter *adapter; struct ena_tx_buffer *tx_info; struct ena_com_tx_ctx ena_tx_ctx; struct ena_com_dev *ena_dev; - struct ena_com_buf *ena_buf; struct ena_com_io_sq* io_sq; - bus_dma_segment_t segs[ENA_BUS_DMA_SEGS]; void *push_hdr; uint16_t next_to_use; uint16_t req_id; - uint16_t push_len; uint16_t ena_qid; - uint32_t nsegs, header_len; - int i, rc; + uint16_t header_len; + int rc; int nb_hw_desc; ena_qid = ENA_IO_TXQ_IDX(tx_ring->que->id); @@ -2767,49 +2984,18 @@ ena_xmit_mbuf(struct ena_ring *tx_ring, struct mbuf ** return (rc); } + ena_trace(ENA_DBG | ENA_TXPTH, "Tx: %d bytes", (*mbuf)->m_pkthdr.len); + next_to_use = tx_ring->next_to_use; req_id = tx_ring->free_tx_ids[next_to_use]; tx_info = &tx_ring->tx_buffer_info[req_id]; - - tx_info->mbuf = *mbuf; tx_info->num_of_bufs = 0; - ena_buf = tx_info->bufs; - - ena_trace(ENA_DBG | ENA_TXPTH, "Tx: %d bytes", (*mbuf)->m_pkthdr.len); - - push_len = 0; - /* - * header_len is just a hint for the device. Because FreeBSD is not - * giving us information about packet header length and it is not - * guaranteed that all packet headers will be in the 1st mbuf, setting - * header_len to 0 is making the device ignore this value and resolve - * header on it's own. - */ - header_len = 0; - push_hdr = NULL; - - rc = bus_dmamap_load_mbuf_sg(adapter->tx_buf_tag, tx_info->map, - *mbuf, segs, &nsegs, BUS_DMA_NOWAIT); - - if (unlikely((rc != 0) || (nsegs == 0))) { - ena_trace(ENA_WARNING, - "dmamap load failed! err: %d nsegs: %d", rc, nsegs); - counter_u64_add(tx_ring->tx_stats.dma_mapping_err, 1); - tx_info->mbuf = NULL; - if (rc == ENOMEM) - return (ENA_COM_NO_MEM); - else - return (ENA_COM_INVAL); + rc = ena_tx_map_mbuf(tx_ring, tx_info, *mbuf, &push_hdr, &header_len); + if (unlikely(rc != 0)) { + ena_trace(ENA_WARNING, "Failed to map TX mbuf\n"); + return (rc); } - - for (i = 0; i < nsegs; i++) { - ena_buf->len = segs[i].ds_len; - ena_buf->paddr = segs[i].ds_addr; - ena_buf++; - } - tx_info->num_of_bufs = nsegs; - memset(&ena_tx_ctx, 0x0, sizeof(struct ena_com_tx_ctx)); ena_tx_ctx.ena_bufs = tx_info->bufs; ena_tx_ctx.push_header = push_hdr; @@ -2878,14 +3064,25 @@ ena_xmit_mbuf(struct ena_ring *tx_ring, struct mbuf ** } } - bus_dmamap_sync(adapter->tx_buf_tag, tx_info->map, - BUS_DMASYNC_PREWRITE); + if (tx_info->head_mapped == true) + bus_dmamap_sync(adapter->tx_buf_tag, tx_info->map_head, + BUS_DMASYNC_PREWRITE); + if (tx_info->seg_mapped == true) + bus_dmamap_sync(adapter->tx_buf_tag, tx_info->map_seg, + BUS_DMASYNC_PREWRITE); return (0); dma_error: tx_info->mbuf = NULL; - bus_dmamap_unload(adapter->tx_buf_tag, tx_info->map); + if (tx_info->seg_mapped == true) { + bus_dmamap_unload(adapter->tx_buf_tag, tx_info->map_seg); + tx_info->seg_mapped = false; + } + if (tx_info->head_mapped == true) { + bus_dmamap_unload(adapter->tx_buf_tag, tx_info->map_head); + tx_info->head_mapped = false; + } return (rc); } @@ -3043,27 +3240,33 @@ ena_calc_io_queue_num(struct ena_adapter *adapter, struct ena_com_dev_get_features_ctx *get_feat_ctx) { struct ena_com_dev *ena_dev = adapter->ena_dev; - int io_sq_num, io_cq_num, io_queue_num; + int io_tx_sq_num, io_tx_cq_num, io_rx_num, io_queue_num; /* Regular queues capabilities */ if (ena_dev->supported_features & BIT(ENA_ADMIN_MAX_QUEUES_EXT)) { struct ena_admin_queue_ext_feature_fields *max_queue_ext = &get_feat_ctx->max_queue_ext.max_queue_ext; - io_sq_num = max_queue_ext->max_rx_sq_num; - io_sq_num = min_t(int, io_sq_num, max_queue_ext->max_tx_sq_num); + io_rx_num = min_t(int, max_queue_ext->max_rx_sq_num, + max_queue_ext->max_rx_cq_num); - io_cq_num = max_queue_ext->max_rx_cq_num; - io_cq_num = min_t(int, io_cq_num, max_queue_ext->max_tx_cq_num); + io_tx_sq_num = max_queue_ext->max_tx_sq_num; + io_tx_cq_num = max_queue_ext->max_tx_cq_num; } else { struct ena_admin_queue_feature_desc *max_queues = &get_feat_ctx->max_queues; - io_sq_num = max_queues->max_sq_num; - io_cq_num = max_queues->max_cq_num; + io_tx_sq_num = max_queues->max_sq_num; + io_tx_cq_num = max_queues->max_cq_num; + io_rx_num = min_t(int, io_tx_sq_num, io_tx_cq_num); } + /* In case of LLQ use the llq fields for the tx SQ/CQ */ + if (ena_dev->tx_mem_queue_type == ENA_ADMIN_PLACEMENT_POLICY_DEV) + io_tx_sq_num = get_feat_ctx->llq.max_llq_num; + io_queue_num = min_t(int, mp_ncpus, ENA_MAX_NUM_IO_QUEUES); - io_queue_num = min_t(int, io_queue_num, io_sq_num); - io_queue_num = min_t(int, io_queue_num, io_cq_num); + io_queue_num = min_t(int, io_queue_num, io_rx_num); + io_queue_num = min_t(int, io_queue_num, io_tx_sq_num); + io_queue_num = min_t(int, io_queue_num, io_tx_cq_num); /* 1 IRQ for for mgmnt and 1 IRQ for each TX/RX pair */ io_queue_num = min_t(int, io_queue_num, pci_msix_count(adapter->pdev) - 1); @@ -3072,13 +3275,104 @@ ena_calc_io_queue_num(struct ena_adapter *adapter, } static int +ena_enable_wc(struct resource *res) +{ +#if defined(__i386) || defined(__amd64) + vm_offset_t va; + vm_size_t len; + int rc; + + va = (vm_offset_t)rman_get_virtual(res); + len = rman_get_size(res); + /* Enable write combining */ + rc = pmap_change_attr(va, len, PAT_WRITE_COMBINING); + if (unlikely(rc != 0)) { + ena_trace(ENA_ALERT, "pmap_change_attr failed, %d\n", rc); + return (rc); + } + + return (0); +#endif + return (EOPNOTSUPP); +} + +static int +ena_set_queues_placement_policy(device_t pdev, struct ena_com_dev *ena_dev, + struct ena_admin_feature_llq_desc *llq, + struct ena_llq_configurations *llq_default_configurations) +{ + struct ena_adapter *adapter = device_get_softc(pdev); + int rc, rid; + uint32_t llq_feature_mask; + + llq_feature_mask = 1 << ENA_ADMIN_LLQ; + if (!(ena_dev->supported_features & llq_feature_mask)) { + device_printf(pdev, + "LLQ is not supported. Fallback to host mode policy.\n"); + ena_dev->tx_mem_queue_type = ENA_ADMIN_PLACEMENT_POLICY_HOST; + return (0); + } + + rc = ena_com_config_dev_mode(ena_dev, llq, llq_default_configurations); + if (unlikely(rc != 0)) { + device_printf(pdev, "Failed to configure the device mode. " + "Fallback to host mode policy.\n"); + ena_dev->tx_mem_queue_type = ENA_ADMIN_PLACEMENT_POLICY_HOST; + return (0); + } + + /* Nothing to config, exit */ + if (ena_dev->tx_mem_queue_type == ENA_ADMIN_PLACEMENT_POLICY_HOST) + return (0); + + /* Try to allocate resources for LLQ bar */ + rid = PCIR_BAR(ENA_MEM_BAR); + adapter->memory = bus_alloc_resource_any(pdev, SYS_RES_MEMORY, + &rid, RF_ACTIVE); + if (unlikely(adapter->memory == NULL)) { + device_printf(pdev, "unable to allocate LLQ bar resource. " + "Fallback to host mode policy.\n"); + ena_dev->tx_mem_queue_type = ENA_ADMIN_PLACEMENT_POLICY_HOST; + return (0); + } + + /* Enable write combining for better LLQ performance */ + rc = ena_enable_wc(adapter->memory); + if (unlikely(rc != 0)) { + device_printf(pdev, "failed to enable write combining.\n"); + return (rc); + } + + /* + * Save virtual address of the device's memory region + * for the ena_com layer. + */ + ena_dev->mem_bar = rman_get_virtual(adapter->memory); + + return (0); +} + +static inline +void set_default_llq_configurations(struct ena_llq_configurations *llq_config) +{ + llq_config->llq_header_location = ENA_ADMIN_INLINE_HEADER; + llq_config->llq_ring_entry_size = ENA_ADMIN_LIST_ENTRY_SIZE_128B; + llq_config->llq_stride_ctrl = ENA_ADMIN_MULTIPLE_DESCS_PER_ENTRY; + llq_config->llq_num_decs_before_header = + ENA_ADMIN_LLQ_NUM_DESCS_BEFORE_HEADER_2; + llq_config->llq_ring_entry_size_value = 128; +} + +static int ena_calc_queue_size(struct ena_adapter *adapter, struct ena_calc_queue_size_ctx *ctx) { + struct ena_admin_feature_llq_desc *llq = &ctx->get_feat_ctx->llq; + struct ena_com_dev *ena_dev = ctx->ena_dev; uint32_t tx_queue_size = ENA_DEFAULT_RING_SIZE; uint32_t rx_queue_size = adapter->rx_ring_size; - if (ctx->ena_dev->supported_features & BIT(ENA_ADMIN_MAX_QUEUES_EXT)) { + if (ena_dev->supported_features & BIT(ENA_ADMIN_MAX_QUEUES_EXT)) { struct ena_admin_queue_ext_feature_fields *max_queue_ext = &ctx->get_feat_ctx->max_queue_ext.max_queue_ext; rx_queue_size = min_t(uint32_t, rx_queue_size, @@ -3087,8 +3381,15 @@ ena_calc_queue_size(struct ena_adapter *adapter, max_queue_ext->max_rx_sq_depth); tx_queue_size = min_t(uint32_t, tx_queue_size, max_queue_ext->max_tx_cq_depth); - tx_queue_size = min_t(uint32_t, tx_queue_size, - max_queue_ext->max_tx_sq_depth); + + if (ena_dev->tx_mem_queue_type == + ENA_ADMIN_PLACEMENT_POLICY_DEV) + tx_queue_size = min_t(uint32_t, tx_queue_size, + llq->max_llq_depth); + else + tx_queue_size = min_t(uint32_t, tx_queue_size, + max_queue_ext->max_tx_sq_depth); + ctx->max_rx_sgl_size = min_t(uint16_t, ENA_PKT_MAX_BUFS, max_queue_ext->max_per_packet_rx_descs); ctx->max_tx_sgl_size = min_t(uint16_t, ENA_PKT_MAX_BUFS, @@ -3100,7 +3401,17 @@ ena_calc_queue_size(struct ena_adapter *adapter, max_queues->max_cq_depth); rx_queue_size = min_t(uint32_t, rx_queue_size, max_queues->max_sq_depth); - tx_queue_size = rx_queue_size; + tx_queue_size = min_t(uint32_t, tx_queue_size, + max_queues->max_cq_depth); + + if (ena_dev->tx_mem_queue_type == + ENA_ADMIN_PLACEMENT_POLICY_DEV) + tx_queue_size = min_t(uint32_t, tx_queue_size, + llq->max_llq_depth); + else + tx_queue_size = min_t(uint32_t, tx_queue_size, + max_queues->max_sq_depth); + ctx->max_rx_sgl_size = min_t(uint16_t, ENA_PKT_MAX_BUFS, max_queues->max_packet_tx_descs); ctx->max_tx_sgl_size = min_t(uint16_t, ENA_PKT_MAX_BUFS, @@ -3831,12 +4142,15 @@ static int ena_attach(device_t pdev) { struct ena_com_dev_get_features_ctx get_feat_ctx; + struct ena_llq_configurations llq_config; struct ena_calc_queue_size_ctx calc_queue_ctx = { 0 }; static int version_printed; struct ena_adapter *adapter; struct ena_com_dev *ena_dev = NULL; + const char *queue_type_str; int io_queue_num; - int rc; + int rid, rc; + adapter = device_get_softc(pdev); adapter->pdev = pdev; @@ -3853,19 +4167,24 @@ ena_attach(device_t pdev) if (version_printed++ == 0) device_printf(pdev, "%s\n", ena_version); - rc = ena_allocate_pci_resources(adapter); - if (unlikely(rc != 0)) { - device_printf(pdev, "PCI resource allocation failed!\n"); - ena_free_pci_resources(adapter); - return (rc); - } - /* Allocate memory for ena_dev structure */ ena_dev = malloc(sizeof(struct ena_com_dev), M_DEVBUF, M_WAITOK | M_ZERO); adapter->ena_dev = ena_dev; ena_dev->dmadev = pdev; + + rid = PCIR_BAR(ENA_REG_BAR); + adapter->memory = NULL; + adapter->registers = bus_alloc_resource_any(pdev, SYS_RES_MEMORY, + &rid, RF_ACTIVE); + if (unlikely(adapter->registers == NULL)) { + device_printf(pdev, + "unable to allocate bus resource: registers!\n"); + rc = ENOMEM; + goto err_dev_free; + } + ena_dev->bus = malloc(sizeof(struct ena_bus), M_DEVBUF, M_WAITOK | M_ZERO); @@ -3891,6 +4210,29 @@ ena_attach(device_t pdev) goto err_bus_free; } + set_default_llq_configurations(&llq_config); + +#if defined(__arm__) || defined(__aarch64__) + /* + * Force LLQ disable, as the driver is not supporting WC enablement + * on the ARM architecture. Using LLQ without WC would affect + * performance in a negative way. + */ + ena_dev->supported_features &= ~(1 << ENA_ADMIN_LLQ); +#endif + rc = ena_set_queues_placement_policy(pdev, ena_dev, &get_feat_ctx.llq, + &llq_config); + if (unlikely(rc != 0)) { + device_printf(pdev, "failed to set placement policy\n"); + goto err_com_free; + } + + if (ena_dev->tx_mem_queue_type == ENA_ADMIN_PLACEMENT_POLICY_HOST) + queue_type_str = "Regular"; + else + queue_type_str = "Low Latency"; + device_printf(pdev, "Placement policy: %s\n", queue_type_str); + adapter->keep_alive_timestamp = getsbinuptime(); adapter->tx_offload_cap = get_feat_ctx.offload.tx; @@ -4002,8 +4344,9 @@ err_com_free: ena_com_mmio_reg_read_request_destroy(ena_dev); err_bus_free: free(ena_dev->bus, M_DEVBUF); - free(ena_dev, M_DEVBUF); ena_free_pci_resources(adapter); +err_dev_free: + free(ena_dev, M_DEVBUF); return (rc); } Modified: head/sys/dev/ena/ena.h ============================================================================== --- head/sys/dev/ena/ena.h Thu May 30 13:29:24 2019 (r348402) +++ head/sys/dev/ena/ena.h Thu May 30 13:30:52 2019 (r348403) @@ -201,8 +201,14 @@ struct ena_tx_buffer { unsigned int tx_descs; /* # of buffers used by this mbuf */ unsigned int num_of_bufs; - bus_dmamap_t map; + bus_dmamap_t map_head; + bus_dmamap_t map_seg; + /* Indicate if segments of the mbuf were mapped */ + bool seg_mapped; + /* Indicate if bufs[0] maps the linear data of the mbuf */ + bool head_mapped; + /* Used to detect missing tx packets */ struct bintime timestamp; bool print_once; @@ -228,6 +234,7 @@ struct ena_stats_tx { counter_u64_t collapse_err; counter_u64_t queue_wakeup; counter_u64_t queue_stop; + counter_u64_t llq_buffer_copy; }; struct ena_stats_rx { @@ -306,6 +313,9 @@ struct ena_ring { /* For Tx ring to indicate if it's running or not */ bool running; }; + + /* Used for LLQ */ + uint8_t *push_buf_intermediate_buf; } __aligned(CACHE_LINE_SIZE); struct ena_stats_dev { Modified: head/sys/dev/ena/ena_sysctl.c ============================================================================== --- head/sys/dev/ena/ena_sysctl.c Thu May 30 13:29:24 2019 (r348402) +++ head/sys/dev/ena/ena_sysctl.c Thu May 30 13:30:52 2019 (r348403) @@ -196,6 +196,10 @@ ena_sysctl_add_stats(struct ena_adapter *adapter) SYSCTL_ADD_COUNTER_U64(ctx, tx_list, OID_AUTO, "queue_stops", CTLFLAG_RD, &tx_stats->queue_stop, "Queue stops"); + SYSCTL_ADD_COUNTER_U64(ctx, tx_list, OID_AUTO, + "llq_buffer_copy", CTLFLAG_RD, + &tx_stats->llq_buffer_copy, + "Header copies for llq transaction"); /* RX specific stats */ rx_node = SYSCTL_ADD_NODE(ctx, queue_list, OID_AUTO, From owner-svn-src-head@freebsd.org Thu May 30 13:31:37 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 227ED15C2CC8; Thu, 30 May 2019 13:31:37 +0000 (UTC) (envelope-from mw@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id BDE018A63A; Thu, 30 May 2019 13:31:36 +0000 (UTC) (envelope-from mw@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 98C0819C59; Thu, 30 May 2019 13:31:36 +0000 (UTC) (envelope-from mw@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x4UDVaG4067589; Thu, 30 May 2019 13:31:36 GMT (envelope-from mw@FreeBSD.org) Received: (from mw@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4UDVaxK067588; Thu, 30 May 2019 13:31:36 GMT (envelope-from mw@FreeBSD.org) Message-Id: <201905301331.x4UDVaxK067588@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mw set sender to mw@FreeBSD.org using -f From: Marcin Wojtas Date: Thu, 30 May 2019 13:31:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r348404 - head/sys/dev/ena X-SVN-Group: head X-SVN-Commit-Author: mw X-SVN-Commit-Paths: head/sys/dev/ena X-SVN-Commit-Revision: 348404 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: BDE018A63A X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.98 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.98)[-0.980,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 30 May 2019 13:31:37 -0000 Author: mw Date: Thu May 30 13:31:35 2019 New Revision: 348404 URL: https://svnweb.freebsd.org/changeset/base/348404 Log: Limit maximum size of Rx refill threshold in ENA The Rx ring size can be as high as 8k. Because of that we want to limit the cleanup threshold by maximum value of 256. Submitted by: Michal Krawczyk Obtained from: Semihalf Sponsored by: Amazon, Inc. Modified: head/sys/dev/ena/ena.c head/sys/dev/ena/ena.h Modified: head/sys/dev/ena/ena.c ============================================================================== --- head/sys/dev/ena/ena.c Thu May 30 13:30:52 2019 (r348403) +++ head/sys/dev/ena/ena.c Thu May 30 13:31:35 2019 (r348404) @@ -1781,7 +1781,9 @@ ena_rx_cleanup(struct ena_ring *rx_ring) rx_ring->next_to_clean = next_to_clean; refill_required = ena_com_free_desc(io_sq); - refill_threshold = rx_ring->ring_size / ENA_RX_REFILL_THRESH_DIVIDER; + refill_threshold = min_t(int, + rx_ring->ring_size / ENA_RX_REFILL_THRESH_DIVIDER, + ENA_RX_REFILL_THRESH_PACKET); if (refill_required > refill_threshold) { ena_com_update_dev_comp_head(rx_ring->ena_com_io_cq); Modified: head/sys/dev/ena/ena.h ============================================================================== --- head/sys/dev/ena/ena.h Thu May 30 13:30:52 2019 (r348403) +++ head/sys/dev/ena/ena.h Thu May 30 13:31:35 2019 (r348404) @@ -70,7 +70,12 @@ #define ENA_DEFAULT_RING_SIZE 1024 +/* + * Refill Rx queue when number of required descriptors is above + * QUEUE_SIZE / ENA_RX_REFILL_THRESH_DIVIDER or ENA_RX_REFILL_THRESH_PACKET + */ #define ENA_RX_REFILL_THRESH_DIVIDER 8 +#define ENA_RX_REFILL_THRESH_PACKET 256 #define ENA_IRQNAME_SIZE 40 From owner-svn-src-head@freebsd.org Thu May 30 13:33:32 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9F81115C2EF7; Thu, 30 May 2019 13:33:32 +0000 (UTC) (envelope-from mw@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 436448A9BB; Thu, 30 May 2019 13:33:32 +0000 (UTC) (envelope-from mw@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 32A2219CAA; Thu, 30 May 2019 13:33:32 +0000 (UTC) (envelope-from mw@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x4UDXWI8071651; Thu, 30 May 2019 13:33:32 GMT (envelope-from mw@FreeBSD.org) Received: (from mw@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4UDXV6K071650; Thu, 30 May 2019 13:33:31 GMT (envelope-from mw@FreeBSD.org) Message-Id: <201905301333.x4UDXV6K071650@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mw set sender to mw@FreeBSD.org using -f From: Marcin Wojtas Date: Thu, 30 May 2019 13:33:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r348405 - head/sys/dev/ena X-SVN-Group: head X-SVN-Commit-Author: mw X-SVN-Commit-Paths: head/sys/dev/ena X-SVN-Commit-Revision: 348405 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 436448A9BB X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.98 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.98)[-0.980,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 30 May 2019 13:33:32 -0000 Author: mw Date: Thu May 30 13:33:31 2019 New Revision: 348405 URL: https://svnweb.freebsd.org/changeset/base/348405 Log: Add additional doorbells on ENA Tx path The new ENA HAL is introducing API, which can determine on Tx path if the doorbell is needed. That way, it can tell the driver, that it should call an doorbell. The old threshold value wasn't removed, as not all HW is supporting this feature - so it was reworked to also work with the new API. Submitted by: Michal Krawczyk Obtained from: Semihalf Sponsored by: Amazon, Inc. Modified: head/sys/dev/ena/ena.c head/sys/dev/ena/ena.h Modified: head/sys/dev/ena/ena.c ============================================================================== --- head/sys/dev/ena/ena.c Thu May 30 13:31:35 2019 (r348404) +++ head/sys/dev/ena/ena.c Thu May 30 13:33:31 2019 (r348405) @@ -590,6 +590,7 @@ ena_setup_tx_resources(struct ena_adapter *adapter, in tx_ring->next_to_use = 0; tx_ring->next_to_clean = 0; + tx_ring->acum_pkts = 0; /* Make sure that drbr is empty */ ENA_RING_MTX_LOCK(tx_ring); @@ -3007,6 +3008,18 @@ ena_xmit_mbuf(struct ena_ring *tx_ring, struct mbuf ** /* Set flags and meta data */ ena_tx_csum(&ena_tx_ctx, *mbuf); + + if (tx_ring->acum_pkts == DB_THRESHOLD || + ena_com_is_doorbell_needed(tx_ring->ena_com_io_sq, &ena_tx_ctx)) { + ena_trace(ENA_DBG | ENA_TXPTH, + "llq tx max burst size of queue %d achieved, writing doorbell to send burst\n", + tx_ring->que->id); + wmb(); + ena_com_write_sq_doorbell(tx_ring->ena_com_io_sq); + counter_u64_add(tx_ring->tx_stats.doorbells, 1); + tx_ring->acum_pkts = 0; + } + /* Prepare the packet's descriptors and send them to device */ rc = ena_com_prepare_tx(io_sq, &ena_tx_ctx, &nb_hw_desc); if (unlikely(rc != 0)) { @@ -3096,7 +3109,6 @@ ena_start_xmit(struct ena_ring *tx_ring) struct ena_adapter *adapter = tx_ring->adapter; struct ena_com_io_sq* io_sq; int ena_qid; - int acum_pkts = 0; int ret = 0; if (unlikely((if_getdrvflags(adapter->ifp) & IFF_DRV_RUNNING) == 0)) @@ -3137,25 +3149,17 @@ ena_start_xmit(struct ena_ring *tx_ring) IFF_DRV_RUNNING) == 0)) return; - acum_pkts++; + tx_ring->acum_pkts++; BPF_MTAP(adapter->ifp, mbuf); - - if (unlikely(acum_pkts == DB_THRESHOLD)) { - acum_pkts = 0; - wmb(); - /* Trigger the dma engine */ - ena_com_write_sq_doorbell(io_sq); - counter_u64_add(tx_ring->tx_stats.doorbells, 1); - } - } - if (likely(acum_pkts != 0)) { + if (likely(tx_ring->acum_pkts != 0)) { wmb(); /* Trigger the dma engine */ ena_com_write_sq_doorbell(io_sq); counter_u64_add(tx_ring->tx_stats.doorbells, 1); + tx_ring->acum_pkts = 0; } if (unlikely(!tx_ring->running)) Modified: head/sys/dev/ena/ena.h ============================================================================== --- head/sys/dev/ena/ena.h Thu May 30 13:31:35 2019 (r348404) +++ head/sys/dev/ena/ena.h Thu May 30 13:33:31 2019 (r348405) @@ -319,6 +319,9 @@ struct ena_ring { bool running; }; + /* How many packets are sent in one Tx loop, used for doorbells */ + uint32_t acum_pkts; + /* Used for LLQ */ uint8_t *push_buf_intermediate_buf; } __aligned(CACHE_LINE_SIZE); From owner-svn-src-head@freebsd.org Thu May 30 13:35:03 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6541815C2FE6; Thu, 30 May 2019 13:35:03 +0000 (UTC) (envelope-from mw@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 0C2C98AB72; Thu, 30 May 2019 13:35:03 +0000 (UTC) (envelope-from mw@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D8E1419CAD; Thu, 30 May 2019 13:35:02 +0000 (UTC) (envelope-from mw@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x4UDZ2JQ071767; Thu, 30 May 2019 13:35:02 GMT (envelope-from mw@FreeBSD.org) Received: (from mw@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4UDZ2Pr071766; Thu, 30 May 2019 13:35:02 GMT (envelope-from mw@FreeBSD.org) Message-Id: <201905301335.x4UDZ2Pr071766@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mw set sender to mw@FreeBSD.org using -f From: Marcin Wojtas Date: Thu, 30 May 2019 13:35:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r348406 - head/sys/dev/ena X-SVN-Group: head X-SVN-Commit-Author: mw X-SVN-Commit-Paths: head/sys/dev/ena X-SVN-Commit-Revision: 348406 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 0C2C98AB72 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.98 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.98)[-0.980,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 30 May 2019 13:35:03 -0000 Author: mw Date: Thu May 30 13:35:02 2019 New Revision: 348406 URL: https://svnweb.freebsd.org/changeset/base/348406 Log: Fill bdf field of the host_info structure in ENA The host info bdf field is the abbreviation for the bus, device, function of the PCI on which the device is being attached to. Now the driver is filling information about that using FreeBSD RID resource. Submitted by: Michal Krawczyk Obtained from: Semihalf Sponsored by: Amazon, Inc. Modified: head/sys/dev/ena/ena.c Modified: head/sys/dev/ena/ena.c ============================================================================== --- head/sys/dev/ena/ena.c Thu May 30 13:33:31 2019 (r348405) +++ head/sys/dev/ena/ena.c Thu May 30 13:35:02 2019 (r348406) @@ -176,7 +176,7 @@ static int ena_handle_updated_queues(struct ena_adapte struct ena_com_dev_get_features_ctx *); static int ena_rss_init_default(struct ena_adapter *); static void ena_rss_init_default_deferred(void *); -static void ena_config_host_info(struct ena_com_dev *); +static void ena_config_host_info(struct ena_com_dev *, device_t); static int ena_attach(device_t); static int ena_detach(device_t); static int ena_device_init(struct ena_adapter *, device_t, @@ -3579,9 +3579,10 @@ ena_rss_init_default_deferred(void *arg) SYSINIT(ena_rss_init, SI_SUB_KICK_SCHEDULER, SI_ORDER_SECOND, ena_rss_init_default_deferred, NULL); static void -ena_config_host_info(struct ena_com_dev *ena_dev) +ena_config_host_info(struct ena_com_dev *ena_dev, device_t dev) { struct ena_admin_host_info *host_info; + uintptr_t rid; int rc; /* Allocate only the host info */ @@ -3593,6 +3594,8 @@ ena_config_host_info(struct ena_com_dev *ena_dev) host_info = ena_dev->host_attr.host_info; + if (pci_get_id(dev, PCI_ID_RID, &rid) == 0) + host_info->bdf = rid; host_info->os_type = ENA_ADMIN_OS_FREEBSD; host_info->kernel_ver = osreldate; @@ -3681,7 +3684,7 @@ ena_device_init(struct ena_adapter *adapter, device_t */ ena_com_set_admin_polling_mode(ena_dev, true); - ena_config_host_info(ena_dev); + ena_config_host_info(ena_dev, pdev); /* Get Device Attributes */ rc = ena_com_get_dev_attr_feat(ena_dev, get_feat_ctx); From owner-svn-src-head@freebsd.org Thu May 30 13:35:44 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D9E8715C30E2; Thu, 30 May 2019 13:35:44 +0000 (UTC) (envelope-from mw@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 7E3358AD49; Thu, 30 May 2019 13:35:44 +0000 (UTC) (envelope-from mw@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 739C719CAE; Thu, 30 May 2019 13:35:44 +0000 (UTC) (envelope-from mw@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x4UDZimK071836; Thu, 30 May 2019 13:35:44 GMT (envelope-from mw@FreeBSD.org) Received: (from mw@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4UDZiex071835; Thu, 30 May 2019 13:35:44 GMT (envelope-from mw@FreeBSD.org) Message-Id: <201905301335.x4UDZiex071835@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mw set sender to mw@FreeBSD.org using -f From: Marcin Wojtas Date: Thu, 30 May 2019 13:35:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r348407 - head/sys/dev/ena X-SVN-Group: head X-SVN-Commit-Author: mw X-SVN-Commit-Paths: head/sys/dev/ena X-SVN-Commit-Revision: 348407 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 7E3358AD49 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.98 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.98)[-0.980,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 30 May 2019 13:35:45 -0000 Author: mw Date: Thu May 30 13:35:43 2019 New Revision: 348407 URL: https://svnweb.freebsd.org/changeset/base/348407 Log: Fix error handling when ENA reset fails Before the patch, error handling was not releasing all resources and was not issuing device reset if the reset task failed. That could cause memory leak and fault of the device. Submitted by: Michal Krawczyk Obtained from: Semihalf Sponsored by: Amazon, Inc. Modified: head/sys/dev/ena/ena.c Modified: head/sys/dev/ena/ena.c ============================================================================== --- head/sys/dev/ena/ena.c Thu May 30 13:35:02 2019 (r348406) +++ head/sys/dev/ena/ena.c Thu May 30 13:35:43 2019 (r348407) @@ -4130,7 +4130,11 @@ err_msix_free: ena_free_mgmnt_irq(adapter); ena_disable_msix(adapter); err_com_free: + ena_com_abort_admin_commands(ena_dev); + ena_com_wait_for_abort_completion(ena_dev); ena_com_admin_destroy(ena_dev); + ena_com_mmio_reg_read_request_destroy(ena_dev); + ena_com_dev_reset(ena_dev, ENA_REGS_RESET_DRIVER_INVALID_STATE); err_dev_free: device_printf(adapter->pdev, "ENA reset failed!\n"); adapter->running = false; From owner-svn-src-head@freebsd.org Thu May 30 13:37:17 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3FDB015C328F; Thu, 30 May 2019 13:37:17 +0000 (UTC) (envelope-from mw@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id E62938AF31; Thu, 30 May 2019 13:37:16 +0000 (UTC) (envelope-from mw@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C041819CAF; Thu, 30 May 2019 13:37:16 +0000 (UTC) (envelope-from mw@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x4UDbGa6071949; Thu, 30 May 2019 13:37:16 GMT (envelope-from mw@FreeBSD.org) Received: (from mw@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4UDbGSN071946; Thu, 30 May 2019 13:37:16 GMT (envelope-from mw@FreeBSD.org) Message-Id: <201905301337.x4UDbGSN071946@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mw set sender to mw@FreeBSD.org using -f From: Marcin Wojtas Date: Thu, 30 May 2019 13:37:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r348408 - head/sys/dev/ena X-SVN-Group: head X-SVN-Commit-Author: mw X-SVN-Commit-Paths: head/sys/dev/ena X-SVN-Commit-Revision: 348408 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: E62938AF31 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.98 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.98)[-0.981,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 30 May 2019 13:37:17 -0000 Author: mw Date: Thu May 30 13:37:15 2019 New Revision: 348408 URL: https://svnweb.freebsd.org/changeset/base/348408 Log: Use bitfield for storing global ENA device states As the ENA can have multiple states turned on/off, it is more convenient to store them in single bitfield instead of multiple boolean variables. The bitset FreeBSD API was used for the bitfield implementation, as it provides flexible structure together with API which also supports atomic bitfield operations. For better readability basic macros from API were wrapped into custom ENA_FLAG_* macros, which are filling up common parameters for all calls. Submitted by: Michal Krawczyk Obtained from: Semihalf Sponsored by: Amazon, Inc. Modified: head/sys/dev/ena/ena.c head/sys/dev/ena/ena.h head/sys/dev/ena/ena_sysctl.c Modified: head/sys/dev/ena/ena.c ============================================================================== --- head/sys/dev/ena/ena.c Thu May 30 13:35:43 2019 (r348407) +++ head/sys/dev/ena/ena.c Thu May 30 13:37:15 2019 (r348408) @@ -778,7 +778,7 @@ validate_rx_req_id(struct ena_ring *rx_ring, uint16_t /* Trigger device reset */ rx_ring->adapter->reset_reason = ENA_REGS_RESET_INV_RX_REQ_ID; - rx_ring->adapter->trigger_reset = true; + ENA_FLAG_SET_ATOMIC(ENA_FLAG_TRIGGER_RESET, rx_ring->adapter); return (EFAULT); } @@ -1471,7 +1471,7 @@ ena_rx_hash_mbuf(struct ena_ring *rx_ring, struct ena_ { struct ena_adapter *adapter = rx_ring->adapter; - if (likely(adapter->rss_support)) { + if (likely(ENA_FLAG_ISSET(ENA_FLAG_RSS_ACTIVE, adapter))) { mbuf->m_pkthdr.flowid = ena_rx_ctx->hash; if (ena_rx_ctx->frag && @@ -1800,7 +1800,7 @@ error: /* Too many desc from the device. Trigger reset */ adapter->reset_reason = ENA_REGS_RESET_TOO_MANY_RX_DESCS; - adapter->trigger_reset = true; + ENA_FLAG_SET_ATOMIC(ENA_FLAG_TRIGGER_RESET, adapter); return (0); } @@ -1821,7 +1821,7 @@ ena_intr_msix_mgmnt(void *arg) struct ena_adapter *adapter = (struct ena_adapter *)arg; ena_com_admin_q_comp_intr_handler(adapter->ena_dev); - if (likely(adapter->running)) + if (likely(ENA_FLAG_ISSET(ENA_FLAG_DEVICE_RUNNING, adapter))) ena_com_aenq_intr_handler(adapter->ena_dev, arg); } @@ -1897,6 +1897,11 @@ ena_enable_msix(struct ena_adapter *adapter) int msix_vecs, msix_req; int i, rc = 0; + if (ENA_FLAG_ISSET(ENA_FLAG_MSIX_ENABLED, adapter)) { + device_printf(dev, "Error, MSI-X is already enabled\n"); + return (EINVAL); + } + /* Reserved the max msix vectors we might need */ msix_vecs = ENA_MAX_MSIX_VEC(adapter->num_queues); @@ -1936,7 +1941,7 @@ ena_enable_msix(struct ena_adapter *adapter) } adapter->msix_vecs = msix_vecs; - adapter->msix_enabled = true; + ENA_FLAG_SET_ATOMIC(ENA_FLAG_MSIX_ENABLED, adapter); return (0); @@ -2046,7 +2051,7 @@ ena_request_io_irq(struct ena_adapter *adapter) unsigned long flags = 0; int rc = 0, i, rcc; - if (unlikely(adapter->msix_enabled == 0)) { + if (unlikely(!ENA_FLAG_ISSET(ENA_FLAG_MSIX_ENABLED, adapter))) { device_printf(adapter->pdev, "failed to request I/O IRQ: MSI-X is not enabled\n"); return (EINVAL); @@ -2196,10 +2201,14 @@ static void ena_disable_msix(struct ena_adapter *adapter) { - pci_release_msi(adapter->pdev); + if (ENA_FLAG_ISSET(ENA_FLAG_MSIX_ENABLED, adapter)) { + ENA_FLAG_CLEAR_ATOMIC(ENA_FLAG_MSIX_ENABLED, adapter); + pci_release_msi(adapter->pdev); + } adapter->msix_vecs = 0; - free(adapter->msix_entries, M_DEVBUF); + if (adapter->msix_entries != NULL) + free(adapter->msix_entries, M_DEVBUF); adapter->msix_entries = NULL; } @@ -2250,7 +2259,7 @@ ena_up_complete(struct ena_adapter *adapter) { int rc; - if (likely(adapter->rss_support)) { + if (likely(ENA_FLAG_ISSET(ENA_FLAG_RSS_ACTIVE, adapter))) { rc = ena_rss_configure(adapter); if (rc != 0) return (rc); @@ -2277,12 +2286,12 @@ ena_up(struct ena_adapter *adapter) return (ENXIO); } - if (unlikely(!adapter->running)) { + if (unlikely(!ENA_FLAG_ISSET(ENA_FLAG_DEVICE_RUNNING, adapter))) { device_printf(adapter->pdev, "device is not running!\n"); return (ENXIO); } - if (!adapter->up) { + if (!ENA_FLAG_ISSET(ENA_FLAG_DEV_UP, adapter)) { device_printf(adapter->pdev, "device is going UP\n"); /* setup interrupts for IO queues */ @@ -2315,7 +2324,7 @@ ena_up(struct ena_adapter *adapter) goto err_io_que; } - if (unlikely(adapter->link_status)) + if (ENA_FLAG_ISSET(ENA_FLAG_LINK_UP, adapter)) if_link_state_change(adapter->ifp, LINK_STATE_UP); rc = ena_up_complete(adapter); @@ -2332,7 +2341,7 @@ ena_up(struct ena_adapter *adapter) callout_reset_sbt(&adapter->timer_service, SBT_1S, SBT_1S, ena_timer_service, (void *)adapter, 0); - adapter->up = true; + ENA_FLAG_SET_ATOMIC(ENA_FLAG_DEV_UP, adapter); ena_unmask_all_io_irqs(adapter); } @@ -2394,9 +2403,9 @@ ena_media_status(if_t ifp, struct ifmediareq *ifmr) ifmr->ifm_status = IFM_AVALID; ifmr->ifm_active = IFM_ETHER; - if (!adapter->link_status) { + if (!ENA_FLAG_ISSET(ENA_FLAG_LINK_UP, adapter)) { mtx_unlock(&adapter->global_mtx); - ena_trace(ENA_INFO, "link_status = false"); + ena_trace(ENA_INFO, "Link is down\n"); return; } @@ -2411,7 +2420,7 @@ ena_init(void *arg) { struct ena_adapter *adapter = (struct ena_adapter *)arg; - if (!adapter->up) { + if (!ENA_FLAG_ISSET(ENA_FLAG_DEV_UP, adapter)) { sx_xlock(&adapter->ioctl_sx); ena_up(adapter); sx_unlock(&adapter->ioctl_sx); @@ -2644,18 +2653,18 @@ ena_down(struct ena_adapter *adapter) { int rc; - if (adapter->up) { + if (ENA_FLAG_ISSET(ENA_FLAG_DEV_UP, adapter)) { device_printf(adapter->pdev, "device is going DOWN\n"); callout_drain(&adapter->timer_service); - adapter->up = false; + ENA_FLAG_CLEAR_ATOMIC(ENA_FLAG_DEV_UP, adapter); if_setdrvflagbits(adapter->ifp, IFF_DRV_OACTIVE, IFF_DRV_RUNNING); ena_free_io_irq(adapter); - if (adapter->trigger_reset) { + if (ENA_FLAG_ISSET(ENA_FLAG_TRIGGER_RESET, adapter)) { rc = ena_com_dev_reset(adapter->ena_dev, adapter->reset_reason); if (unlikely(rc != 0)) @@ -3114,7 +3123,7 @@ ena_start_xmit(struct ena_ring *tx_ring) if (unlikely((if_getdrvflags(adapter->ifp) & IFF_DRV_RUNNING) == 0)) return; - if (unlikely(!adapter->link_status)) + if (unlikely(!ENA_FLAG_ISSET(ENA_FLAG_LINK_UP, adapter))) return; ena_qid = ENA_IO_TXQ_IDX(tx_ring->que->id); @@ -3484,7 +3493,7 @@ ena_handle_updated_queues(struct ena_adapter *adapter, "falling back to %d queues\n", adapter->num_queues, io_queue_num); adapter->num_queues = io_queue_num; - if (adapter->rss_support) { + if (ENA_FLAG_ISSET(ENA_FLAG_RSS_ACTIVE, adapter)) { ena_com_rss_destroy(ena_dev); rc = ena_rss_init_default(adapter); if (unlikely(rc != 0) && (rc != EOPNOTSUPP)) { @@ -3566,12 +3575,12 @@ ena_rss_init_default_deferred(void *arg) adapter = devclass_get_softc(dc, max); if (adapter != NULL) { rc = ena_rss_init_default(adapter); - adapter->rss_support = true; + ENA_FLAG_SET_ATOMIC(ENA_FLAG_RSS_ACTIVE, adapter); if (unlikely(rc != 0)) { device_printf(adapter->pdev, "WARNING: RSS was not properly initialized," " it will affect bandwidth\n"); - adapter->rss_support = false; + ENA_FLAG_CLEAR_ATOMIC(ENA_FLAG_RSS_ACTIVE, adapter); } } } @@ -3789,7 +3798,7 @@ static void check_for_missing_keep_alive(struct ena_ad "Keep alive watchdog timeout.\n"); counter_u64_add(adapter->dev_stats.wd_expired, 1); adapter->reset_reason = ENA_REGS_RESET_KEEP_ALIVE_TO; - adapter->trigger_reset = true; + ENA_FLAG_SET_ATOMIC(ENA_FLAG_TRIGGER_RESET, adapter); } } @@ -3802,7 +3811,7 @@ static void check_for_admin_com_state(struct ena_adapt "ENA admin queue is not in running state!\n"); counter_u64_add(adapter->dev_stats.admin_q_pause, 1); adapter->reset_reason = ENA_REGS_RESET_ADMIN_TO; - adapter->trigger_reset = true; + ENA_FLAG_SET_ATOMIC(ENA_FLAG_TRIGGER_RESET, adapter); } } @@ -3822,7 +3831,7 @@ check_for_rx_interrupt_queue(struct ena_adapter *adapt device_printf(adapter->pdev, "Potential MSIX issue on Rx side " "Queue = %d. Reset the device\n", rx_ring->qid); adapter->reset_reason = ENA_REGS_RESET_MISS_INTERRUPT; - adapter->trigger_reset = true; + ENA_FLAG_SET_ATOMIC(ENA_FLAG_TRIGGER_RESET, adapter); return (EIO); } @@ -3861,7 +3870,7 @@ check_missing_comp_in_tx_queue(struct ena_adapter *ada "Potential MSIX issue on Tx side Queue = %d. " "Reset the device\n", tx_ring->qid); adapter->reset_reason = ENA_REGS_RESET_MISS_INTERRUPT; - adapter->trigger_reset = true; + ENA_FLAG_SET_ATOMIC(ENA_FLAG_TRIGGER_RESET, adapter); return (EIO); } @@ -3884,7 +3893,7 @@ check_missing_comp_in_tx_queue(struct ena_adapter *ada "(%d > %d). Reset the device\n", missed_tx, adapter->missing_tx_threshold); adapter->reset_reason = ENA_REGS_RESET_MISS_TX_CMPL; - adapter->trigger_reset = true; + ENA_FLAG_SET_ATOMIC(ENA_FLAG_TRIGGER_RESET, adapter); rc = EIO; } @@ -3909,10 +3918,10 @@ check_for_missing_completions(struct ena_adapter *adap /* Make sure the driver doesn't turn the device in other process */ rmb(); - if (!adapter->up) + if (!ENA_FLAG_ISSET(ENA_FLAG_DEV_UP, adapter)) return; - if (adapter->trigger_reset) + if (ENA_FLAG_ISSET(ENA_FLAG_TRIGGER_RESET, adapter)) return; if (adapter->missing_tx_timeout == ENA_HW_HINTS_NO_TIMEOUT) @@ -3960,10 +3969,10 @@ check_for_empty_rx_ring(struct ena_adapter *adapter) struct ena_ring *rx_ring; int i, refill_required; - if (!adapter->up) + if (!ENA_FLAG_ISSET(ENA_FLAG_DEV_UP, adapter)) return; - if (adapter->trigger_reset) + if (ENA_FLAG_ISSET(ENA_FLAG_TRIGGER_RESET, adapter)) return; for (i = 0; i < adapter->num_queues; i++) { @@ -4044,7 +4053,7 @@ ena_timer_service(void *data) if (host_info != NULL) ena_update_host_info(host_info, adapter->ifp); - if (unlikely(adapter->trigger_reset)) { + if (unlikely(ENA_FLAG_ISSET(ENA_FLAG_TRIGGER_RESET, adapter))) { device_printf(adapter->pdev, "Trigger reset is on\n"); taskqueue_enqueue(adapter->reset_tq, &adapter->reset_task); return; @@ -4065,7 +4074,7 @@ ena_reset_task(void *arg, int pending) bool dev_up; int rc; - if (unlikely(!adapter->trigger_reset)) { + if (unlikely(!ENA_FLAG_ISSET(ENA_FLAG_TRIGGER_RESET, adapter))) { device_printf(adapter->pdev, "device reset scheduled but trigger_reset is off\n"); return; @@ -4075,7 +4084,7 @@ ena_reset_task(void *arg, int pending) callout_drain(&adapter->timer_service); - dev_up = adapter->up; + dev_up = ENA_FLAG_ISSET(ENA_FLAG_DEV_UP, adapter); ena_com_set_admin_running_state(ena_dev, false); ena_down(adapter); @@ -4087,7 +4096,7 @@ ena_reset_task(void *arg, int pending) ena_com_mmio_reg_read_request_destroy(ena_dev); adapter->reset_reason = ENA_REGS_RESET_NORMAL; - adapter->trigger_reset = false; + ENA_FLAG_CLEAR_ATOMIC(ENA_FLAG_TRIGGER_RESET, adapter); /* Finished destroy part. Restart the device */ rc = ena_device_init(adapter, adapter->pdev, &get_feat_ctx, @@ -4137,7 +4146,7 @@ err_com_free: ena_com_dev_reset(ena_dev, ENA_REGS_RESET_DRIVER_INVALID_STATE); err_dev_free: device_printf(adapter->pdev, "ENA reset failed!\n"); - adapter->running = false; + ENA_FLAG_CLEAR_ATOMIC(ENA_FLAG_DEVICE_RUNNING, adapter); sx_unlock(&adapter->ioctl_sx); } @@ -4215,6 +4224,9 @@ ena_attach(device_t pdev) ena_dev->tx_mem_queue_type = ENA_ADMIN_PLACEMENT_POLICY_HOST; + /* Initially clear all the flags */ + ENA_FLAG_ZERO(adapter); + /* Device initialization */ rc = ena_device_init(adapter, pdev, &get_feat_ctx, &adapter->wd_active); if (unlikely(rc != 0)) { @@ -4250,9 +4262,6 @@ ena_attach(device_t pdev) adapter->tx_offload_cap = get_feat_ctx.offload.tx; - /* Set for sure that interface is not up */ - adapter->up = false; - memcpy(adapter->mac_addr, get_feat_ctx.dev_attr.mac_addr, ETHER_ADDR_LEN); @@ -4338,8 +4347,8 @@ ena_attach(device_t pdev) /* Tell the stack that the interface is not active */ if_setdrvflagbits(adapter->ifp, IFF_DRV_OACTIVE, IFF_DRV_RUNNING); + ENA_FLAG_SET_ATOMIC(ENA_FLAG_DEVICE_RUNNING, adapter); - adapter->running = true; return (0); err_msix_free: @@ -4403,7 +4412,7 @@ ena_detach(device_t pdev) ena_free_counters((counter_u64_t *)&adapter->dev_stats, sizeof(struct ena_stats_dev)); - if (likely(adapter->rss_support)) + if (likely(ENA_FLAG_ISSET(ENA_FLAG_RSS_ACTIVE, adapter))) ena_com_rss_destroy(ena_dev); rc = ena_free_rx_dma_tag(adapter); @@ -4417,7 +4426,7 @@ ena_detach(device_t pdev) "Unmapped TX DMA tag associations\n"); /* Reset the device only if the device is running. */ - if (adapter->running) + if (ENA_FLAG_ISSET(ENA_FLAG_DEVICE_RUNNING, adapter)) ena_com_dev_reset(ena_dev, adapter->reset_reason); ena_com_delete_host_info(ena_dev); @@ -4472,15 +4481,15 @@ ena_update_on_link_change(void *adapter_data, if (status != 0) { device_printf(adapter->pdev, "link is UP\n"); if_link_state_change(ifp, LINK_STATE_UP); + ENA_FLAG_SET_ATOMIC(ENA_FLAG_LINK_UP, adapter); } else if (status == 0) { device_printf(adapter->pdev, "link is DOWN\n"); if_link_state_change(ifp, LINK_STATE_DOWN); + ENA_FLAG_CLEAR_ATOMIC(ENA_FLAG_LINK_UP, adapter); } else { device_printf(adapter->pdev, "invalid value recvd\n"); BUG(); } - - adapter->link_status = status; } static void ena_notification(void *adapter_data, Modified: head/sys/dev/ena/ena.h ============================================================================== --- head/sys/dev/ena/ena.h Thu May 30 13:35:43 2019 (r348407) +++ head/sys/dev/ena/ena.h Thu May 30 13:37:15 2019 (r348408) @@ -154,6 +154,32 @@ #define PCI_DEV_ID_ENA_VF 0xec20 #define PCI_DEV_ID_ENA_LLQ_VF 0xec21 +/* + * Flags indicating current ENA driver state + */ +enum ena_flags_t { + ENA_FLAG_DEVICE_RUNNING, + ENA_FLAG_DEV_UP, + ENA_FLAG_LINK_UP, + ENA_FLAG_MSIX_ENABLED, + ENA_FLAG_TRIGGER_RESET, + ENA_FLAG_ONGOING_RESET, + ENA_FLAG_RSS_ACTIVE, + ENA_FLAGS_NUMBER = ENA_FLAG_RSS_ACTIVE +}; + +BITSET_DEFINE(_ena_state, ENA_FLAGS_NUMBER); +typedef struct _ena_state ena_state_t; + +#define ENA_FLAG_ZERO(adapter) \ + BIT_ZERO(ENA_FLAGS_NUMBER, &(adapter)->flags) +#define ENA_FLAG_ISSET(bit, adapter) \ + BIT_ISSET(ENA_FLAGS_NUMBER, (bit), &(adapter)->flags) +#define ENA_FLAG_SET_ATOMIC(bit, adapter) \ + BIT_SET_ATOMIC(ENA_FLAGS_NUMBER, (bit), &(adapter)->flags) +#define ENA_FLAG_CLEAR_ATOMIC(bit, adapter) \ + BIT_CLR_ATOMIC(ENA_FLAGS_NUMBER, (bit), &(adapter)->flags) + struct msix_entry { int entry; int vector; @@ -360,7 +386,6 @@ struct ena_adapter { struct sx ioctl_sx; /* MSI-X */ - uint32_t msix_enabled; struct msix_entry *msix_entries; int msix_vecs; @@ -386,15 +411,11 @@ struct ena_adapter { /* RSS*/ uint8_t rss_ind_tbl[ENA_RX_RSS_TABLE_SIZE]; - bool rss_support; uint8_t mac_addr[ETHER_ADDR_LEN]; /* mdio and phy*/ - bool link_status; - bool trigger_reset; - bool up; - bool running; + ena_state_t flags; /* Queue will represent one TX and one RX ring */ struct ena_que que[ENA_MAX_NUM_IO_QUEUES] Modified: head/sys/dev/ena/ena_sysctl.c ============================================================================== --- head/sys/dev/ena/ena_sysctl.c Thu May 30 13:35:43 2019 (r348407) +++ head/sys/dev/ena/ena_sysctl.c Thu May 30 13:37:15 2019 (r348408) @@ -326,7 +326,7 @@ ena_sysctl_buf_ring_size(SYSCTL_HANDLER_ARGS) if (val != adapter->buf_ring_size) { adapter->buf_ring_size = val; adapter->reset_reason = ENA_REGS_RESET_OS_TRIGGER; - adapter->trigger_reset = true; + ENA_FLAG_SET_ATOMIC(ENA_FLAG_TRIGGER_RESET, adapter); } return (0); @@ -357,7 +357,7 @@ ena_sysctl_rx_queue_size(SYSCTL_HANDLER_ARGS) if (val != adapter->rx_ring_size) { adapter->rx_ring_size = val; adapter->reset_reason = ENA_REGS_RESET_OS_TRIGGER; - adapter->trigger_reset = true; + ENA_FLAG_SET_ATOMIC(ENA_FLAG_TRIGGER_RESET, adapter); } return (0); From owner-svn-src-head@freebsd.org Thu May 30 13:39:27 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0D91315C33BA; Thu, 30 May 2019 13:39:27 +0000 (UTC) (envelope-from mw@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 7840E8B102; Thu, 30 May 2019 13:39:26 +0000 (UTC) (envelope-from mw@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4423919CB2; Thu, 30 May 2019 13:39:26 +0000 (UTC) (envelope-from mw@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x4UDdQ1d072071; Thu, 30 May 2019 13:39:26 GMT (envelope-from mw@FreeBSD.org) Received: (from mw@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4UDdP9r072069; Thu, 30 May 2019 13:39:25 GMT (envelope-from mw@FreeBSD.org) Message-Id: <201905301339.x4UDdP9r072069@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mw set sender to mw@FreeBSD.org using -f From: Marcin Wojtas Date: Thu, 30 May 2019 13:39:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r348409 - head/sys/dev/ena X-SVN-Group: head X-SVN-Commit-Author: mw X-SVN-Commit-Paths: head/sys/dev/ena X-SVN-Commit-Revision: 348409 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 7840E8B102 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.98 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.98)[-0.981,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 30 May 2019 13:39:27 -0000 Author: mw Date: Thu May 30 13:39:25 2019 New Revision: 348409 URL: https://svnweb.freebsd.org/changeset/base/348409 Log: Split ENA reset routine into restore and destroy stages For alignment with Linux driver and better handling ena_detach(), the reset is now calling ena_device_restore() and ena_device_destroy(). The ena_device_destroy() is also being called on ena_detach(), so the code will be more readable. The watchdog is now being activated after reset only, if it was active before. There were added additional checks to ensure, that there is no race with the link state change AENQ handler. Submitted by: Michal Krawczyk Obtained from: Semihalf Sponsored by: Amazon, Inc. Modified: head/sys/dev/ena/ena.c head/sys/dev/ena/ena.h Modified: head/sys/dev/ena/ena.c ============================================================================== --- head/sys/dev/ena/ena.c Thu May 30 13:37:15 2019 (r348408) +++ head/sys/dev/ena/ena.c Thu May 30 13:39:25 2019 (r348409) @@ -2286,11 +2286,6 @@ ena_up(struct ena_adapter *adapter) return (ENXIO); } - if (unlikely(!ENA_FLAG_ISSET(ENA_FLAG_DEVICE_RUNNING, adapter))) { - device_printf(adapter->pdev, "device is not running!\n"); - return (ENXIO); - } - if (!ENA_FLAG_ISSET(ENA_FLAG_DEV_UP, adapter)) { device_printf(adapter->pdev, "device is going UP\n"); @@ -4066,87 +4061,172 @@ ena_timer_service(void *data) } static void -ena_reset_task(void *arg, int pending) +ena_destroy_device(struct ena_adapter *adapter, bool graceful) { - struct ena_com_dev_get_features_ctx get_feat_ctx; - struct ena_adapter *adapter = (struct ena_adapter *)arg; + if_t ifp = adapter->ifp; struct ena_com_dev *ena_dev = adapter->ena_dev; bool dev_up; - int rc; - if (unlikely(!ENA_FLAG_ISSET(ENA_FLAG_TRIGGER_RESET, adapter))) { - device_printf(adapter->pdev, - "device reset scheduled but trigger_reset is off\n"); + if (!ENA_FLAG_ISSET(ENA_FLAG_DEVICE_RUNNING, adapter)) return; - } - sx_xlock(&adapter->ioctl_sx); + if_link_state_change(ifp, LINK_STATE_DOWN); callout_drain(&adapter->timer_service); dev_up = ENA_FLAG_ISSET(ENA_FLAG_DEV_UP, adapter); + if (dev_up) + ENA_FLAG_SET_ATOMIC(ENA_FLAG_DEV_UP_BEFORE_RESET, adapter); + else + ENA_FLAG_CLEAR_ATOMIC(ENA_FLAG_DEV_UP_BEFORE_RESET, adapter); - ena_com_set_admin_running_state(ena_dev, false); - ena_down(adapter); + if (!graceful) + ena_com_set_admin_running_state(ena_dev, false); + + if (ENA_FLAG_ISSET(ENA_FLAG_DEV_UP, adapter)) + ena_down(adapter); + + /* + * Stop the device from sending AENQ events (if the device was up, and + * the trigger reset was on, ena_down already performs device reset) + */ + if (!(ENA_FLAG_ISSET(ENA_FLAG_TRIGGER_RESET, adapter) && dev_up)) + ena_com_dev_reset(adapter->ena_dev, adapter->reset_reason); + ena_free_mgmnt_irq(adapter); + ena_disable_msix(adapter); + ena_com_abort_admin_commands(ena_dev); + ena_com_wait_for_abort_completion(ena_dev); + ena_com_admin_destroy(ena_dev); + ena_com_mmio_reg_read_request_destroy(ena_dev); adapter->reset_reason = ENA_REGS_RESET_NORMAL; + ENA_FLAG_CLEAR_ATOMIC(ENA_FLAG_TRIGGER_RESET, adapter); + ENA_FLAG_CLEAR_ATOMIC(ENA_FLAG_DEVICE_RUNNING, adapter); +} - /* Finished destroy part. Restart the device */ - rc = ena_device_init(adapter, adapter->pdev, &get_feat_ctx, - &adapter->wd_active); - if (unlikely(rc != 0)) { +static int +ena_device_validate_params(struct ena_adapter *adapter, + struct ena_com_dev_get_features_ctx *get_feat_ctx) +{ + + if (memcmp(get_feat_ctx->dev_attr.mac_addr, adapter->mac_addr, + ETHER_ADDR_LEN) != 0) { device_printf(adapter->pdev, - "ENA device init failed! (err: %d)\n", rc); - goto err_dev_free; + "Error, mac address are different\n"); + return (EINVAL); } + if (get_feat_ctx->dev_attr.max_mtu < if_getmtu(adapter->ifp)) { + device_printf(adapter->pdev, + "Error, device max mtu is smaller than ifp MTU\n"); + return (EINVAL); + } + + return 0; +} + +static int +ena_restore_device(struct ena_adapter *adapter) +{ + struct ena_com_dev_get_features_ctx get_feat_ctx; + struct ena_com_dev *ena_dev = adapter->ena_dev; + if_t ifp = adapter->ifp; + device_t dev = adapter->pdev; + int wd_active; + int rc; + + ENA_FLAG_SET_ATOMIC(ENA_FLAG_ONGOING_RESET, adapter); + + rc = ena_device_init(adapter, dev, &get_feat_ctx, &wd_active); + if (rc != 0) { + device_printf(dev, "Cannot initialize device\n"); + goto err; + } + /* + * Only enable WD if it was enabled before reset, so it won't override + * value set by the user by the sysctl. + */ + if (adapter->wd_active != 0) + adapter->wd_active = wd_active; + + rc = ena_device_validate_params(adapter, &get_feat_ctx); + if (rc != 0) { + device_printf(dev, "Validation of device parameters failed\n"); + goto err_device_destroy; + } + rc = ena_handle_updated_queues(adapter, &get_feat_ctx); - if (unlikely(rc != 0)) - goto err_dev_free; + if (rc != 0) + goto err_device_destroy; + ENA_FLAG_CLEAR_ATOMIC(ENA_FLAG_ONGOING_RESET, adapter); + /* Make sure we don't have a race with AENQ Links state handler */ + if (ENA_FLAG_ISSET(ENA_FLAG_LINK_UP, adapter)) + if_link_state_change(ifp, LINK_STATE_UP); + rc = ena_enable_msix_and_set_admin_interrupts(adapter, adapter->num_queues); - if (unlikely(rc != 0)) { - device_printf(adapter->pdev, "Enable MSI-X failed\n"); - goto err_com_free; + if (rc != 0) { + device_printf(dev, "Enable MSI-X failed\n"); + goto err_device_destroy; } /* If the interface was up before the reset bring it up */ - if (dev_up) { + if (ENA_FLAG_ISSET(ENA_FLAG_DEV_UP_BEFORE_RESET, adapter)) { rc = ena_up(adapter); - if (unlikely(rc != 0)) { - device_printf(adapter->pdev, - "Failed to create I/O queues\n"); - goto err_msix_free; + if (rc != 0) { + device_printf(dev, "Failed to create I/O queues\n"); + goto err_disable_msix; } } + ENA_FLAG_SET_ATOMIC(ENA_FLAG_DEVICE_RUNNING, adapter); callout_reset_sbt(&adapter->timer_service, SBT_1S, SBT_1S, ena_timer_service, (void *)adapter, 0); - sx_unlock(&adapter->ioctl_sx); + device_printf(dev, + "Device reset completed successfully, Driver info: %s\n", ena_version); - return; + return (rc); -err_msix_free: +err_disable_msix: ena_free_mgmnt_irq(adapter); ena_disable_msix(adapter); -err_com_free: +err_device_destroy: ena_com_abort_admin_commands(ena_dev); ena_com_wait_for_abort_completion(ena_dev); ena_com_admin_destroy(ena_dev); - ena_com_mmio_reg_read_request_destroy(ena_dev); ena_com_dev_reset(ena_dev, ENA_REGS_RESET_DRIVER_INVALID_STATE); -err_dev_free: - device_printf(adapter->pdev, "ENA reset failed!\n"); + ena_com_mmio_reg_read_request_destroy(ena_dev); +err: ENA_FLAG_CLEAR_ATOMIC(ENA_FLAG_DEVICE_RUNNING, adapter); + ENA_FLAG_CLEAR_ATOMIC(ENA_FLAG_ONGOING_RESET, adapter); + device_printf(dev, "Reset attempt failed. Can not reset the device\n"); + + return (rc); +} + +static void +ena_reset_task(void *arg, int pending) +{ + struct ena_adapter *adapter = (struct ena_adapter *)arg; + + if (unlikely(!ENA_FLAG_ISSET(ENA_FLAG_TRIGGER_RESET, adapter))) { + device_printf(adapter->pdev, + "device reset scheduled but trigger_reset is off\n"); + return; + } + + sx_xlock(&adapter->ioctl_sx); + ena_destroy_device(adapter, false); + ena_restore_device(adapter); sx_unlock(&adapter->ioctl_sx); } @@ -4403,6 +4483,7 @@ ena_detach(device_t pdev) sx_xlock(&adapter->ioctl_sx); ena_down(adapter); + ena_destroy_device(adapter, true); sx_unlock(&adapter->ioctl_sx); ena_free_all_io_rings_resources(adapter); @@ -4412,9 +4493,6 @@ ena_detach(device_t pdev) ena_free_counters((counter_u64_t *)&adapter->dev_stats, sizeof(struct ena_stats_dev)); - if (likely(ENA_FLAG_ISSET(ENA_FLAG_RSS_ACTIVE, adapter))) - ena_com_rss_destroy(ena_dev); - rc = ena_free_rx_dma_tag(adapter); if (unlikely(rc != 0)) device_printf(adapter->pdev, @@ -4425,24 +4503,15 @@ ena_detach(device_t pdev) device_printf(adapter->pdev, "Unmapped TX DMA tag associations\n"); - /* Reset the device only if the device is running. */ - if (ENA_FLAG_ISSET(ENA_FLAG_DEVICE_RUNNING, adapter)) - ena_com_dev_reset(ena_dev, adapter->reset_reason); - - ena_com_delete_host_info(ena_dev); - ena_free_irqs(adapter); - ena_com_abort_admin_commands(ena_dev); + ena_free_pci_resources(adapter); - ena_com_wait_for_abort_completion(ena_dev); + if (likely(ENA_FLAG_ISSET(ENA_FLAG_RSS_ACTIVE, adapter))) + ena_com_rss_destroy(ena_dev); - ena_com_admin_destroy(ena_dev); + ena_com_delete_host_info(ena_dev); - ena_com_mmio_reg_read_request_destroy(ena_dev); - - ena_free_pci_resources(adapter); - mtx_destroy(&adapter->global_mtx); sx_destroy(&adapter->ioctl_sx); @@ -4480,15 +4549,13 @@ ena_update_on_link_change(void *adapter_data, if (status != 0) { device_printf(adapter->pdev, "link is UP\n"); - if_link_state_change(ifp, LINK_STATE_UP); ENA_FLAG_SET_ATOMIC(ENA_FLAG_LINK_UP, adapter); - } else if (status == 0) { + if (!ENA_FLAG_ISSET(ENA_FLAG_ONGOING_RESET, adapter)) + if_link_state_change(ifp, LINK_STATE_UP); + } else { device_printf(adapter->pdev, "link is DOWN\n"); if_link_state_change(ifp, LINK_STATE_DOWN); ENA_FLAG_CLEAR_ATOMIC(ENA_FLAG_LINK_UP, adapter); - } else { - device_printf(adapter->pdev, "invalid value recvd\n"); - BUG(); } } Modified: head/sys/dev/ena/ena.h ============================================================================== --- head/sys/dev/ena/ena.h Thu May 30 13:37:15 2019 (r348408) +++ head/sys/dev/ena/ena.h Thu May 30 13:39:25 2019 (r348409) @@ -164,6 +164,7 @@ enum ena_flags_t { ENA_FLAG_MSIX_ENABLED, ENA_FLAG_TRIGGER_RESET, ENA_FLAG_ONGOING_RESET, + ENA_FLAG_DEV_UP_BEFORE_RESET, ENA_FLAG_RSS_ACTIVE, ENA_FLAGS_NUMBER = ENA_FLAG_RSS_ACTIVE }; From owner-svn-src-head@freebsd.org Thu May 30 13:40:52 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9948F15C3453; Thu, 30 May 2019 13:40:52 +0000 (UTC) (envelope-from mw@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 3CFD48B292; Thu, 30 May 2019 13:40:52 +0000 (UTC) (envelope-from mw@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1947219CCC; Thu, 30 May 2019 13:40:52 +0000 (UTC) (envelope-from mw@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x4UDepZR075260; Thu, 30 May 2019 13:40:51 GMT (envelope-from mw@FreeBSD.org) Received: (from mw@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4UDeplw075259; Thu, 30 May 2019 13:40:51 GMT (envelope-from mw@FreeBSD.org) Message-Id: <201905301340.x4UDeplw075259@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mw set sender to mw@FreeBSD.org using -f From: Marcin Wojtas Date: Thu, 30 May 2019 13:40:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r348410 - head/sys/dev/ena X-SVN-Group: head X-SVN-Commit-Author: mw X-SVN-Commit-Paths: head/sys/dev/ena X-SVN-Commit-Revision: 348410 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 3CFD48B292 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.98 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.98)[-0.980,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 30 May 2019 13:40:52 -0000 Author: mw Date: Thu May 30 13:40:51 2019 New Revision: 348410 URL: https://svnweb.freebsd.org/changeset/base/348410 Log: Fix Tx offloads for fragmented pkt headers in ENA If the headers of the packets are split into multiple segments of the mbuf chain, the previous version of ena_tx_csum which was assuming, that all segments will lay in the first mbuf, will eventually fail to map the headers properties to meta descriptor. That will cause Tx checksum offload to do not work and was leading to memory corruption. It could even cause the crash of the system. Submitted by: Michal Krawczyk Obtained from: Semihalf Sponsored by: Amazon, Inc. Modified: head/sys/dev/ena/ena.c Modified: head/sys/dev/ena/ena.c ============================================================================== --- head/sys/dev/ena/ena.c Thu May 30 13:39:25 2019 (r348409) +++ head/sys/dev/ena/ena.c Thu May 30 13:40:51 2019 (r348410) @@ -2683,6 +2683,7 @@ ena_tx_csum(struct ena_com_tx_ctx *ena_tx_ctx, struct { struct ena_com_tx_meta *ena_meta; struct ether_vlan_header *eh; + struct mbuf *mbuf_next; u32 mss; bool offload; uint16_t etype; @@ -2690,6 +2691,7 @@ ena_tx_csum(struct ena_com_tx_ctx *ena_tx_ctx, struct struct ip *ip; int iphlen; struct tcphdr *th; + int offset; offload = false; ena_meta = &ena_tx_ctx->ena_meta; @@ -2719,9 +2721,12 @@ ena_tx_csum(struct ena_com_tx_ctx *ena_tx_ctx, struct ehdrlen = ETHER_HDR_LEN; } - ip = (struct ip *)(mbuf->m_data + ehdrlen); + mbuf_next = m_getptr(mbuf, ehdrlen, &offset); + ip = (struct ip *)(mtodo(mbuf_next, offset)); iphlen = ip->ip_hl << 2; - th = (struct tcphdr *)((caddr_t)ip + iphlen); + + mbuf_next = m_getptr(mbuf, iphlen + ehdrlen, &offset); + th = (struct tcphdr *)(mtodo(mbuf_next, offset)); if ((mbuf->m_pkthdr.csum_flags & CSUM_IP) != 0) { ena_tx_ctx->l3_csum_enable = 1; From owner-svn-src-head@freebsd.org Thu May 30 13:41:40 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 993AF15C34C9; Thu, 30 May 2019 13:41:40 +0000 (UTC) (envelope-from mw@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id E17068B565; Thu, 30 May 2019 13:41:39 +0000 (UTC) (envelope-from mw@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id BD6E819CFC; Thu, 30 May 2019 13:41:39 +0000 (UTC) (envelope-from mw@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x4UDfdIA076295; Thu, 30 May 2019 13:41:39 GMT (envelope-from mw@FreeBSD.org) Received: (from mw@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4UDfdul076294; Thu, 30 May 2019 13:41:39 GMT (envelope-from mw@FreeBSD.org) Message-Id: <201905301341.x4UDfdul076294@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mw set sender to mw@FreeBSD.org using -f From: Marcin Wojtas Date: Thu, 30 May 2019 13:41:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r348411 - head/sys/dev/ena X-SVN-Group: head X-SVN-Commit-Author: mw X-SVN-Commit-Paths: head/sys/dev/ena X-SVN-Commit-Revision: 348411 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: E17068B565 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.98 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.98)[-0.981,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 30 May 2019 13:41:40 -0000 Author: mw Date: Thu May 30 13:41:39 2019 New Revision: 348411 URL: https://svnweb.freebsd.org/changeset/base/348411 Log: Unify new line characters in the ENA driver Some messages were missing new line character and traces were not having unified behavior. To fix that, each trace and printout should add new line character at the end of each string - that should improve readability. Submitted by: Rafal Kozik Michal Krawczyk Obtained from: Semihalf Sponsored by: Amazon, Inc. Modified: head/sys/dev/ena/ena.c Modified: head/sys/dev/ena/ena.c ============================================================================== --- head/sys/dev/ena/ena.c Thu May 30 13:40:51 2019 (r348410) +++ head/sys/dev/ena/ena.c Thu May 30 13:41:39 2019 (r348411) @@ -308,7 +308,7 @@ ena_probe(device_t dev) while (ent->vendor_id != 0) { if ((pci_vendor_id == ent->vendor_id) && (pci_device_id == ent->device_id)) { - ena_trace(ENA_DBG, "vendor=%x device=%x ", + ena_trace(ENA_DBG, "vendor=%x device=%x\n", pci_vendor_id, pci_device_id); sprintf(adapter_name, DEVICE_DESC); @@ -969,7 +969,7 @@ ena_alloc_rx_mbuf(struct ena_adapter *adapter, /* Map packets for DMA */ ena_trace(ENA_DBG | ENA_RSC | ENA_RXPTH, - "Using tag %p for buffers' DMA mapping, mbuf %p len: %d", + "Using tag %p for buffers' DMA mapping, mbuf %p len: %d\n", adapter->rx_buf_tag,rx_info->mbuf, rx_info->mbuf->m_len); error = bus_dmamap_load_mbuf_sg(adapter->rx_buf_tag, rx_info->map, rx_info->mbuf, segs, &nsegs, BUS_DMA_NOWAIT); @@ -1030,7 +1030,7 @@ ena_refill_rx_bufs(struct ena_ring *rx_ring, uint32_t uint32_t i; int rc; - ena_trace(ENA_DBG | ENA_RXPTH | ENA_RSC, "refill qid: %d", + ena_trace(ENA_DBG | ENA_RXPTH | ENA_RSC, "refill qid: %d\n", rx_ring->qid); next_to_use = rx_ring->next_to_use; @@ -1039,7 +1039,7 @@ ena_refill_rx_bufs(struct ena_ring *rx_ring, uint32_t struct ena_rx_buffer *rx_info; ena_trace(ENA_DBG | ENA_RXPTH | ENA_RSC, - "RX buffer - next to use: %d", next_to_use); + "RX buffer - next to use: %d\n", next_to_use); req_id = rx_ring->free_rx_ids[next_to_use]; rx_info = &rx_ring->rx_buffer_info[req_id]; @@ -1143,12 +1143,12 @@ ena_free_tx_bufs(struct ena_adapter *adapter, unsigned if (print_once) { device_printf(adapter->pdev, - "free uncompleted tx mbuf qid %d idx 0x%x", + "free uncompleted tx mbuf qid %d idx 0x%x\n", qid, i); print_once = false; } else { ena_trace(ENA_DBG, - "free uncompleted tx mbuf qid %d idx 0x%x", + "free uncompleted tx mbuf qid %d idx 0x%x\n", qid, i); } @@ -1404,7 +1404,7 @@ ena_tx_cleanup(struct ena_ring *tx_ring) tx_info->seg_mapped = false; } - ena_trace(ENA_DBG | ENA_TXPTH, "tx: q %d mbuf %p completed", + ena_trace(ENA_DBG | ENA_TXPTH, "tx: q %d mbuf %p completed\n", tx_ring->qid, mbuf); m_freem(mbuf); @@ -1429,7 +1429,7 @@ ena_tx_cleanup(struct ena_ring *tx_ring) work_done = TX_BUDGET - budget; - ena_trace(ENA_DBG | ENA_TXPTH, "tx: q %d done. total pkts: %d", + ena_trace(ENA_DBG | ENA_TXPTH, "tx: q %d done. total pkts: %d\n", tx_ring->qid, work_done); /* If there is still something to commit update ring state */ @@ -1551,7 +1551,7 @@ ena_rx_mbuf(struct ena_ring *rx_ring, struct ena_com_r return (NULL); } - ena_trace(ENA_DBG | ENA_RXPTH, "rx_info %p, mbuf %p, paddr %jx", + ena_trace(ENA_DBG | ENA_RXPTH, "rx_info %p, mbuf %p, paddr %jx\n", rx_info, rx_info->mbuf, (uintmax_t)rx_info->ena_buf.paddr); bus_dmamap_sync(adapter->rx_buf_tag, rx_info->map, @@ -1565,7 +1565,7 @@ ena_rx_mbuf(struct ena_ring *rx_ring, struct ena_com_r /* Fill mbuf with hash key and it's interpretation for optimization */ ena_rx_hash_mbuf(rx_ring, ena_rx_ctx, mbuf); - ena_trace(ENA_DBG | ENA_RXPTH, "rx mbuf 0x%p, flags=0x%x, len: %d", + ena_trace(ENA_DBG | ENA_RXPTH, "rx mbuf 0x%p, flags=0x%x, len: %d\n", mbuf, mbuf->m_flags, mbuf->m_pkthdr.len); /* DMA address is not needed anymore, unmap it */ @@ -1615,12 +1615,12 @@ ena_rx_mbuf(struct ena_ring *rx_ring, struct ena_com_r BUS_DMASYNC_POSTREAD); if (unlikely(m_append(mbuf, len, rx_info->mbuf->m_data) == 0)) { counter_u64_add(rx_ring->rx_stats.mbuf_alloc_fail, 1); - ena_trace(ENA_WARNING, "Failed to append Rx mbuf %p", + ena_trace(ENA_WARNING, "Failed to append Rx mbuf %p\n", mbuf); } ena_trace(ENA_DBG | ENA_RXPTH, - "rx mbuf updated. len %d", mbuf->m_pkthdr.len); + "rx mbuf updated. len %d\n", mbuf->m_pkthdr.len); /* Free already appended mbuf, it won't be useful anymore */ bus_dmamap_unload(rx_ring->adapter->rx_buf_tag, rx_info->map); @@ -1650,7 +1650,7 @@ ena_rx_checksum(struct ena_ring *rx_ring, struct ena_c /* ipv4 checksum error */ mbuf->m_pkthdr.csum_flags = 0; counter_u64_add(rx_ring->rx_stats.bad_csum, 1); - ena_trace(ENA_DBG, "RX IPv4 header checksum error"); + ena_trace(ENA_DBG, "RX IPv4 header checksum error\n"); return; } @@ -1661,7 +1661,7 @@ ena_rx_checksum(struct ena_ring *rx_ring, struct ena_c /* TCP/UDP checksum error */ mbuf->m_pkthdr.csum_flags = 0; counter_u64_add(rx_ring->rx_stats.bad_csum, 1); - ena_trace(ENA_DBG, "RX L4 checksum error"); + ena_trace(ENA_DBG, "RX L4 checksum error\n"); } else { mbuf->m_pkthdr.csum_flags = CSUM_IP_CHECKED; mbuf->m_pkthdr.csum_flags |= CSUM_IP_VALID; @@ -1699,7 +1699,7 @@ ena_rx_cleanup(struct ena_ring *rx_ring) io_sq = &adapter->ena_dev->io_sq_queues[ena_qid]; next_to_clean = rx_ring->next_to_clean; - ena_trace(ENA_DBG, "rx: qid %d", qid); + ena_trace(ENA_DBG, "rx: qid %d\n", qid); do { ena_rx_ctx.ena_bufs = rx_ring->ena_bufs; @@ -1716,7 +1716,7 @@ ena_rx_cleanup(struct ena_ring *rx_ring) break; ena_trace(ENA_DBG | ENA_RXPTH, "rx: q %d got packet from ena. " - "descs #: %d l3 proto %d l4 proto %d hash: %x", + "descs #: %d l3 proto %d l4 proto %d hash: %x\n", rx_ring->qid, ena_rx_ctx.descs, ena_rx_ctx.l3_proto, ena_rx_ctx.l4_proto, ena_rx_ctx.hash); @@ -1769,7 +1769,7 @@ ena_rx_cleanup(struct ena_ring *rx_ring) } if (do_if_input != 0) { ena_trace(ENA_DBG | ENA_RXPTH, - "calling if_input() with mbuf %p", mbuf); + "calling if_input() with mbuf %p\n", mbuf); (*ifp->if_input)(ifp, mbuf); } @@ -1841,7 +1841,7 @@ ena_cleanup(void *arg, int pending) if (unlikely((if_getdrvflags(ifp) & IFF_DRV_RUNNING) == 0)) return; - ena_trace(ENA_DBG, "MSI-X TX/RX routine"); + ena_trace(ENA_DBG, "MSI-X TX/RX routine\n"); tx_ring = que->tx_ring; rx_ring = que->rx_ring; @@ -1908,7 +1908,7 @@ ena_enable_msix(struct ena_adapter *adapter) adapter->msix_entries = malloc(msix_vecs * sizeof(struct msix_entry), M_DEVBUF, M_WAITOK | M_ZERO); - ena_trace(ENA_DBG, "trying to enable MSI-X, vectors: %d", msix_vecs); + ena_trace(ENA_DBG, "trying to enable MSI-X, vectors: %d\n", msix_vecs); for (i = 0; i < msix_vecs; i++) { adapter->msix_entries[i].entry = i; @@ -2293,21 +2293,21 @@ ena_up(struct ena_adapter *adapter) ena_setup_io_intr(adapter); rc = ena_request_io_irq(adapter); if (unlikely(rc != 0)) { - ena_trace(ENA_ALERT, "err_req_irq"); + ena_trace(ENA_ALERT, "err_req_irq\n"); goto err_req_irq; } /* allocate transmit descriptors */ rc = ena_setup_all_tx_resources(adapter); if (unlikely(rc != 0)) { - ena_trace(ENA_ALERT, "err_setup_tx"); + ena_trace(ENA_ALERT, "err_setup_tx\n"); goto err_setup_tx; } /* allocate receive descriptors */ rc = ena_setup_all_rx_resources(adapter); if (unlikely(rc != 0)) { - ena_trace(ENA_ALERT, "err_setup_rx"); + ena_trace(ENA_ALERT, "err_setup_rx\n"); goto err_setup_rx; } @@ -2315,7 +2315,7 @@ ena_up(struct ena_adapter *adapter) rc = ena_create_io_queues(adapter); if (unlikely(rc != 0)) { ena_trace(ENA_ALERT, - "create IO queues failed"); + "create IO queues failed\n"); goto err_io_que; } @@ -2391,7 +2391,7 @@ static void ena_media_status(if_t ifp, struct ifmediareq *ifmr) { struct ena_adapter *adapter = if_getsoftc(ifp); - ena_trace(ENA_DBG, "enter"); + ena_trace(ENA_DBG, "enter\n"); mtx_lock(&adapter->global_mtx); @@ -2945,7 +2945,7 @@ ena_tx_map_mbuf(struct ena_ring *tx_ring, struct ena_t segs, &nsegs, BUS_DMA_NOWAIT); if (unlikely((rc != 0) || (nsegs == 0))) { ena_trace(ENA_WARNING, - "dmamap load failed! err: %d nsegs: %d", rc, nsegs); + "dmamap load failed! err: %d nsegs: %d\n", rc, nsegs); goto dma_error; } @@ -2992,11 +2992,11 @@ ena_xmit_mbuf(struct ena_ring *tx_ring, struct mbuf ** rc = ena_check_and_collapse_mbuf(tx_ring, mbuf); if (unlikely(rc != 0)) { ena_trace(ENA_WARNING, - "Failed to collapse mbuf! err: %d", rc); + "Failed to collapse mbuf! err: %d\n", rc); return (rc); } - ena_trace(ENA_DBG | ENA_TXPTH, "Tx: %d bytes", (*mbuf)->m_pkthdr.len); + ena_trace(ENA_DBG | ENA_TXPTH, "Tx: %d bytes\n", (*mbuf)->m_pkthdr.len); next_to_use = tx_ring->next_to_use; req_id = tx_ring->free_tx_ids[next_to_use]; @@ -3131,7 +3131,7 @@ ena_start_xmit(struct ena_ring *tx_ring) while ((mbuf = drbr_peek(adapter->ifp, tx_ring->br)) != NULL) { ena_trace(ENA_DBG | ENA_TXPTH, "\ndequeued mbuf %p with flags %#x and" - " header csum flags %#jx", + " header csum flags %#jx\n", mbuf, mbuf->m_flags, (uint64_t)mbuf->m_pkthdr.csum_flags); if (unlikely(!tx_ring->running)) { From owner-svn-src-head@freebsd.org Thu May 30 13:42:53 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BFC6F15C3681; Thu, 30 May 2019 13:42:53 +0000 (UTC) (envelope-from mw@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 5D5828B7B3; Thu, 30 May 2019 13:42:53 +0000 (UTC) (envelope-from mw@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4A9B219E6F; Thu, 30 May 2019 13:42:53 +0000 (UTC) (envelope-from mw@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x4UDgrxD077106; Thu, 30 May 2019 13:42:53 GMT (envelope-from mw@FreeBSD.org) Received: (from mw@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4UDgrlv077105; Thu, 30 May 2019 13:42:53 GMT (envelope-from mw@FreeBSD.org) Message-Id: <201905301342.x4UDgrlv077105@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mw set sender to mw@FreeBSD.org using -f From: Marcin Wojtas Date: Thu, 30 May 2019 13:42:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r348412 - head/sys/dev/ena X-SVN-Group: head X-SVN-Commit-Author: mw X-SVN-Commit-Paths: head/sys/dev/ena X-SVN-Commit-Revision: 348412 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 5D5828B7B3 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.98 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.98)[-0.980,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 30 May 2019 13:42:54 -0000 Author: mw Date: Thu May 30 13:42:52 2019 New Revision: 348412 URL: https://svnweb.freebsd.org/changeset/base/348412 Log: Fix NULL pointer dereference in ena_up() If the call to ena_up() in ena_restore_device() fails, next usage of `ifconfig up` will cause NULL pointer dereference. This patch adds additional checks to prevent that. Submitted by: Rafal Kozik Obtained from: Semihalf Sponsored by: Amazon, Inc. Modified: head/sys/dev/ena/ena.c Modified: head/sys/dev/ena/ena.c ============================================================================== --- head/sys/dev/ena/ena.c Thu May 30 13:41:39 2019 (r348411) +++ head/sys/dev/ena/ena.c Thu May 30 13:42:52 2019 (r348412) @@ -134,7 +134,7 @@ static void ena_cleanup(void *arg, int pending); static int ena_handle_msix(void *); static int ena_enable_msix(struct ena_adapter *); static void ena_setup_mgmnt_intr(struct ena_adapter *); -static void ena_setup_io_intr(struct ena_adapter *); +static int ena_setup_io_intr(struct ena_adapter *); static int ena_request_mgmnt_irq(struct ena_adapter *); static int ena_request_io_irq(struct ena_adapter *); static void ena_free_mgmnt_irq(struct ena_adapter *); @@ -1969,12 +1969,15 @@ ena_setup_mgmnt_intr(struct ena_adapter *adapter) adapter->msix_entries[ENA_MGMNT_IRQ_IDX].vector; } -static void +static int ena_setup_io_intr(struct ena_adapter *adapter) { static int last_bind_cpu = -1; int irq_idx; + if (adapter->msix_entries == NULL) + return (EINVAL); + for (int i = 0; i < adapter->num_queues; i++) { irq_idx = ENA_IO_IRQ_IDX(i); @@ -1997,6 +2000,8 @@ ena_setup_io_intr(struct ena_adapter *adapter) last_bind_cpu; last_bind_cpu = CPU_NEXT(last_bind_cpu); } + + return (0); } static int @@ -2290,11 +2295,15 @@ ena_up(struct ena_adapter *adapter) device_printf(adapter->pdev, "device is going UP\n"); /* setup interrupts for IO queues */ - ena_setup_io_intr(adapter); + rc = ena_setup_io_intr(adapter); + if (unlikely(rc != 0)) { + ena_trace(ENA_ALERT, "error setting up IO interrupt\n"); + goto error; + } rc = ena_request_io_irq(adapter); if (unlikely(rc != 0)) { ena_trace(ENA_ALERT, "err_req_irq\n"); - goto err_req_irq; + goto error; } /* allocate transmit descriptors */ @@ -2351,7 +2360,7 @@ err_setup_rx: ena_free_all_tx_resources(adapter); err_setup_tx: ena_free_io_irq(adapter); -err_req_irq: +error: return (rc); } From owner-svn-src-head@freebsd.org Thu May 30 13:45:42 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BF9D615C376D; Thu, 30 May 2019 13:45:42 +0000 (UTC) (envelope-from mw@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 604C78BA1E; Thu, 30 May 2019 13:45:42 +0000 (UTC) (envelope-from mw@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4D31B19E72; Thu, 30 May 2019 13:45:42 +0000 (UTC) (envelope-from mw@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x4UDjg6Z077394; Thu, 30 May 2019 13:45:42 GMT (envelope-from mw@FreeBSD.org) Received: (from mw@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4UDjgS1077393; Thu, 30 May 2019 13:45:42 GMT (envelope-from mw@FreeBSD.org) Message-Id: <201905301345.x4UDjgS1077393@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mw set sender to mw@FreeBSD.org using -f From: Marcin Wojtas Date: Thu, 30 May 2019 13:45:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r348413 - head/sys/dev/ena X-SVN-Group: head X-SVN-Commit-Author: mw X-SVN-Commit-Paths: head/sys/dev/ena X-SVN-Commit-Revision: 348413 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 604C78BA1E X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.98 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.98)[-0.980,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 30 May 2019 13:45:43 -0000 Author: mw Date: Thu May 30 13:45:41 2019 New Revision: 348413 URL: https://svnweb.freebsd.org/changeset/base/348413 Log: Improve ENA reset handling For easier debugging, the reset is being triggered and the reset reason is being set only in case it is done for the first time. Such approach will ensure that the first reset reason is not going to be overwritten and will make it easier for debugging. Also, add a reset trigger upon invalid Tx requested ID. Submitted by: Michal Krawczyk Obtained from: Semihalf Sponsored by: Amazon, Inc. Modified: head/sys/dev/ena/ena.c Modified: head/sys/dev/ena/ena.c ============================================================================== --- head/sys/dev/ena/ena.c Thu May 30 13:42:52 2019 (r348412) +++ head/sys/dev/ena/ena.c Thu May 30 13:45:41 2019 (r348413) @@ -777,8 +777,10 @@ validate_rx_req_id(struct ena_ring *rx_ring, uint16_t counter_u64_add(rx_ring->rx_stats.bad_req_id, 1); /* Trigger device reset */ - rx_ring->adapter->reset_reason = ENA_REGS_RESET_INV_RX_REQ_ID; - ENA_FLAG_SET_ATOMIC(ENA_FLAG_TRIGGER_RESET, rx_ring->adapter); + if (likely(!ENA_FLAG_ISSET(ENA_FLAG_TRIGGER_RESET, rx_ring->adapter))) { + rx_ring->adapter->reset_reason = ENA_REGS_RESET_INV_RX_REQ_ID; + ENA_FLAG_SET_ATOMIC(ENA_FLAG_TRIGGER_RESET, rx_ring->adapter); + } return (EFAULT); } @@ -1242,6 +1244,10 @@ validate_tx_req_id(struct ena_ring *tx_ring, uint16_t device_printf(adapter->pdev, "Invalid req_id: %hu\n", req_id); counter_u64_add(tx_ring->tx_stats.bad_req_id, 1); + /* Trigger device reset */ + adapter->reset_reason = ENA_REGS_RESET_INV_TX_REQ_ID; + ENA_FLAG_SET_ATOMIC(ENA_FLAG_TRIGGER_RESET, adapter); + return (EFAULT); } @@ -1799,8 +1805,10 @@ error: counter_u64_add(rx_ring->rx_stats.bad_desc_num, 1); /* Too many desc from the device. Trigger reset */ - adapter->reset_reason = ENA_REGS_RESET_TOO_MANY_RX_DESCS; - ENA_FLAG_SET_ATOMIC(ENA_FLAG_TRIGGER_RESET, adapter); + if (likely(!ENA_FLAG_ISSET(ENA_FLAG_TRIGGER_RESET, adapter))) { + adapter->reset_reason = ENA_REGS_RESET_TOO_MANY_RX_DESCS; + ENA_FLAG_SET_ATOMIC(ENA_FLAG_TRIGGER_RESET, adapter); + } return (0); } @@ -3806,8 +3814,10 @@ static void check_for_missing_keep_alive(struct ena_ad device_printf(adapter->pdev, "Keep alive watchdog timeout.\n"); counter_u64_add(adapter->dev_stats.wd_expired, 1); - adapter->reset_reason = ENA_REGS_RESET_KEEP_ALIVE_TO; - ENA_FLAG_SET_ATOMIC(ENA_FLAG_TRIGGER_RESET, adapter); + if (likely(!ENA_FLAG_ISSET(ENA_FLAG_TRIGGER_RESET, adapter))) { + adapter->reset_reason = ENA_REGS_RESET_KEEP_ALIVE_TO; + ENA_FLAG_SET_ATOMIC(ENA_FLAG_TRIGGER_RESET, adapter); + } } } @@ -3819,8 +3829,10 @@ static void check_for_admin_com_state(struct ena_adapt device_printf(adapter->pdev, "ENA admin queue is not in running state!\n"); counter_u64_add(adapter->dev_stats.admin_q_pause, 1); - adapter->reset_reason = ENA_REGS_RESET_ADMIN_TO; - ENA_FLAG_SET_ATOMIC(ENA_FLAG_TRIGGER_RESET, adapter); + if (likely(!ENA_FLAG_ISSET(ENA_FLAG_TRIGGER_RESET, adapter))) { + adapter->reset_reason = ENA_REGS_RESET_ADMIN_TO; + ENA_FLAG_SET_ATOMIC(ENA_FLAG_TRIGGER_RESET, adapter); + } } } @@ -3838,9 +3850,11 @@ check_for_rx_interrupt_queue(struct ena_adapter *adapt if (rx_ring->no_interrupt_event_cnt == ENA_MAX_NO_INTERRUPT_ITERATIONS) { device_printf(adapter->pdev, "Potential MSIX issue on Rx side " - "Queue = %d. Reset the device\n", rx_ring->qid); - adapter->reset_reason = ENA_REGS_RESET_MISS_INTERRUPT; - ENA_FLAG_SET_ATOMIC(ENA_FLAG_TRIGGER_RESET, adapter); + "Queue = %d. Reset the device\n", rx_ring->qid); + if (likely(!ENA_FLAG_ISSET(ENA_FLAG_TRIGGER_RESET, adapter))) { + adapter->reset_reason = ENA_REGS_RESET_MISS_INTERRUPT; + ENA_FLAG_SET_ATOMIC(ENA_FLAG_TRIGGER_RESET, adapter); + } return (EIO); } @@ -3878,8 +3892,13 @@ check_missing_comp_in_tx_queue(struct ena_adapter *ada device_printf(adapter->pdev, "Potential MSIX issue on Tx side Queue = %d. " "Reset the device\n", tx_ring->qid); - adapter->reset_reason = ENA_REGS_RESET_MISS_INTERRUPT; - ENA_FLAG_SET_ATOMIC(ENA_FLAG_TRIGGER_RESET, adapter); + if (likely(!ENA_FLAG_ISSET(ENA_FLAG_TRIGGER_RESET, + adapter))) { + adapter->reset_reason = + ENA_REGS_RESET_MISS_INTERRUPT; + ENA_FLAG_SET_ATOMIC(ENA_FLAG_TRIGGER_RESET, + adapter); + } return (EIO); } @@ -3901,8 +3920,10 @@ check_missing_comp_in_tx_queue(struct ena_adapter *ada "The number of lost tx completion is above the threshold " "(%d > %d). Reset the device\n", missed_tx, adapter->missing_tx_threshold); - adapter->reset_reason = ENA_REGS_RESET_MISS_TX_CMPL; - ENA_FLAG_SET_ATOMIC(ENA_FLAG_TRIGGER_RESET, adapter); + if (likely(!ENA_FLAG_ISSET(ENA_FLAG_TRIGGER_RESET, adapter))) { + adapter->reset_reason = ENA_REGS_RESET_MISS_TX_CMPL; + ENA_FLAG_SET_ATOMIC(ENA_FLAG_TRIGGER_RESET, adapter); + } rc = EIO; } From owner-svn-src-head@freebsd.org Thu May 30 13:50:46 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 17CCB15C3873; Thu, 30 May 2019 13:50:46 +0000 (UTC) (envelope-from mw@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id AE8748BD77; Thu, 30 May 2019 13:50:45 +0000 (UTC) (envelope-from mw@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 8901B19E82; Thu, 30 May 2019 13:50:45 +0000 (UTC) (envelope-from mw@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x4UDojS0077657; Thu, 30 May 2019 13:50:45 GMT (envelope-from mw@FreeBSD.org) Received: (from mw@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4UDoj2V077656; Thu, 30 May 2019 13:50:45 GMT (envelope-from mw@FreeBSD.org) Message-Id: <201905301350.x4UDoj2V077656@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mw set sender to mw@FreeBSD.org using -f From: Marcin Wojtas Date: Thu, 30 May 2019 13:50:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r348414 - head/share/man/man4 X-SVN-Group: head X-SVN-Commit-Author: mw X-SVN-Commit-Paths: head/share/man/man4 X-SVN-Commit-Revision: 348414 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: AE8748BD77 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.98 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.98)[-0.981,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 30 May 2019 13:50:46 -0000 Author: mw Date: Thu May 30 13:50:45 2019 New Revision: 348414 URL: https://svnweb.freebsd.org/changeset/base/348414 Log: Fix ENA manual issues The issues were pointed in community review: https://reviews.freebsd.org/D10427#inline-67587 Also, fix other issues found by the igor tool. Submitted by: Michal Krawczyk Obtained from: Semihalf Sponsored by: Amazon, Inc. Modified: head/share/man/man4/ena.4 Modified: head/share/man/man4/ena.4 ============================================================================== --- head/share/man/man4/ena.4 Thu May 30 13:45:41 2019 (r348413) +++ head/share/man/man4/ena.4 Thu May 30 13:50:45 2019 (r348414) @@ -27,7 +27,7 @@ .\" .\" $FreeBSD$ .\" -.Dd May 04, 2017 +.Dd August 16, 2017 .Dt ENA 4 .Os .Sh NAME @@ -35,7 +35,7 @@ .Nd "FreeBSD kernel driver for Elastic Network Adapter (ENA) family" .Sh SYNOPSIS To compile this driver into the kernel, -place the following line in your +place the following line in the kernel configuration file: .Bd -ragged -offset indent .Cd "device ena" @@ -59,8 +59,9 @@ The driver supports a range of ENA devices, is link-sp (i.e., the same driver is used for 10GbE, 25GbE, 40GbE, etc.), and has a negotiated and extendable feature set. .Pp -Some ENA devices support SR-IOV. This driver is used for both the -SR-IOV Physical Function (PF) and Virtual Function (VF) devices. +Some ENA devices support SR-IOV. +This driver is used for both the SR-IOV Physical Function (PF) and Virtual +Function (VF) devices. .Pp The ENA devices enable high speed and low overhead network traffic processing by providing multiple Tx/Rx queue pairs (the maximum number @@ -82,8 +83,8 @@ to recover in a manner transparent to the application, debug logs. .Pp Some of the ENA devices support a working mode called Low-latency -Queue (LLQ), which saves several more microseconds. This feature will -be implemented for driver in future releases. +Queue (LLQ), which saves several more microseconds. +This feature will be implemented for driver in future releases. .Sh HARDWARE Supported PCI vendor ID/device IDs: .Pp @@ -105,19 +106,23 @@ Supported PCI vendor ID/device IDs: Error occurred during initialization of the mmio register read request. .It ena%d: Can not reset device .Pp -Device could not be reset; device may not be responding or is already -during reset. +Device could not be reset. +.br +Device may not be responding or is already during reset. .It ena%d: device version is too low .Pp -Version of the controller is too low and it is not supported by the driver. +Version of the controller is too old and it is not supported by the driver. .It ena%d: Invalid dma width value %d .Pp -The controller is able to request dma transcation width. Device stopped -responding or it demanded invalid value. +The controller is able to request dma transaction width. +.br +Device stopped responding or it demanded invalid value. .It ena%d: Can not initialize ena admin queue with device .Pp -Initialization of the Admin Queue failed; device may not be responding or there -was a problem with initialization of the resources. +Initialization of the Admin Queue failed. +.br +Device may not be responding or there was a problem with initialization of +the resources. .It ena%d: Cannot get attribute for ena device rc: %d .Pp Failed to get attributes of the device from the controller. @@ -141,11 +146,14 @@ Errors occurred when trying to configure AENQ groups. .It ena%d: could not allocate irq vector: %d .It ena%d: Unable to allocate bus resource: registers .Pp -Resource allocation failed when initializing the device; driver will not -be attached. +Resource allocation failed when initializing the device. +.br +Driver will not be attached. .It ena%d: ENA device init failed (err: %d) .Pp -Device initialization failed; driver will not be attached. +Device initialization failed. +.br +Driver will not be attached. .It ena%d: could not activate irq vector: %d .Pp Error occurred when trying to activate interrupt vectors for Admin Queue. @@ -157,13 +165,16 @@ Error occurred when trying to register Admin Queue int Error occurred during configuration of the Admin Queue interrupts. .It ena%d: Enable MSI-X failed .Pp -Configuration of the MSI-X for Admin Queue failed; there could be lack -of resources or interrupts could not have been configured; driver will -not be attached. +Configuration of the MSI-X for Admin Queue failed. +.br +There could be lack of resources or interrupts could not have been configured. +.br +Driver will not be attached. .It ena%d: VLAN is in use, detach first .Pp -VLANs are being used when trying to detach the driver; VLANs should be detached -first and then detach routine should be called again. +VLANs are being used when trying to detach the driver. +.br +VLANs must be detached first and then detach routine have to be called again. .It ena%d: Unmapped RX DMA tag associations .It ena%d: Unmapped TX DMA tag associations .Pp @@ -175,8 +186,9 @@ Error occurred when trying to destroy RX/TX DMA tag. .It ena%d: Cannot fill hash control .It ena%d: WARNING: RSS was not properly initialized, it will affect bandwidth .Pp -Error occurred during initialization of one of RSS resources; device is still -going to work but it will affect performance because all RX packets will be +Error occurred during initialization of one of RSS resources. +.br +The device will work with reduced performance because all RX packets will be passed to queue 0 and there will be no hash information. .It ena%d: failed to tear down irq: %d .It ena%d: dev has no parent while releasing res for irq: %d @@ -196,16 +208,20 @@ Requested MTU value is not supported and will not be s Device stopped responding and will be reset. .It ena%d: Found a Tx that wasn't completed on time, qid %d, index %d. .Pp -Packet was pushed to the NIC but not sent within given time limit; it may -be caused by hang of the IO queue. +Packet was pushed to the NIC but not sent within given time limit. +.br +It may be caused by hang of the IO queue. .It ena%d: The number of lost tx completion is aboce the threshold (%d > %d). Reset the device .Pp -If too many Tx wasn't completed on time the device is going to be reset; it may -be caused by hanged queue or device. +If too many Tx wasn't completed on time the device is going to be reset. +.br +It may be caused by hanged queue or device. .It ena%d: trigger reset is on .Pp -Device will be reset; reset is triggered either by watchdog or if too many TX -packets were not completed on time. +Device will be reset. +.br +Reset is triggered either by watchdog or if too many TX packets were not +completed on time. .It ena%d: invalid value recvd .Pp Link status received from the device in the AENQ handler is invalid. @@ -220,7 +236,9 @@ Link status received from the device in the AENQ handl .It ena%d: could not allocate irq vector: %d .It ena%d: failed to register interrupt handler for irq %ju: %d .Pp -IO resources initialization failed. Interface will not be brought up. +IO resources initialization failed. +.br +Interface will not be brought up. .It ena%d: LRO[%d] Initialization failed! .Pp Initialization of the LRO for the RX ring failed. @@ -228,21 +246,26 @@ Initialization of the LRO for the RX ring failed. .It ena%d: failed to add buffer for rx queue %d .It ena%d: refilled rx queue %d with %d pages only .Pp -Allocation of resources used on RX path failed; if happened during -initialization of the IO queue, the interface will not be brought up. +Allocation of resources used on RX path failed. +.br +If happened during initialization of the IO queue, the interface will not be +brought up. .It ena%d: ioctl promisc/allmulti .Pp -IOCTL request for the device to work in promiscuous/allmulti mode; see +IOCTL request for the device to work in promiscuous/allmulti mode. +.br +See .Xr ifconfig 8 for more details. .It ena%d: too many fragments. Last fragment: %d! .Pp Packet with unsupported number of segments was queued for sending to the -device; packet will be dropped. -.El +device. +.br +Packet will be dropped. .Sh SUPPORT -If an issue is identified with the released source code with a supported adapter -email the specific information related to the issue to +If an issue is identified with the released source code with a supported +adapter, please email the specific information related to the issue to .Aq Mt mk@semihalf.com and .Aq Mt mw@semihalf.com . From owner-svn-src-head@freebsd.org Thu May 30 13:52:34 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0C0B615C3A5E; Thu, 30 May 2019 13:52:34 +0000 (UTC) (envelope-from mw@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id A48C38C228; Thu, 30 May 2019 13:52:33 +0000 (UTC) (envelope-from mw@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 7FA781A011; Thu, 30 May 2019 13:52:33 +0000 (UTC) (envelope-from mw@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x4UDqXZJ082642; Thu, 30 May 2019 13:52:33 GMT (envelope-from mw@FreeBSD.org) Received: (from mw@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4UDqWOu082637; Thu, 30 May 2019 13:52:32 GMT (envelope-from mw@FreeBSD.org) Message-Id: <201905301352.x4UDqWOu082637@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mw set sender to mw@FreeBSD.org using -f From: Marcin Wojtas Date: Thu, 30 May 2019 13:52:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r348416 - in head/sys: dev/ena modules/ena X-SVN-Group: head X-SVN-Commit-Author: mw X-SVN-Commit-Paths: in head/sys: dev/ena modules/ena X-SVN-Commit-Revision: 348416 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: A48C38C228 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.98 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.98)[-0.980,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 30 May 2019 13:52:34 -0000 Author: mw Date: Thu May 30 13:52:32 2019 New Revision: 348416 URL: https://svnweb.freebsd.org/changeset/base/348416 Log: Update ENA version to v2.0.0 ENAv2 introduces many new features, bug fixes and improvements. Main new features are LLQ (Low Latency Queues) and independent queues reconfiguration using sysctl commands. The year in copyright notice was updated to 2019. Submitted by: Michal Krawczyk Obtained from: Semihalf Sponsored by: Amazon, Inc. Modified: head/sys/dev/ena/ena.c head/sys/dev/ena/ena.h head/sys/dev/ena/ena_sysctl.c head/sys/dev/ena/ena_sysctl.h head/sys/modules/ena/Makefile Modified: head/sys/dev/ena/ena.c ============================================================================== --- head/sys/dev/ena/ena.c Thu May 30 13:51:11 2019 (r348415) +++ head/sys/dev/ena/ena.c Thu May 30 13:52:32 2019 (r348416) @@ -1,7 +1,7 @@ /*- * BSD LICENSE * - * Copyright (c) 2015-2017 Amazon.com, Inc. or its affiliates. + * Copyright (c) 2015-2019 Amazon.com, Inc. or its affiliates. * All rights reserved. * * Redistribution and use in source and binary forms, with or without Modified: head/sys/dev/ena/ena.h ============================================================================== --- head/sys/dev/ena/ena.h Thu May 30 13:51:11 2019 (r348415) +++ head/sys/dev/ena/ena.h Thu May 30 13:52:32 2019 (r348416) @@ -1,7 +1,7 @@ /*- * BSD LICENSE * - * Copyright (c) 2015-2017 Amazon.com, Inc. or its affiliates. + * Copyright (c) 2015-2019 Amazon.com, Inc. or its affiliates. * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -39,9 +39,9 @@ #include "ena-com/ena_com.h" #include "ena-com/ena_eth_com.h" -#define DRV_MODULE_VER_MAJOR 0 -#define DRV_MODULE_VER_MINOR 8 -#define DRV_MODULE_VER_SUBMINOR 4 +#define DRV_MODULE_VER_MAJOR 2 +#define DRV_MODULE_VER_MINOR 0 +#define DRV_MODULE_VER_SUBMINOR 0 #define DRV_MODULE_NAME "ena" Modified: head/sys/dev/ena/ena_sysctl.c ============================================================================== --- head/sys/dev/ena/ena_sysctl.c Thu May 30 13:51:11 2019 (r348415) +++ head/sys/dev/ena/ena_sysctl.c Thu May 30 13:52:32 2019 (r348416) @@ -1,7 +1,7 @@ /*- * BSD LICENSE * - * Copyright (c) 2015-2017 Amazon.com, Inc. or its affiliates. + * Copyright (c) 2015-2019 Amazon.com, Inc. or its affiliates. * All rights reserved. * * Redistribution and use in source and binary forms, with or without Modified: head/sys/dev/ena/ena_sysctl.h ============================================================================== --- head/sys/dev/ena/ena_sysctl.h Thu May 30 13:51:11 2019 (r348415) +++ head/sys/dev/ena/ena_sysctl.h Thu May 30 13:52:32 2019 (r348416) @@ -1,7 +1,7 @@ /*- * BSD LICENSE * - * Copyright (c) 2015-2017 Amazon.com, Inc. or its affiliates. + * Copyright (c) 2015-2019 Amazon.com, Inc. or its affiliates. * All rights reserved. * * Redistribution and use in source and binary forms, with or without Modified: head/sys/modules/ena/Makefile ============================================================================== --- head/sys/modules/ena/Makefile Thu May 30 13:51:11 2019 (r348415) +++ head/sys/modules/ena/Makefile Thu May 30 13:52:32 2019 (r348416) @@ -1,7 +1,7 @@ # # BSD LICENSE # -# Copyright (c) 2015-2017 Amazon.com, Inc. or its affiliates. +# Copyright (c) 2015-2019 Amazon.com, Inc. or its affiliates. # All rights reserved. # # Redistribution and use in source and binary forms, with or without From owner-svn-src-head@freebsd.org Thu May 30 14:13:10 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A2EC315C3FCA; Thu, 30 May 2019 14:13:10 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46DA78CB34; Thu, 30 May 2019 14:13:10 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 220661A367; Thu, 30 May 2019 14:13:10 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x4UEDAUp093086; Thu, 30 May 2019 14:13:10 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4UED9D5093084; Thu, 30 May 2019 14:13:09 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201905301413.x4UED9D5093084@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Thu, 30 May 2019 14:13:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r348417 - in head/sys/dev: mpr mps X-SVN-Group: head X-SVN-Commit-Author: mav X-SVN-Commit-Paths: in head/sys/dev: mpr mps X-SVN-Commit-Revision: 348417 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 46DA78CB34 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.97)[-0.971,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 30 May 2019 14:13:10 -0000 Author: mav Date: Thu May 30 14:13:09 2019 New Revision: 348417 URL: https://svnweb.freebsd.org/changeset/base/348417 Log: Fix busy status leak in case of incorrect passthrough args. MFC after: 1 week Modified: head/sys/dev/mpr/mpr_user.c head/sys/dev/mps/mps_user.c Modified: head/sys/dev/mpr/mpr_user.c ============================================================================== --- head/sys/dev/mpr/mpr_user.c Thu May 30 13:52:32 2019 (r348416) +++ head/sys/dev/mpr/mpr_user.c Thu May 30 14:13:09 2019 (r348417) @@ -791,8 +791,10 @@ mpr_user_pass_thru(struct mpr_softc *sc, mpr_pass_thru data->DataDirection = MPR_PASS_THRU_DIRECTION_READ; else data->DataOutSize = 0; - } else - return (EINVAL); + } else { + err = EINVAL; + goto RetFreeUnlocked; + } mpr_dprint(sc, MPR_USER, "%s: req 0x%jx %d rpl 0x%jx %d " "data in 0x%jx %d data out 0x%jx %d data dir %d\n", __func__, Modified: head/sys/dev/mps/mps_user.c ============================================================================== --- head/sys/dev/mps/mps_user.c Thu May 30 13:52:32 2019 (r348416) +++ head/sys/dev/mps/mps_user.c Thu May 30 14:13:09 2019 (r348417) @@ -802,8 +802,10 @@ mps_user_pass_thru(struct mps_softc *sc, mps_pass_thru data->DataDirection = MPS_PASS_THRU_DIRECTION_READ; else data->DataOutSize = 0; - } else - return (EINVAL); + } else { + err = EINVAL; + goto RetFreeUnlocked; + } mps_dprint(sc, MPS_USER, "%s: req 0x%jx %d rpl 0x%jx %d " "data in 0x%jx %d data out 0x%jx %d data dir %d\n", __func__, From owner-svn-src-head@freebsd.org Thu May 30 14:21:52 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 47E8715C4184; Thu, 30 May 2019 14:21:52 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id E15D48D1C1; Thu, 30 May 2019 14:21:51 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id BCD801A4EF; Thu, 30 May 2019 14:21:51 +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 x4UELpkS095407; Thu, 30 May 2019 14:21:51 GMT (envelope-from dchagin@FreeBSD.org) Received: (from dchagin@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4UELpD3095406; Thu, 30 May 2019 14:21:51 GMT (envelope-from dchagin@FreeBSD.org) Message-Id: <201905301421.x4UELpD3095406@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dchagin set sender to dchagin@FreeBSD.org using -f From: Dmitry Chagin Date: Thu, 30 May 2019 14:21:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r348418 - head/sys/compat/linux X-SVN-Group: head X-SVN-Commit-Author: dchagin X-SVN-Commit-Paths: head/sys/compat/linux X-SVN-Commit-Revision: 348418 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: E15D48D1C1 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.97)[-0.971,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 30 May 2019 14:21:52 -0000 Author: dchagin Date: Thu May 30 14:21:51 2019 New Revision: 348418 URL: https://svnweb.freebsd.org/changeset/base/348418 Log: Linux does not support MSG_OOB for unix(4) or non-stream oriented socket, return EOPNOTSUPP as a Linux does. Reviewed by: tijl MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D20409 Modified: head/sys/compat/linux/linux_socket.c Modified: head/sys/compat/linux/linux_socket.c ============================================================================== --- head/sys/compat/linux/linux_socket.c Thu May 30 14:13:09 2019 (r348417) +++ head/sys/compat/linux/linux_socket.c Thu May 30 14:21:51 2019 (r348418) @@ -939,11 +939,13 @@ linux_sendmsg_common(struct thread *td, l_int s, struc struct iovec *iov; socklen_t datalen; struct sockaddr *sa; + struct socket *so; sa_family_t sa_family; + struct file *fp; void *data; l_size_t len; l_size_t clen; - int error; + int error, fflag; error = copyin(msghdr, &linux_msg, sizeof(linux_msg)); if (error != 0) @@ -974,12 +976,30 @@ linux_sendmsg_common(struct thread *td, l_int s, struc control = NULL; - if (linux_msg.msg_controllen >= sizeof(struct l_cmsghdr)) { - error = kern_getsockname(td, s, &sa, &datalen); + error = kern_getsockname(td, s, &sa, &datalen); + if (error != 0) + goto bad; + sa_family = sa->sa_family; + free(sa, M_SONAME); + + if (flags & LINUX_MSG_OOB) { + error = EOPNOTSUPP; + if (sa_family == AF_UNIX) + goto bad; + + error = getsock_cap(td, s, &cap_send_rights, &fp, + &fflag, NULL); if (error != 0) goto bad; - sa_family = sa->sa_family; - free(sa, M_SONAME); + so = fp->f_data; + if (so->so_type != SOCK_STREAM) + error = EOPNOTSUPP; + fdrop(fp, td); + if (error != 0) + goto bad; + } + + if (linux_msg.msg_controllen >= sizeof(struct l_cmsghdr)) { error = ENOBUFS; control = m_get(M_WAITOK, MT_CONTROL); From owner-svn-src-head@freebsd.org Thu May 30 14:24:29 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 432CA15C434C; Thu, 30 May 2019 14:24:29 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id D52108D3DD; Thu, 30 May 2019 14:24:28 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 9C5811A52F; Thu, 30 May 2019 14:24:28 +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 x4UEOS00098762; Thu, 30 May 2019 14:24:28 GMT (envelope-from dchagin@FreeBSD.org) Received: (from dchagin@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4UEORXr098755; Thu, 30 May 2019 14:24:27 GMT (envelope-from dchagin@FreeBSD.org) Message-Id: <201905301424.x4UEORXr098755@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dchagin set sender to dchagin@FreeBSD.org using -f From: Dmitry Chagin Date: Thu, 30 May 2019 14:24:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r348419 - in head: crypto/heimdal/lib/ipc share/man/man4 sys/compat/linux sys/kern sys/sys usr.sbin/mountd X-SVN-Group: head X-SVN-Commit-Author: dchagin X-SVN-Commit-Paths: in head: crypto/heimdal/lib/ipc share/man/man4 sys/compat/linux sys/kern sys/sys usr.sbin/mountd X-SVN-Commit-Revision: 348419 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: D52108D3DD X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.97)[-0.973,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 30 May 2019 14:24:29 -0000 Author: dchagin Date: Thu May 30 14:24:26 2019 New Revision: 348419 URL: https://svnweb.freebsd.org/changeset/base/348419 Log: Complete LOCAL_PEERCRED support. Cache pid of the remote process in the struct xucred. Do not bump XUCRED_VERSION as struct layout is not changed. PR: 215202 Reviewed by: tijl MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D20415 Modified: head/crypto/heimdal/lib/ipc/server.c head/share/man/man4/unix.4 head/sys/compat/linux/linux_socket.c head/sys/kern/kern_prot.c head/sys/kern/uipc_usrreq.c head/sys/sys/ucred.h head/usr.sbin/mountd/mountd.c Modified: head/crypto/heimdal/lib/ipc/server.c ============================================================================== --- head/crypto/heimdal/lib/ipc/server.c Thu May 30 14:21:51 2019 (r348418) +++ head/crypto/heimdal/lib/ipc/server.c Thu May 30 14:24:26 2019 (r348419) @@ -550,7 +550,7 @@ update_client_creds(struct client *c) { c->unixrights.uid = peercred.cr_uid; c->unixrights.gid = peercred.cr_gid; - c->unixrights.pid = 0; + c->unixrights.pid = peercred.cr_pid; return 1; } } Modified: head/share/man/man4/unix.4 ============================================================================== --- head/share/man/man4/unix.4 Thu May 30 14:21:51 2019 (r348418) +++ head/share/man/man4/unix.4 Thu May 30 14:24:26 2019 (r348419) @@ -310,6 +310,7 @@ struct xucred { uid_t cr_uid; /* effective user id */ short cr_ngroups; /* number of groups */ gid_t cr_groups[XU_NGROUPS]; /* groups */ + pid_t cr_pid; /* process id of the sending process */ }; .Ed The Modified: head/sys/compat/linux/linux_socket.c ============================================================================== --- head/sys/compat/linux/linux_socket.c Thu May 30 14:21:51 2019 (r348418) +++ head/sys/compat/linux/linux_socket.c Thu May 30 14:24:26 2019 (r348419) @@ -1519,10 +1519,7 @@ linux_getsockopt(struct thread *td, struct linux_getso name, &xu, UIO_SYSSPACE, &xulen); if (error != 0) return (error); - /* - * XXX Use 0 for pid as the FreeBSD does not cache peer pid. - */ - lxu.pid = 0; + lxu.pid = xu.cr_pid; lxu.uid = xu.cr_uid; lxu.gid = xu.cr_gid; return (copyout(&lxu, PTRIN(args->optval), sizeof(lxu))); Modified: head/sys/kern/kern_prot.c ============================================================================== --- head/sys/kern/kern_prot.c Thu May 30 14:21:51 2019 (r348418) +++ head/sys/kern/kern_prot.c Thu May 30 14:24:26 2019 (r348419) @@ -1957,6 +1957,14 @@ cru2x(struct ucred *cr, struct xucred *xcr) ngroups * sizeof(*cr->cr_groups)); } +void inline +cru2xt(struct thread *td, struct xucred *xcr) +{ + + cru2x(td->td_ucred, xcr); + xcr->cr_pid = td->td_proc->p_pid; +} + /* * Set initial process credentials. * Callers are responsible for providing the reference for provided credentials. Modified: head/sys/kern/uipc_usrreq.c ============================================================================== --- head/sys/kern/uipc_usrreq.c Thu May 30 14:21:51 2019 (r348418) +++ head/sys/kern/uipc_usrreq.c Thu May 30 14:24:26 2019 (r348419) @@ -912,7 +912,7 @@ uipc_listen(struct socket *so, int backlog, struct thr SOCK_LOCK(so); error = solisten_proto_check(so); if (error == 0) { - cru2x(td->td_ucred, &unp->unp_peercred); + cru2xt(td, &unp->unp_peercred); solisten_proto(so, backlog); } SOCK_UNLOCK(so); @@ -1656,7 +1656,7 @@ void unp_copy_peercred(struct thread *td, struct unpcb *client_unp, struct unpcb *server_unp, struct unpcb *listen_unp) { - cru2x(td->td_ucred, &client_unp->unp_peercred); + cru2xt(td, &client_unp->unp_peercred); client_unp->unp_flags |= UNP_HAVEPC; memcpy(&server_unp->unp_peercred, &listen_unp->unp_peercred, @@ -2755,8 +2755,8 @@ db_print_xucred(int indent, struct xucred *xu) int comma, i; db_print_indent(indent); - db_printf("cr_version: %u cr_uid: %u cr_ngroups: %d\n", - xu->cr_version, xu->cr_uid, xu->cr_ngroups); + db_printf("cr_version: %u cr_uid: %u cr_pid: %d cr_ngroups: %d\n", + xu->cr_version, xu->cr_uid, xu->cr_pid, xu->cr_ngroups); db_print_indent(indent); db_printf("cr_groups: "); comma = 0; Modified: head/sys/sys/ucred.h ============================================================================== --- head/sys/sys/ucred.h Thu May 30 14:21:51 2019 (r348418) +++ head/sys/sys/ucred.h Thu May 30 14:24:26 2019 (r348419) @@ -87,10 +87,14 @@ struct xucred { uid_t cr_uid; /* effective user id */ short cr_ngroups; /* number of groups */ gid_t cr_groups[XU_NGROUPS]; /* groups */ - void *_cr_unused1; /* compatibility with old ucred */ + union { + void *_cr_unused1; /* compatibility with old ucred */ + pid_t _pid; + } _cr; }; #define XUCRED_VERSION 0 +#define cr_pid _cr._pid /* This can be used for both ucred and xucred structures. */ #define cr_gid cr_groups[0] @@ -114,6 +118,7 @@ void crfree(struct ucred *cr); struct ucred *crget(void); struct ucred *crhold(struct ucred *cr); void cru2x(struct ucred *cr, struct xucred *xcr); +void cru2xt(struct thread *td, struct xucred *xcr); void crsetgroups(struct ucred *cr, int n, gid_t *groups); int groupmember(gid_t gid, struct ucred *cred); #endif /* _KERNEL */ Modified: head/usr.sbin/mountd/mountd.c ============================================================================== --- head/usr.sbin/mountd/mountd.c Thu May 30 14:21:51 2019 (r348418) +++ head/usr.sbin/mountd/mountd.c Thu May 30 14:24:26 2019 (r348419) @@ -244,7 +244,7 @@ static struct xucred def_anon = { (uid_t)65534, 1, { (gid_t)65533 }, - NULL + { NULL } }; static int force_v2 = 0; static int resvport_only = 1; From owner-svn-src-head@freebsd.org Thu May 30 15:04:10 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0E9E615C4D4E; Thu, 30 May 2019 15:04:10 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 959038EC6C; Thu, 30 May 2019 15:04:09 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 6FB7B1AC0A; Thu, 30 May 2019 15:04:09 +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 x4UF49OL019929; Thu, 30 May 2019 15:04:09 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4UF49UT019928; Thu, 30 May 2019 15:04:09 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201905301504.x4UF49UT019928@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Thu, 30 May 2019 15:04:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r348421 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 348421 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 959038EC6C X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.98 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.99)[-0.985,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 30 May 2019 15:04:10 -0000 Author: kib Date: Thu May 30 15:04:09 2019 New Revision: 348421 URL: https://svnweb.freebsd.org/changeset/base/348421 Log: Silence witness warning about duplicated mutex type. The order is correct, it is nullfs vnode interlock -> lower vnode interlock. vop_stdadd_writecount() is called from nullfs VOP_ADD_WRITECOUNT() and both take interlocks. Requested by: markj Sponsored by: The FreeBSD Foundation MFC after: 2 weeks Modified: head/sys/kern/vfs_default.c Modified: head/sys/kern/vfs_default.c ============================================================================== --- head/sys/kern/vfs_default.c Thu May 30 14:40:23 2019 (r348420) +++ head/sys/kern/vfs_default.c Thu May 30 15:04:09 2019 (r348421) @@ -1113,7 +1113,7 @@ vop_stdadd_writecount(struct vop_add_writecount_args * int error; vp = ap->a_vp; - VI_LOCK(vp); + VI_LOCK_FLAGS(vp, MTX_DUPOK); if (vp->v_writecount < 0) { error = ETXTBSY; } else { From owner-svn-src-head@freebsd.org Thu May 30 15:07:40 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 87A2715C4E1B; Thu, 30 May 2019 15:07:40 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 2B24B8EED1; Thu, 30 May 2019 15:07:40 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 014491AC0C; Thu, 30 May 2019 15:07:40 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x4UF7dCL020159; Thu, 30 May 2019 15:07:39 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4UF7dOt020158; Thu, 30 May 2019 15:07:39 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201905301507.x4UF7dOt020158@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Thu, 30 May 2019 15:07:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r348422 - head/usr.sbin/mpsutil X-SVN-Group: head X-SVN-Commit-Author: mav X-SVN-Commit-Paths: head/usr.sbin/mpsutil X-SVN-Commit-Revision: 348422 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 2B24B8EED1 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.98 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.99)[-0.985,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 30 May 2019 15:07:40 -0000 Author: mav Date: Thu May 30 15:07:39 2019 New Revision: 348422 URL: https://svnweb.freebsd.org/changeset/base/348422 Log: Pass data pointers to the driver in way in expects. Probably due to historical reasons the driver uses In/Out arguments in odd way. While this tool still never uses Out arguments to see that, make the code to not trigger EINVAL in possible future uses. MFC after: 2 weeks Modified: head/usr.sbin/mpsutil/mps_cmd.c Modified: head/usr.sbin/mpsutil/mps_cmd.c ============================================================================== --- head/usr.sbin/mpsutil/mps_cmd.c Thu May 30 15:04:09 2019 (r348421) +++ head/usr.sbin/mpsutil/mps_cmd.c Thu May 30 15:07:39 2019 (r348422) @@ -651,27 +651,32 @@ mps_pass_command(int fd, void *req, uint32_t req_len, { struct mprs_pass_thru pass; + bzero(&pass, sizeof(pass)); pass.PtrRequest = (uint64_t)(uintptr_t)req; pass.PtrReply = (uint64_t)(uintptr_t)reply; - pass.PtrData = (uint64_t)(uintptr_t)data_in; - pass.PtrDataOut = (uint64_t)(uintptr_t)data_out; pass.RequestSize = req_len; pass.ReplySize = reply_len; - pass.DataSize = datain_len; - pass.DataOutSize = dataout_len; if (datain_len && dataout_len) { + pass.PtrData = (uint64_t)(uintptr_t)data_in; + pass.PtrDataOut = (uint64_t)(uintptr_t)data_out; + pass.DataSize = datain_len; + pass.DataOutSize = dataout_len; if (is_mps) { pass.DataDirection = MPS_PASS_THRU_DIRECTION_BOTH; } else { pass.DataDirection = MPR_PASS_THRU_DIRECTION_BOTH; } } else if (datain_len) { + pass.PtrData = (uint64_t)(uintptr_t)data_in; + pass.DataSize = datain_len; if (is_mps) { pass.DataDirection = MPS_PASS_THRU_DIRECTION_READ; } else { pass.DataDirection = MPR_PASS_THRU_DIRECTION_READ; } } else if (dataout_len) { + pass.PtrData = (uint64_t)(uintptr_t)data_out; + pass.DataSize = dataout_len; if (is_mps) { pass.DataDirection = MPS_PASS_THRU_DIRECTION_WRITE; } else { From owner-svn-src-head@freebsd.org Thu May 30 15:26:40 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 52DC715C564D; Thu, 30 May 2019 15:26:40 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id E8AC790696; Thu, 30 May 2019 15:26:39 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id CB2851AF70; Thu, 30 May 2019 15:26:39 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x4UFQdos030480; Thu, 30 May 2019 15:26:39 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4UFQdrK030479; Thu, 30 May 2019 15:26:39 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201905301526.x4UFQdrK030479@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Thu, 30 May 2019 15:26:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r348430 - head/contrib/elftoolchain/elfcopy X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: head/contrib/elftoolchain/elfcopy X-SVN-Commit-Revision: 348430 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: E8AC790696 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.98 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.98)[-0.983,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 30 May 2019 15:26:40 -0000 Author: markj Date: Thu May 30 15:26:39 2019 New Revision: 348430 URL: https://svnweb.freebsd.org/changeset/base/348430 Log: elfcopy: Remove an unneeded memset. Reviewed by: emaste, trasz MFC after: 1 week Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D20445 Modified: head/contrib/elftoolchain/elfcopy/main.c Modified: head/contrib/elftoolchain/elfcopy/main.c ============================================================================== --- head/contrib/elftoolchain/elfcopy/main.c Thu May 30 15:23:43 2019 (r348429) +++ head/contrib/elftoolchain/elfcopy/main.c Thu May 30 15:26:39 2019 (r348430) @@ -1565,7 +1565,6 @@ main(int argc, char **argv) ecp = calloc(1, sizeof(*ecp)); if (ecp == NULL) err(EXIT_FAILURE, "calloc failed"); - memset(ecp, 0, sizeof(*ecp)); ecp->itf = ecp->otf = ETF_ELF; ecp->iec = ecp->oec = ELFCLASSNONE; From owner-svn-src-head@freebsd.org Thu May 30 15:28:50 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 45C7B15C56C5; Thu, 30 May 2019 15:28:50 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id B247190A6D; Thu, 30 May 2019 15:28:49 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 8A0671AF76; Thu, 30 May 2019 15:28:49 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x4UFSnf2030612; Thu, 30 May 2019 15:28:49 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4UFSnKq030610; Thu, 30 May 2019 15:28:49 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201905301528.x4UFSnKq030610@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Thu, 30 May 2019 15:28:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r348431 - head/contrib/elftoolchain/elfcopy X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: head/contrib/elftoolchain/elfcopy X-SVN-Commit-Revision: 348431 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: B247190A6D X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.97)[-0.968,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 30 May 2019 15:28:50 -0000 Author: markj Date: Thu May 30 15:28:48 2019 New Revision: 348431 URL: https://svnweb.freebsd.org/changeset/base/348431 Log: elfcopy: Optimize for insertions at the end of the section list. This is the common case when strip(1) is creating the output file. The change provides a significant speedup when running on ELF files with many sections. PR: 234949 Reviewed by: emaste MFC after: 1 week Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D20444 Modified: head/contrib/elftoolchain/elfcopy/elfcopy.h head/contrib/elftoolchain/elfcopy/sections.c Modified: head/contrib/elftoolchain/elfcopy/elfcopy.h ============================================================================== --- head/contrib/elftoolchain/elfcopy/elfcopy.h Thu May 30 15:26:39 2019 (r348430) +++ head/contrib/elftoolchain/elfcopy/elfcopy.h Thu May 30 15:28:48 2019 (r348431) @@ -138,6 +138,8 @@ struct section { TAILQ_ENTRY(section) sec_list; /* next section */ }; +TAILQ_HEAD(sectionlist, section); + /* Internal data structure for segments. */ struct segment { uint64_t vaddr; /* virtual addr (VMA) */ Modified: head/contrib/elftoolchain/elfcopy/sections.c ============================================================================== --- head/contrib/elftoolchain/elfcopy/sections.c Thu May 30 15:26:39 2019 (r348430) +++ head/contrib/elftoolchain/elfcopy/sections.c Thu May 30 15:28:48 2019 (r348431) @@ -314,18 +314,18 @@ insert_to_sec_list(struct elfcopy *ecp, struct section { struct section *s; - if (!tail) { + if (tail || TAILQ_EMPTY(&ecp->v_sec) || + TAILQ_LAST(&ecp->v_sec, sectionlist)->off <= sec->off) { + TAILQ_INSERT_TAIL(&ecp->v_sec, sec, sec_list); + } else { TAILQ_FOREACH(s, &ecp->v_sec, sec_list) { if (sec->off < s->off) { TAILQ_INSERT_BEFORE(s, sec, sec_list); - goto inc_nos; + break; } } } - TAILQ_INSERT_TAIL(&ecp->v_sec, sec, sec_list); - -inc_nos: if (sec->pseudo == 0) ecp->nos++; } From owner-svn-src-head@freebsd.org Thu May 30 16:02:41 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 303EC15C6356; Thu, 30 May 2019 16:02:41 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id CA1A791E67; Thu, 30 May 2019 16:02:40 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A58531B634; Thu, 30 May 2019 16:02:40 +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 x4UG2eFQ051513; Thu, 30 May 2019 16:02:40 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4UG2e6L051512; Thu, 30 May 2019 16:02:40 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201905301602.x4UG2e6L051512@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Thu, 30 May 2019 16:02:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r348432 - head/usr.bin/posixshmcontrol X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: head/usr.bin/posixshmcontrol X-SVN-Commit-Revision: 348432 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: CA1A791E67 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.98 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.98)[-0.983,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 30 May 2019 16:02:41 -0000 Author: kib Date: Thu May 30 16:02:40 2019 New Revision: 348432 URL: https://svnweb.freebsd.org/changeset/base/348432 Log: Minor tweaks to the layout. Sponsored by: The FreeBSD Foundation MFC after: 3 days Modified: head/usr.bin/posixshmcontrol/posixshmcontrol.1 Modified: head/usr.bin/posixshmcontrol/posixshmcontrol.1 ============================================================================== --- head/usr.bin/posixshmcontrol/posixshmcontrol.1 Thu May 30 15:28:48 2019 (r348431) +++ head/usr.bin/posixshmcontrol/posixshmcontrol.1 Thu May 30 16:02:40 2019 (r348432) @@ -27,7 +27,7 @@ .\" .\" $FreeBSD$ .\" -.Dd May 27, 2019 +.Dd May 30, 2019 .Dt POSIXSHMCONTROL 1 .Os .Sh NAME @@ -97,14 +97,14 @@ utility. Change the length of the segments. Argument to the .Fl s -option specifies new length, the human-friendly 'k', 'm', 'g' suffixes -can be used, see +option specifies new length. +The human-friendly 'k', 'm', 'g' suffixes can be used, see .Xr expand_number 3. If the option is not specified, assumed length is zero. .El .Pp For some commands, the following options may be provided: -.Bl -tag XX +.Bl -tag -width XXX .It Fl h If specified, requests human-readable display of size, see .Xr humanize_number 3 . From owner-svn-src-head@freebsd.org Thu May 30 16:04:01 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B620D15C6427; Thu, 30 May 2019 16:04:01 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 972B891FD7; Thu, 30 May 2019 16:04:00 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 867FE1B637; Thu, 30 May 2019 16:04:00 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x4UG40oD051609; Thu, 30 May 2019 16:04:00 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4UG40F4051608; Thu, 30 May 2019 16:04:00 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201905301604.x4UG40F4051608@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Thu, 30 May 2019 16:04:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r348433 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 348433 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 972B891FD7 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.98 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.98)[-0.983,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 30 May 2019 16:04:01 -0000 Author: kib Date: Thu May 30 16:04:00 2019 New Revision: 348433 URL: https://svnweb.freebsd.org/changeset/base/348433 Log: Remove TODO comment after posixshmcontrol(1) added. Sponsored by: The FreeBSD Foundation MFC after: 3 days Modified: head/sys/kern/uipc_shm.c Modified: head/sys/kern/uipc_shm.c ============================================================================== --- head/sys/kern/uipc_shm.c Thu May 30 16:02:40 2019 (r348432) +++ head/sys/kern/uipc_shm.c Thu May 30 16:04:00 2019 (r348433) @@ -36,16 +36,10 @@ * shm_open(2) and shm_unlink(2). While most of the implementation is * here, vm_mmap.c contains mapping logic changes. * - * TODO: - * - * (1) Need to export data to a userland tool via a sysctl. Should ipcs(1) - * and ipcrm(1) be expanded or should new tools to manage both POSIX - * kernel semaphores and POSIX shared memory be written? - * - * (2) Add support for this file type to fstat(1). - * - * (3) Resource limits? Does this need its own resource limits or are the - * existing limits in mmap(2) sufficient? + * posixshmcontrol(1) allows users to inspect the state of the memory + * objects. Per-uid swap resource limit controls total amount of + * memory that user can consume for anonymous objects, including + * shared. */ #include From owner-svn-src-head@freebsd.org Thu May 30 16:11:22 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1C53B15C65E0; Thu, 30 May 2019 16:11:22 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id B87A092716; Thu, 30 May 2019 16:11:21 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 620F51B77E; Thu, 30 May 2019 16:11:21 +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 x4UGBLWn056089; Thu, 30 May 2019 16:11:21 GMT (envelope-from dchagin@FreeBSD.org) Received: (from dchagin@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4UGBLuD056088; Thu, 30 May 2019 16:11:21 GMT (envelope-from dchagin@FreeBSD.org) Message-Id: <201905301611.x4UGBLuD056088@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dchagin set sender to dchagin@FreeBSD.org using -f From: Dmitry Chagin Date: Thu, 30 May 2019 16:11:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r348434 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: dchagin X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 348434 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: B87A092716 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.98 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.98)[-0.978,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 30 May 2019 16:11:22 -0000 Author: dchagin Date: Thu May 30 16:11:20 2019 New Revision: 348434 URL: https://svnweb.freebsd.org/changeset/base/348434 Log: Remove wrong inline keyword. Reported by: markj MFC after: 1 week Modified: head/sys/kern/kern_prot.c Modified: head/sys/kern/kern_prot.c ============================================================================== --- head/sys/kern/kern_prot.c Thu May 30 16:04:00 2019 (r348433) +++ head/sys/kern/kern_prot.c Thu May 30 16:11:20 2019 (r348434) @@ -1957,7 +1957,7 @@ cru2x(struct ucred *cr, struct xucred *xcr) ngroups * sizeof(*cr->cr_groups)); } -void inline +void cru2xt(struct thread *td, struct xucred *xcr) { From owner-svn-src-head@freebsd.org Thu May 30 16:49:42 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0A71115A43EF; Thu, 30 May 2019 16:49:42 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 9D89F93D4F; Thu, 30 May 2019 16:49:41 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 79FD51BD02; Thu, 30 May 2019 16:49:41 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x4UGnfon073241; Thu, 30 May 2019 16:49:41 GMT (envelope-from gjb@FreeBSD.org) Received: (from gjb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4UGnfhG073239; Thu, 30 May 2019 16:49:41 GMT (envelope-from gjb@FreeBSD.org) Message-Id: <201905301649.x4UGnfhG073239@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gjb set sender to gjb@FreeBSD.org using -f From: Glen Barber Date: Thu, 30 May 2019 16:49:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r348438 - head/release/tools X-SVN-Group: head X-SVN-Commit-Author: gjb X-SVN-Commit-Paths: head/release/tools X-SVN-Commit-Revision: 348438 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 9D89F93D4F X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.96)[-0.961,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 30 May 2019 16:49:42 -0000 Author: gjb Date: Thu May 30 16:49:40 2019 New Revision: 348438 URL: https://svnweb.freebsd.org/changeset/base/348438 Log: Fix GCE virtual machine startup. The ports/head branch recently switched to python3 as the default, which breaks the sysutils/py-google-compute-engine startup scripts, as lang/python installs lang/python3{,.x} where lang/python2{,.x} are needed. Set DEFAULT_VERSIONS in release/tools/gce.conf to python=2.7, and remove the lang/python3 inclusion in VM_EXTRA_PACKAGES. Additionally, unset DEFAULT_VERSIONS in release/tools/vmimage.subr to prevent persistence of DEFAULT_VERSIONS=python=2.7 in subsequent VM/cloud image builds. Note: at present, this affects only 13-CURRENT and 12-STABLE, as the stable/11 branch had already switched to using the 2019Q2 branch at the start of the 11.3-RELEASE cycle, so this does not immediately affect 11.3-BETA, hence the 1-week merge timeout. This had been manually tested on 13-CURRENT. Reported by: ler (privately) MFC after: 1 week Sponsored by: The FreeBSD Foundation Modified: head/release/tools/gce.conf head/release/tools/vmimage.subr Modified: head/release/tools/gce.conf ============================================================================== --- head/release/tools/gce.conf Thu May 30 16:42:57 2019 (r348437) +++ head/release/tools/gce.conf Thu May 30 16:49:40 2019 (r348438) @@ -6,10 +6,14 @@ # The default of 3GB is too small for GCE, so override the size here. export VMSIZE=20G +# The sysutils/py-google-compute-engine port needs the lang/python +# symbolic link to point to lang/python2. +export DEFAULT_VERSIONS="python=2.7" + # Set to a list of packages to install. export VM_EXTRA_PACKAGES="firstboot-freebsd-update firstboot-pkgs \ google-cloud-sdk panicmail sudo sysutils/py-google-compute-engine \ - lang/python lang/python2 lang/python3" + lang/python lang/python2" # Set to a list of third-party software to enable in rc.conf(5). export VM_RC_LIST="ntpd sshd growfs \ Modified: head/release/tools/vmimage.subr ============================================================================== --- head/release/tools/vmimage.subr Thu May 30 16:42:57 2019 (r348437) +++ head/release/tools/vmimage.subr Thu May 30 16:49:40 2019 (r348438) @@ -72,6 +72,10 @@ cleanup() { mdconfig -d -u ${mddev} fi + # Avoid inheriting the DEFAULT_VERSIONS for lang/python from + # the gce.conf. + unset DEFAULT_VERSIONS + return 0 } From owner-svn-src-head@freebsd.org Thu May 30 17:00:58 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 597F415A4B45; Thu, 30 May 2019 17:00:58 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id F2442943CB; Thu, 30 May 2019 17:00:57 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id CEBEC1BFD9; Thu, 30 May 2019 17:00:57 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x4UH0vND078294; Thu, 30 May 2019 17:00:57 GMT (envelope-from gjb@FreeBSD.org) Received: (from gjb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4UH0v2K078293; Thu, 30 May 2019 17:00:57 GMT (envelope-from gjb@FreeBSD.org) Message-Id: <201905301700.x4UH0v2K078293@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gjb set sender to gjb@FreeBSD.org using -f From: Glen Barber Date: Thu, 30 May 2019 17:00:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r348439 - head/release/tools X-SVN-Group: head X-SVN-Commit-Author: gjb X-SVN-Commit-Paths: head/release/tools X-SVN-Commit-Revision: 348439 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: F2442943CB X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.96)[-0.961,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 30 May 2019 17:00:58 -0000 Author: gjb Date: Thu May 30 17:00:57 2019 New Revision: 348439 URL: https://svnweb.freebsd.org/changeset/base/348439 Log: Increase the size of the Vagrant default image size, as the 3GB size is too small to bootstrap the firstboot_pkgs list. While here, add the growfs(8) startup script to /etc/rc.conf, as Vagrant images can be resized by modifying the Vagrantfile. Reported by: dbaio PR: 238226 MFC after: 1 week Sponsored by: The FreeBSD Foundation Modified: head/release/tools/vagrant.conf Modified: head/release/tools/vagrant.conf ============================================================================== --- head/release/tools/vagrant.conf Thu May 30 16:49:40 2019 (r348438) +++ head/release/tools/vagrant.conf Thu May 30 17:00:57 2019 (r348439) @@ -3,12 +3,15 @@ # $FreeBSD$ # +# The default of 3GB is too small for Vagrant, so override the size here. +export VMSIZE=8G + # Packages to install into the image we're creating. This is a deliberately # minimalist set, providing only the packages necessary to bootstrap. export VM_EXTRA_PACKAGES="firstboot-freebsd-update firstboot-pkgs" # Set to a list of third-party software to enable in rc.conf(5). -export VM_RC_LIST="firstboot_freebsd_update firstboot_pkgs" +export VM_RC_LIST="firstboot_freebsd_update firstboot_pkgs growfs" vagrant_common () { # The firstboot_pkgs rc.d script will download the repository From owner-svn-src-head@freebsd.org Thu May 30 17:27:41 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 88F5815A5AEB; Thu, 30 May 2019 17:27:41 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 273F49574D; Thu, 30 May 2019 17:27: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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 027241C3DB; Thu, 30 May 2019 17:27: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 x4UHReQu093928; Thu, 30 May 2019 17:27:40 GMT (envelope-from np@FreeBSD.org) Received: (from np@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4UHReMi093927; Thu, 30 May 2019 17:27:40 GMT (envelope-from np@FreeBSD.org) Message-Id: <201905301727.x4UHReMi093927@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: np set sender to np@FreeBSD.org using -f From: Navdeep Parhar Date: Thu, 30 May 2019 17:27:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r348440 - head/sys/dev/cxgbe/tom X-SVN-Group: head X-SVN-Commit-Author: np X-SVN-Commit-Paths: head/sys/dev/cxgbe/tom X-SVN-Commit-Revision: 348440 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 273F49574D X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.98 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.98)[-0.981,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 30 May 2019 17:27:41 -0000 Author: np Date: Thu May 30 17:27:40 2019 New Revision: 348440 URL: https://svnweb.freebsd.org/changeset/base/348440 Log: cxgbe/t4_tom: Do not attempt to look up entries in the TCB history if it hasn't been initialized. This fixes a bug in r346570 that could cause a panic when servicing TCP_INFO for offloaded connections. MFC after: 3 days Sponsored by: Chelsio Communications Modified: head/sys/dev/cxgbe/tom/t4_tom.c Modified: head/sys/dev/cxgbe/tom/t4_tom.c ============================================================================== --- head/sys/dev/cxgbe/tom/t4_tom.c Thu May 30 17:00:57 2019 (r348439) +++ head/sys/dev/cxgbe/tom/t4_tom.c Thu May 30 17:27:40 2019 (r348440) @@ -537,6 +537,9 @@ lookup_tcb_histent(struct adapter *sc, u_int tid, bool MPASS(tid < sc->tids.ntids); + if (td->tcb_history == NULL) + return (NULL); + if (addrem) rw_wlock(&td->tcb_history_lock); else From owner-svn-src-head@freebsd.org Thu May 30 18:54:36 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EBA2815A7EE5; Thu, 30 May 2019 18:54:35 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 8D8B369C20; Thu, 30 May 2019 18:54:35 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 68C2E1D31A; Thu, 30 May 2019 18:54:35 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x4UIsZva040662; Thu, 30 May 2019 18:54:35 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4UIsYJk040660; Thu, 30 May 2019 18:54:34 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201905301854.x4UIsYJk040660@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Thu, 30 May 2019 18:54:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r348443 - head/contrib/elftoolchain/readelf X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: head/contrib/elftoolchain/readelf X-SVN-Commit-Revision: 348443 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 8D8B369C20 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.97)[-0.971,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 30 May 2019 18:54:36 -0000 Author: markj Date: Thu May 30 18:54:34 2019 New Revision: 348443 URL: https://svnweb.freebsd.org/changeset/base/348443 Log: readelf: Make -t imply -S, for compatibility with GNU binutils. Reported by: jhb Reviewed by: emaste MFC after: 1 week Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D20475 Modified: head/contrib/elftoolchain/readelf/readelf.1 head/contrib/elftoolchain/readelf/readelf.c Modified: head/contrib/elftoolchain/readelf/readelf.1 ============================================================================== --- head/contrib/elftoolchain/readelf/readelf.1 Thu May 30 18:44:19 2019 (r348442) +++ head/contrib/elftoolchain/readelf/readelf.1 Thu May 30 18:54:34 2019 (r348443) @@ -24,7 +24,7 @@ .\" .\" $Id: readelf.1 3642 2018-10-14 14:24:28Z jkoshy $ .\" -.Dd September 13, 2012 +.Dd May 30, 2019 .Dt READELF 1 .Os .Sh NAME @@ -113,6 +113,8 @@ Print symbol tables. .It Fl t | Fl -section-details Print additional information about sections, such as the flags fields in section headers. +Implies +.Fl S . .It Fl v | Fl -version Prints a version identifier for .Nm Modified: head/contrib/elftoolchain/readelf/readelf.c ============================================================================== --- head/contrib/elftoolchain/readelf/readelf.c Thu May 30 18:44:19 2019 (r348442) +++ head/contrib/elftoolchain/readelf/readelf.c Thu May 30 18:54:34 2019 (r348443) @@ -7500,7 +7500,7 @@ main(int argc, char **argv) re->options |= RE_S; break; case 't': - re->options |= RE_T; + re->options |= RE_SS | RE_T; break; case 'u': re->options |= RE_U; From owner-svn-src-head@freebsd.org Thu May 30 19:18:03 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E7DDB15A853A; Thu, 30 May 2019 19:18:02 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 88A346A68B; Thu, 30 May 2019 19:18:02 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 5F12E1D687; Thu, 30 May 2019 19:18:02 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x4UJI2Vh051319; Thu, 30 May 2019 19:18:02 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4UJI2s7051318; Thu, 30 May 2019 19:18:02 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201905301918.x4UJI2s7051318@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Thu, 30 May 2019 19:18:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r348444 - head/lib/libelftc X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: head/lib/libelftc X-SVN-Commit-Revision: 348444 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 88A346A68B X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.97)[-0.971,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 30 May 2019 19:18:03 -0000 Author: markj Date: Thu May 30 19:18:01 2019 New Revision: 348444 URL: https://svnweb.freebsd.org/changeset/base/348444 Log: libelftc: Add MLINKS. Reviewed by: emaste MFC after: 1 week Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D20474 Modified: head/lib/libelftc/Makefile Modified: head/lib/libelftc/Makefile ============================================================================== --- head/lib/libelftc/Makefile Thu May 30 18:54:34 2019 (r348443) +++ head/lib/libelftc/Makefile Thu May 30 19:18:01 2019 (r348444) @@ -38,6 +38,19 @@ MAN+= elftc.3 \ elftc_string_table_create.3 \ elftc_version.3 +MLINKS+= \ + elftc_bfd_find_target.3 elftc_bfd_target_class.3 \ + elftc_bfd_find_target.3 elftc_bfd_target_byteorder.3 \ + elftc_bfd_find_target.3 elftc_bfd_target_flavor.3 \ + elftc_bfd_find_target.3 elftc_bfd_target_machine.3 \ + elftc_string_table_create.3 elftc_string_table_destroy.3 \ + elftc_string_table_create.3 elftc_string_table_from_section.3 \ + elftc_string_table_create.3 elftc_string_table_image.3 \ + elftc_string_table_create.3 elftc_string_table_insert.3 \ + elftc_string_table_create.3 elftc_string_table_lookup.3 \ + elftc_string_table_create.3 elftc_string_table_remove.3 \ + elftc_string_table_create.3 elftc_string_table_to_string.3 + # This same hack is in lib/libelf/Makefile and usr.bin/readelf/Makefile # We need to link against the correct version of these files. One # solution is to include ../../sys in the include path. This causes From owner-svn-src-head@freebsd.org Thu May 30 20:42:37 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D1E1315AA6AE; Thu, 30 May 2019 20:42:37 +0000 (UTC) (envelope-from lwhsu@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 769546D161; Thu, 30 May 2019 20:42:37 +0000 (UTC) (envelope-from lwhsu@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 50CE51E5BB; Thu, 30 May 2019 20:42:37 +0000 (UTC) (envelope-from lwhsu@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x4UKgbBm097885; Thu, 30 May 2019 20:42:37 GMT (envelope-from lwhsu@FreeBSD.org) Received: (from lwhsu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4UKgbXK097884; Thu, 30 May 2019 20:42:37 GMT (envelope-from lwhsu@FreeBSD.org) Message-Id: <201905302042.x4UKgbXK097884@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: lwhsu set sender to lwhsu@FreeBSD.org using -f From: Li-Wen Hsu Date: Thu, 30 May 2019 20:42:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r348445 - head/sys/dev/ixl X-SVN-Group: head X-SVN-Commit-Author: lwhsu X-SVN-Commit-Paths: head/sys/dev/ixl X-SVN-Commit-Revision: 348445 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 769546D161 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.93 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.93)[-0.933,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 30 May 2019 20:42:38 -0000 Author: lwhsu Date: Thu May 30 20:42:36 2019 New Revision: 348445 URL: https://svnweb.freebsd.org/changeset/base/348445 Log: Add the missing braces to fix the code not guarded by the if clause and has misleading indentation. This is found by gcc -Wmisleading-indentation Approved by: erj MFC after: 3 days Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D20428 Modified: head/sys/dev/ixl/i40e_common.c Modified: head/sys/dev/ixl/i40e_common.c ============================================================================== --- head/sys/dev/ixl/i40e_common.c Thu May 30 19:18:01 2019 (r348444) +++ head/sys/dev/ixl/i40e_common.c Thu May 30 20:42:36 2019 (r348445) @@ -383,13 +383,14 @@ void i40e_debug_aq(struct i40e_hw *hw, enum i40e_debug **/ bool i40e_check_asq_alive(struct i40e_hw *hw) { - if (hw->aq.asq.len) + if (hw->aq.asq.len) { if (!i40e_is_vf(hw)) return !!(rd32(hw, hw->aq.asq.len) & I40E_PF_ATQLEN_ATQENABLE_MASK); - if (i40e_is_vf(hw)) + else return !!(rd32(hw, hw->aq.asq.len) & I40E_VF_ATQLEN1_ATQENABLE_MASK); + } return FALSE; } From owner-svn-src-head@freebsd.org Thu May 30 20:56:25 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CA5B115AAA07; Thu, 30 May 2019 20:56:25 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 6E2576D7F7; Thu, 30 May 2019 20:56:25 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 5369F1E781; Thu, 30 May 2019 20:56:25 +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 x4UKuP4M003782; Thu, 30 May 2019 20:56:25 GMT (envelope-from brooks@FreeBSD.org) Received: (from brooks@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4UKuNnW003771; Thu, 30 May 2019 20:56:23 GMT (envelope-from brooks@FreeBSD.org) Message-Id: <201905302056.x4UKuNnW003771@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: brooks set sender to brooks@FreeBSD.org using -f From: Brooks Davis Date: Thu, 30 May 2019 20:56:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r348446 - in head/sys: amd64/linux amd64/linux32 arm64/linux compat/cloudabi32 compat/cloudabi64 compat/freebsd32 i386/linux kern X-SVN-Group: head X-SVN-Commit-Author: brooks X-SVN-Commit-Paths: in head/sys: amd64/linux amd64/linux32 arm64/linux compat/cloudabi32 compat/cloudabi64 compat/freebsd32 i386/linux kern X-SVN-Commit-Revision: 348446 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 6E2576D7F7 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.96)[-0.965,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 30 May 2019 20:56:26 -0000 Author: brooks Date: Thu May 30 20:56:23 2019 New Revision: 348446 URL: https://svnweb.freebsd.org/changeset/base/348446 Log: makesyscalls.sh: always use absolute path for syscalls.conf syscalls.conf is included using "." which per the Open Group: If file does not contain a , the shell shall use the search path specified by PATH to find the directory containing file. POSIX shells don't fall back to the current working directory. Submitted by: Nathaniel Wesley Filardo Reviewed by: bdrewery Sponsored by: DARPA, AFRL Differential Revision: https://reviews.freebsd.org/D20476 Modified: head/sys/amd64/linux/Makefile head/sys/amd64/linux32/Makefile head/sys/arm64/linux/Makefile head/sys/compat/cloudabi32/Makefile head/sys/compat/cloudabi64/Makefile head/sys/compat/freebsd32/Makefile head/sys/i386/linux/Makefile head/sys/kern/makesyscalls.sh Modified: head/sys/amd64/linux/Makefile ============================================================================== --- head/sys/amd64/linux/Makefile Thu May 30 20:42:36 2019 (r348445) +++ head/sys/amd64/linux/Makefile Thu May 30 20:56:23 2019 (r348446) @@ -11,5 +11,5 @@ all: sysent: linux_sysent.c linux_syscall.h linux_proto.h linux_syscalls.c linux_systrace_args.c linux_sysent.c linux_syscall.h linux_proto.h linux_syscalls.c linux_systrace_args.c: \ - ../../kern/makesyscalls.sh syscalls.master syscalls.conf - sh ../../kern/makesyscalls.sh syscalls.master syscalls.conf + ../../kern/makesyscalls.sh syscalls.master ${.CURDIR}/syscalls.conf + sh ../../kern/makesyscalls.sh syscalls.master ${.CURDIR}/syscalls.conf Modified: head/sys/amd64/linux32/Makefile ============================================================================== --- head/sys/amd64/linux32/Makefile Thu May 30 20:42:36 2019 (r348445) +++ head/sys/amd64/linux32/Makefile Thu May 30 20:56:23 2019 (r348446) @@ -11,5 +11,5 @@ all: sysent: linux32_sysent.c linux32_syscall.h linux32_proto.h linux32_syscalls.c linux32_systrace_args.c linux32_sysent.c linux32_syscall.h linux32_proto.h linux32_syscalls.c linux32_systrace_args.c: ../../kern/makesyscalls.sh \ - syscalls.master syscalls.conf - sh ../../kern/makesyscalls.sh syscalls.master syscalls.conf + syscalls.master ${.CURDIR}/syscalls.conf + sh ../../kern/makesyscalls.sh syscalls.master ${.CURDIR}/syscalls.conf Modified: head/sys/arm64/linux/Makefile ============================================================================== --- head/sys/arm64/linux/Makefile Thu May 30 20:42:36 2019 (r348445) +++ head/sys/arm64/linux/Makefile Thu May 30 20:56:23 2019 (r348446) @@ -11,5 +11,5 @@ all: sysent: linux_sysent.c linux_syscall.h linux_proto.h linux_syscalls.c linux_systrace_args.c linux_sysent.c linux_syscall.h linux_proto.h linux_syscalls.c linux_systrace_args.c: \ - ../../kern/makesyscalls.sh syscalls.master syscalls.conf - sh ../../kern/makesyscalls.sh syscalls.master syscalls.conf + ../../kern/makesyscalls.sh syscalls.master ${.CURDIR}/syscalls.conf + sh ../../kern/makesyscalls.sh syscalls.master ${.CURDIR}/syscalls.conf Modified: head/sys/compat/cloudabi32/Makefile ============================================================================== --- head/sys/compat/cloudabi32/Makefile Thu May 30 20:42:36 2019 (r348445) +++ head/sys/compat/cloudabi32/Makefile Thu May 30 20:56:23 2019 (r348446) @@ -12,6 +12,6 @@ sysent: cloudabi32_sysent.c cloudabi32_syscall.h cloud cloudabi32_sysent.c cloudabi32_syscall.h cloudabi32_proto.h \ cloudabi32_syscalls.c cloudabi32_systrace_args.c: \ ../../kern/makesyscalls.sh ../../contrib/cloudabi/syscalls32.master \ - syscalls.conf + ${.CURDIR}/syscalls.conf sh ../../kern/makesyscalls.sh ../../contrib/cloudabi/syscalls32.master \ - syscalls.conf + ${.CURDIR}/syscalls.conf Modified: head/sys/compat/cloudabi64/Makefile ============================================================================== --- head/sys/compat/cloudabi64/Makefile Thu May 30 20:42:36 2019 (r348445) +++ head/sys/compat/cloudabi64/Makefile Thu May 30 20:56:23 2019 (r348446) @@ -12,6 +12,6 @@ sysent: cloudabi64_sysent.c cloudabi64_syscall.h cloud cloudabi64_sysent.c cloudabi64_syscall.h cloudabi64_proto.h \ cloudabi64_syscalls.c cloudabi64_systrace_args.c: \ ../../kern/makesyscalls.sh ../../contrib/cloudabi/syscalls64.master \ - syscalls.conf + ${.CURDIR}/syscalls.conf sh ../../kern/makesyscalls.sh ../../contrib/cloudabi/syscalls64.master \ - syscalls.conf + ${.CURDIR}/syscalls.conf Modified: head/sys/compat/freebsd32/Makefile ============================================================================== --- head/sys/compat/freebsd32/Makefile Thu May 30 20:42:36 2019 (r348445) +++ head/sys/compat/freebsd32/Makefile Thu May 30 20:56:23 2019 (r348446) @@ -11,8 +11,8 @@ all: sysent: freebsd32_sysent.c freebsd32_syscall.h freebsd32_proto.h freebsd32_systrace_args.c freebsd32_sysent.c freebsd32_syscalls.c freebsd32_syscall.h freebsd32_proto.h freebsd32_systrace_args.c : \ - ../../kern/makesyscalls.sh syscalls.master syscalls.conf ../../kern/capabilities.conf - sh ../../kern/makesyscalls.sh syscalls.master syscalls.conf + ../../kern/makesyscalls.sh syscalls.master ${.CURDIR}/syscalls.conf ../../kern/capabilities.conf + sh ../../kern/makesyscalls.sh syscalls.master ${.CURDIR}/syscalls.conf clean: rm -f freebsd32_sysent.c freebsd32_syscalls.c freebsd32_syscall.h freebsd32_proto.h Modified: head/sys/i386/linux/Makefile ============================================================================== --- head/sys/i386/linux/Makefile Thu May 30 20:42:36 2019 (r348445) +++ head/sys/i386/linux/Makefile Thu May 30 20:56:23 2019 (r348446) @@ -11,5 +11,5 @@ all: sysent: linux_sysent.c linux_syscall.h linux_proto.h linux_syscalls.c linux_systrace_args.c linux_sysent.c linux_syscall.h linux_proto.h linux_syscalls.c linux_systrace_args.c: \ - ../../kern/makesyscalls.sh syscalls.master syscalls.conf - sh ../../kern/makesyscalls.sh syscalls.master syscalls.conf + ../../kern/makesyscalls.sh syscalls.master ${.CURDIR}/syscalls.conf + sh ../../kern/makesyscalls.sh syscalls.master ${.CURDIR}/syscalls.conf Modified: head/sys/kern/makesyscalls.sh ============================================================================== --- head/sys/kern/makesyscalls.sh Thu May 30 20:42:36 2019 (r348445) +++ head/sys/kern/makesyscalls.sh Thu May 30 20:56:23 2019 (r348446) @@ -58,7 +58,7 @@ case $# in esac if [ -n "$2" ]; then - . $2 + . "$2" fi if [ -r $capabilities_conf ]; then From owner-svn-src-head@freebsd.org Thu May 30 21:39:51 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id F2D7315AB4B3; Thu, 30 May 2019 21:39:50 +0000 (UTC) (envelope-from carlavilla@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 96CA16EA9D; Thu, 30 May 2019 21:39:50 +0000 (UTC) (envelope-from carlavilla@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 6DC581EE3C; Thu, 30 May 2019 21:39:50 +0000 (UTC) (envelope-from carlavilla@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x4ULdoCt025310; Thu, 30 May 2019 21:39:50 GMT (envelope-from carlavilla@FreeBSD.org) Received: (from carlavilla@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4ULdo5W025309; Thu, 30 May 2019 21:39:50 GMT (envelope-from carlavilla@FreeBSD.org) Message-Id: <201905302139.x4ULdo5W025309@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: carlavilla set sender to carlavilla@FreeBSD.org using -f From: Sergio Carlavilla Delgado Date: Thu, 30 May 2019 21:39:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r348447 - head/share/misc X-SVN-Group: head X-SVN-Commit-Author: carlavilla X-SVN-Commit-Paths: head/share/misc X-SVN-Commit-Revision: 348447 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 96CA16EA9D X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.96)[-0.964,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 30 May 2019 21:39:51 -0000 Author: carlavilla (doc committer) Date: Thu May 30 21:39:49 2019 New Revision: 348447 URL: https://svnweb.freebsd.org/changeset/base/348447 Log: Add Sergio Carlavilla (myself) to the committers doc, Gabor is going to be my mentor Approved by: gabor Modified: head/share/misc/committers-doc.dot Modified: head/share/misc/committers-doc.dot ============================================================================== --- head/share/misc/committers-doc.dot Thu May 30 20:56:23 2019 (r348446) +++ head/share/misc/committers-doc.dot Thu May 30 21:39:49 2019 (r348447) @@ -57,6 +57,7 @@ bhd [label="Björn Heidotting\nbhd@FreeBSD.org\n2014/1 blackend [label="Marc Fonvieille\nblackend@FreeBSD.org\n2002/06/16"] brd [label="Brad Davis\nbrd@FreeBSD.org\n2005/06/01"] brueffer [label="Christian Brueffer\nbrueffer@FreeBSD.org\n2003/01/13"] +carlavilla [label="Sergio Carlavilla\ncarlavilla@FreeBSD.org\n2019/05/16"] chinsan [label="Chinsan Huang\nchinsan@FreeBSD.org\n2006/09/20"] crees [label="Chris Rees\ncrees@FreeBSD.org\n2013/05/27"] danger [label="Daniel Gerzo\ndanger@FreeBSD.org\n2006/08/20"] @@ -132,6 +133,7 @@ gabor -> manolis gabor -> taras gabor -> issyl0 gabor -> ebrandi +gabor -> carlavilla gjb -> wblock gjb -> rene From owner-svn-src-head@freebsd.org Fri May 31 00:56:32 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C3B1815AF264; Fri, 31 May 2019 00:56:32 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 357CB751AA; Fri, 31 May 2019 00:56:32 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 091EC20FAF; Fri, 31 May 2019 00:56:32 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x4V0uVWc031794; Fri, 31 May 2019 00:56:31 GMT (envelope-from rmacklem@FreeBSD.org) Received: (from rmacklem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4V0uVwj031793; Fri, 31 May 2019 00:56:31 GMT (envelope-from rmacklem@FreeBSD.org) Message-Id: <201905310056.x4V0uVwj031793@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rmacklem set sender to rmacklem@FreeBSD.org using -f From: Rick Macklem Date: Fri, 31 May 2019 00:56:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r348451 - head/sys/fs/nfsclient X-SVN-Group: head X-SVN-Commit-Author: rmacklem X-SVN-Commit-Paths: head/sys/fs/nfsclient X-SVN-Commit-Revision: 348451 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 357CB751AA X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.98 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.98)[-0.978,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 31 May 2019 00:56:32 -0000 Author: rmacklem Date: Fri May 31 00:56:31 2019 New Revision: 348451 URL: https://svnweb.freebsd.org/changeset/base/348451 Log: Clean up silly code case. This silly code segment has existed in the sources since it was brought into FreeBSD 10 years ago. I honestly have no idea why this was done. It was possible that I thought that it might have been better to not set B_ASYNC for the "else" case, but I can't remember. Anyhow, this patch gets rid of the if/else that does the same thing either way, since it looks silly and upsets a static analyser. This will have no semantic effect on the NFS client. PR: 238167 Modified: head/sys/fs/nfsclient/nfs_clvnops.c Modified: head/sys/fs/nfsclient/nfs_clvnops.c ============================================================================== --- head/sys/fs/nfsclient/nfs_clvnops.c Fri May 31 00:00:03 2019 (r348450) +++ head/sys/fs/nfsclient/nfs_clvnops.c Fri May 31 00:56:31 2019 (r348451) @@ -2940,10 +2940,7 @@ loop: } BO_UNLOCK(bo); bremfree(bp); - if (passone || !commit) - bp->b_flags |= B_ASYNC; - else - bp->b_flags |= B_ASYNC; + bp->b_flags |= B_ASYNC; bwrite(bp); if (newnfs_sigintr(nmp, td)) { error = EINTR; From owner-svn-src-head@freebsd.org Fri May 31 01:28:49 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 87E3E15AFAB7; Fri, 31 May 2019 01:28:49 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 2C24575DB0; Fri, 31 May 2019 01:28:49 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 073C0214AD; Fri, 31 May 2019 01:28:49 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x4V1SmRA047557; Fri, 31 May 2019 01:28:48 GMT (envelope-from rmacklem@FreeBSD.org) Received: (from rmacklem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4V1Sme9047556; Fri, 31 May 2019 01:28:48 GMT (envelope-from rmacklem@FreeBSD.org) Message-Id: <201905310128.x4V1Sme9047556@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rmacklem set sender to rmacklem@FreeBSD.org using -f From: Rick Macklem Date: Fri, 31 May 2019 01:28:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r348452 - head/usr.sbin/mountd X-SVN-Group: head X-SVN-Commit-Author: rmacklem X-SVN-Commit-Paths: head/usr.sbin/mountd X-SVN-Commit-Revision: 348452 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 2C24575DB0 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.95)[-0.952,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 31 May 2019 01:28:49 -0000 Author: rmacklem Date: Fri May 31 01:28:48 2019 New Revision: 348452 URL: https://svnweb.freebsd.org/changeset/base/348452 Log: Replace a single linked list with a hash table of lists. mountd.c uses a single linked list of "struct exportlist" structures, where there is one of these for each exported file system on the NFS server. This list gets long if there are a large number of file systems exported and the list must be searched for each line in the exports file(s) when SIGHUP causes the exports file(s) to be reloaded. A simple benchmark that traverses SLIST() elements and compares two 32bit fields in the structure for equal (which is what the search is) appears to take a couple of nsec. So, for a server with 72000 exported file systems, this can take about 5sec during reload of the exports file(s). By replacing the single linked list with a hash table with a target of 10 elements per list, the time should be reduced to less than 1msec. Peter Errikson (who has a server with 72000+ exported file systems) ran a test program using 5 hashes to see how they worked. fnv_32_buf(fsid,..., 0) fnv_32_buf(fsid,..., FNV1_32_INIT) hash32_buf(fsid,..., 0) hash32_buf(fsid,..., HASHINIT) - plus simply using the low order bits of fsid.val[0]. The first three behaved about equally well, with the first one being slightly better than the others. It has an average variation of about 4.5% about the target list length and that is what this patch uses. Peter Errikson also tested this hash table version and found that the performance wasn't measurably improved by a larger hash table, so a load factor of 10 appears adequate. Tested by: pen@lysator.liu.se (with other patches) PR: 237860 MFC after: 1 month Modified: head/usr.sbin/mountd/mountd.c Modified: head/usr.sbin/mountd/mountd.c ============================================================================== --- head/usr.sbin/mountd/mountd.c Fri May 31 00:56:31 2019 (r348451) +++ head/usr.sbin/mountd/mountd.c Fri May 31 01:28:48 2019 (r348452) @@ -49,6 +49,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include #include @@ -234,7 +235,9 @@ static int xdr_fhs(XDR *, caddr_t); static int xdr_mlist(XDR *, caddr_t); static void terminate(int); -static struct exportlisthead exphead = SLIST_HEAD_INITIALIZER(&exphead); +#define EXPHASH(f) (fnv_32_buf((f), sizeof(fsid_t), 0) % exphashsize) +static struct exportlisthead *exphead = NULL; +static int exphashsize = 0; static SLIST_HEAD(, mountlist) mlhead = SLIST_HEAD_INITIALIZER(&mlhead); static char *exnames_default[2] = { _PATH_EXPORTS, NULL }; static char **exnames; @@ -1092,7 +1095,7 @@ mntsrv(struct svc_req *rqstp, SVCXPRT *transp) if (bad) ep = NULL; else - ep = ex_search(&fsb.f_fsid, &exphead); + ep = ex_search(&fsb.f_fsid, exphead); hostset = defset = 0; if (ep && (chk_host(ep->ex_defdir, saddr, &defset, &hostset, &numsecflavors, &secflavorsp) || @@ -1307,21 +1310,23 @@ xdr_explist_common(XDR *xdrsp, caddr_t cp __unused, in int false = 0; int putdef; sigset_t sighup_mask; + int i; sigemptyset(&sighup_mask); sigaddset(&sighup_mask, SIGHUP); sigprocmask(SIG_BLOCK, &sighup_mask, NULL); - SLIST_FOREACH(ep, &exphead, entries) { - putdef = 0; - if (put_exlist(ep->ex_dirl, xdrsp, ep->ex_defdir, - &putdef, brief)) - goto errout; - if (ep->ex_defdir && putdef == 0 && - put_exlist(ep->ex_defdir, xdrsp, (struct dirlist *)NULL, - &putdef, brief)) - goto errout; - } + for (i = 0; i < exphashsize; i++) + SLIST_FOREACH(ep, &exphead[i], entries) { + putdef = 0; + if (put_exlist(ep->ex_dirl, xdrsp, ep->ex_defdir, + &putdef, brief)) + goto errout; + if (ep->ex_defdir && putdef == 0 && + put_exlist(ep->ex_defdir, xdrsp, NULL, + &putdef, brief)) + goto errout; + } sigprocmask(SIG_UNBLOCK, &sighup_mask, NULL); if (!xdr_bool(xdrsp, &false)) return (0); @@ -1545,7 +1550,7 @@ get_exportlist_one(void) * See if this directory is already * in the list. */ - ep = ex_search(&fsb.f_fsid, &exphead); + ep = ex_search(&fsb.f_fsid, exphead); if (ep == (struct exportlist *)NULL) { ep = get_exp(); ep->ex_fs = fsb.f_fsid; @@ -1700,7 +1705,7 @@ get_exportlist_one(void) } dirhead = (struct dirlist *)NULL; if ((ep->ex_flag & EX_LINKED) == 0) { - insert_exports(ep, &exphead); + insert_exports(ep, exphead); ep->ex_flag |= EX_LINKED; } @@ -1739,7 +1744,8 @@ get_exportlist(void) /* * First, get rid of the old list */ - free_exports(&exphead); + if (exphead != NULL) + free_exports(exphead); /* * and the old V4 root dir. @@ -1762,6 +1768,21 @@ get_exportlist(void) */ num = getmntinfo(&mntbufp, MNT_NOWAIT); + /* Allocate hash tables, for first call. */ + if (exphead == NULL) { + /* Target an average linked list length of 10. */ + exphashsize = num / 10; + if (exphashsize < 1) + exphashsize = 1; + else if (exphashsize > 100000) + exphashsize = 100000; + exphead = malloc(exphashsize * sizeof(*exphead)); + if (exphead == NULL) + errx(1, "Can't malloc hash table"); + + for (i = 0; i < exphashsize; i++) + SLIST_INIT(&exphead[i]); + } if (num > 0) { build_iovec(&iov, &iovlen, "fstype", NULL, 0); build_iovec(&iov, &iovlen, "fspath", NULL, 0); @@ -1806,8 +1827,10 @@ get_exportlist(void) static void insert_exports(struct exportlist *ep, struct exportlisthead *exhp) { + uint32_t i; - SLIST_INSERT_HEAD(exhp, ep, entries); + i = EXPHASH(&ep->ex_fs); + SLIST_INSERT_HEAD(&exhp[i], ep, entries); } /* @@ -1817,12 +1840,15 @@ static void free_exports(struct exportlisthead *exhp) { struct exportlist *ep, *ep2; + int i; - SLIST_FOREACH_SAFE(ep, exhp, entries, ep2) { - SLIST_REMOVE(exhp, ep, exportlist, entries); - free_exp(ep); + for (i = 0; i < exphashsize; i++) { + SLIST_FOREACH_SAFE(ep, &exhp[i], entries, ep2) { + SLIST_REMOVE(&exhp[i], ep, exportlist, entries); + free_exp(ep); + } + SLIST_INIT(&exhp[i]); } - SLIST_INIT(exhp); } /* @@ -1962,8 +1988,10 @@ static struct exportlist * ex_search(fsid_t *fsid, struct exportlisthead *exhp) { struct exportlist *ep; + uint32_t i; - SLIST_FOREACH(ep, exhp, entries) { + i = EXPHASH(fsid); + SLIST_FOREACH(ep, &exhp[i], entries) { if (ep->ex_fs.val[0] == fsid->val[0] && ep->ex_fs.val[1] == fsid->val[1]) return (ep); From owner-svn-src-head@freebsd.org Fri May 31 03:07:23 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9A82F15B1379; Fri, 31 May 2019 03:07:23 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: from mail-yw1-xc43.google.com (mail-yw1-xc43.google.com [IPv6:2607:f8b0:4864:20::c43]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 541A3801BB; Fri, 31 May 2019 03:07:22 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: by mail-yw1-xc43.google.com with SMTP id t140so3541688ywe.8; Thu, 30 May 2019 20:07:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=ZmH4ZT5zKM9OMzlbIeqIm+OSx0Z66tyOdUD18NKqv70=; b=Io5qg+EuPFk4hPf0PePD7MjickynVwF2CsABYRbpmdKTNZ9lEPeYlnmVkHhYpXdPOh yhwmeObfQitk2J8+fuvpKOdbMAV0K/XaVUgF/M3bhbVFxcN3uDkCfQz4GG3kEMPMm5kJ wRU2i3Cli7m1UCASWyfNf1mFr7JRQxe0bn/uH//mb4ojSALTTNJU/WOjaUQFouXPlG5c 6lWa5tI6Nq00KBqtf4VUUPfyohgFeahTBTbNhBQgG6PRBdOuYWyBDKdbgpwnmPD8RFVf EcaXf5NAR48dJBpznaOpv+bYdgzJxeq1Ip9GEyXVTLCObyZB7AqfQi+5xEehEx0TsbX/ LWpA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=ZmH4ZT5zKM9OMzlbIeqIm+OSx0Z66tyOdUD18NKqv70=; b=Jeo0GKqm4JFCDd+mL9BFlS6LqT4uoYmhQlXMLI9fukoHNhXh1zhl+AvmMNiMXnOQOa n23dlujydqszFCaTEvZf80Ag1QTrx0SMgQMxA5JXXC2A3fA4lueDMYHb45YT/7LUDSlK O8ob7LoHQ0UTDo7FUferOXvtYdmWuNhCpNdhG/+L3FfldVGDWh4ThwwuFW4Dfj7k3y8+ KvGjHOpNdyPZtI6pDqdtor2NF75aBR6zH/LQmGxl+C2zHp7vPGKdEWmHUc097UVJ699s Q1HF2x7Q+VtgiT+1arQ4twarrLG2xrhjKaAZS1Zkx7K0IDOwwActagmlSl+Fs8u8IsRw XcaQ== X-Gm-Message-State: APjAAAWHYwLcOY1pUv0o0qs+sxx40Cl5OeaFHRlR0+PmpJZVQALXPPox JFSLVw8TNA/LA4TeVqIvgpf3q2glaWrictJgkw+adA== X-Google-Smtp-Source: APXvYqyKI2ib4A0IO8A5yMifi1RHXgmeklQOkVhGd9qVxppgaoUsuxfFBiZSUiKFpWoT/D5DM35QkX+mOYGk4L5QKgo= X-Received: by 2002:a81:3217:: with SMTP id y23mr4229770ywy.386.1559272040520; Thu, 30 May 2019 20:07:20 -0700 (PDT) MIME-Version: 1.0 References: <201903152143.x2FLhrcK098439@repo.freebsd.org> In-Reply-To: <201903152143.x2FLhrcK098439@repo.freebsd.org> From: Adrian Chadd Date: Thu, 30 May 2019 20:07:08 -0700 Message-ID: Subject: Re: svn commit: r345203 - in head: contrib/googletest contrib/mandoc etc/mtree lib lib/googletest share/examples/tests/tests share/examples/tests/tests/googletest share/mk tools/build/mk tools/build/op... To: Enji Cooper Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" X-Rspamd-Queue-Id: 541A3801BB X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org; dkim=pass header.d=gmail.com header.s=20161025 header.b=Io5qg+Eu; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (mx1.freebsd.org: domain of adrianchadd@gmail.com designates 2607:f8b0:4864:20::c43 as permitted sender) smtp.mailfrom=adrianchadd@gmail.com X-Spamd-Result: default: False [-2.89 / 15.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-0.95)[-0.950,0]; R_DKIM_ALLOW(-0.20)[gmail.com:s=20161025]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; R_SPF_ALLOW(-0.20)[+ip6:2607:f8b0:4000::/36]; FREEMAIL_FROM(0.00)[gmail.com]; MIME_GOOD(-0.10)[text/plain]; TO_MATCH_ENVRCPT_ALL(0.00)[]; NEURAL_HAM_LONG(-0.99)[-0.995,0]; TO_DN_SOME(0.00)[]; NEURAL_SPAM_SHORT(0.06)[0.064,0]; RCVD_TLS_LAST(0.00)[]; DKIM_TRACE(0.00)[gmail.com:+]; MX_GOOD(-0.01)[cached: alt3.gmail-smtp-in.l.google.com]; DMARC_POLICY_ALLOW(-0.50)[gmail.com,none]; RCVD_IN_DNSWL_NONE(0.00)[3.4.c.0.0.0.0.0.0.0.0.0.0.0.0.0.0.2.0.0.4.6.8.4.0.b.8.f.7.0.6.2.list.dnswl.org : 127.0.5.0]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+]; FREEMAIL_ENVFROM(0.00)[gmail.com]; RCVD_COUNT_TWO(0.00)[2]; TAGGED_FROM(0.00)[]; DWL_DNSWL_NONE(0.00)[gmail.com.dwl.dnswl.org : 127.0.5.0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 31 May 2019 03:07:24 -0000 hi, I'm seeing build failures where things like zfs do not find gmock/gmock.h when building. Have you seen this? -a On Fri, 15 Mar 2019 at 14:44, Enji Cooper wrote: > > Author: ngie > Date: Fri Mar 15 21:43:52 2019 > New Revision: 345203 > URL: https://svnweb.freebsd.org/changeset/base/345203 > > Log: > Initial googlemock/googletest integration into the build/FreeBSD test suite > > This initial integration takes googlemock/googletest release 1.8.1, integrates > the library, tests, and sample unit tests into the build. > > googlemock/googletest's inclusion is optionally available via `MK_GOOGLETEST`. > `MK_GOOGLETEST` is dependent on `MK_TESTS` and is enabled by default when > built with a C++11 capable toolchain. > > Google tests can be specified via the `GTESTS` variable, which, in comparison > with the other test drivers, is more simplified/streamlined, as Googletest only > supports C++ tests; not raw C or shell tests (C tests can be written in C++ > using the standard embedding methods). > > No dependent libraries are assumed for the tests. One must specify `gmock`, > `gmock_main`, `gtest`, or `gtest_main`, via `LIBADD` for the program. > > More information about googlemock and googletest can be found on the > Googletest [project page](https://github.com/google/googletest), and the > [GoogleMock](https://github.com/google/googletest/blob/v1.8.x/googlemock/docs/Documentation.md) > and > [GoogleTest](https://github.com/google/googletest/tree/v1.8.x/googletest/docs) > docs. > > These tests are originally integrated into the build as plain driver tests, but > will be natively integrated into Kyua in a later version. > > Known issues/Errata: > * [WhenDynamicCastToTest.AmbiguousCast fails on FreeBSD](https://github.com/google/googletest/issues/2172) > > Reviewed by: asomers > Approved by: emaste (mentor) > MFC after: 2 months > Differential Revision: https://reviews.freebsd.org/D19551 > > Added: > head/contrib/googletest/ > - copied from r345031, projects/import-googletest-1.8.1/contrib/googletest/ > head/lib/googletest/ > - copied from r345031, projects/import-googletest-1.8.1/lib/googletest/ > head/share/examples/tests/tests/googletest/ > - copied from r345031, projects/import-googletest-1.8.1/share/examples/tests/tests/googletest/ > head/share/mk/googletest.test.inc.mk > - copied, changed from r345031, projects/import-googletest-1.8.1/share/mk/googletest.test.inc.mk > head/share/mk/googletest.test.mk > - copied unchanged from r345031, projects/import-googletest-1.8.1/share/mk/googletest.test.mk > head/tools/build/options/WITHOUT_GOOGLETEST > - copied, changed from r345031, projects/import-googletest-1.8.1/tools/build/options/WITHOUT_GOOGLETEST > Modified: > head/contrib/mandoc/lib.in > head/etc/mtree/BSD.tests.dist > head/etc/mtree/BSD.usr.dist > head/lib/Makefile > head/share/examples/tests/tests/Makefile > head/share/examples/tests/tests/googletest/Makefile > head/share/mk/Makefile > head/share/mk/bsd.README > head/share/mk/bsd.test.mk > head/share/mk/src.libnames.mk > head/share/mk/src.opts.mk > head/tools/build/mk/OptionalObsoleteFiles.inc > > Modified: head/contrib/mandoc/lib.in > ============================================================================== > --- head/contrib/mandoc/lib.in Fri Mar 15 21:11:47 2019 (r345202) > +++ head/contrib/mandoc/lib.in Fri Mar 15 21:43:52 2019 (r345203) > @@ -62,7 +62,9 @@ LINE("libfsid", "Filesystem Identification Library (l > LINE("libftpio", "FTP Connection Management Library (libftpio, \\-lftpio)") > LINE("libform", "Curses Form Library (libform, \\-lform)") > LINE("libgeom", "Userland API Library for Kernel GEOM subsystem (libgeom, \\-lgeom)") > +LINE("libgmock", "GoogleMock library (libgmock, \\-lgmock)") > LINE("libgpio", "General-Purpose Input Output (GPIO) library (libgpio, \\-lgpio)") > +LINE("libgtest", "GoogleTest library (libgtest, \\-lgtest)") > LINE("libhammer", "HAMMER Filesystem Userland Library (libhammer, \\-lhammer)") > LINE("libi386", "i386 Architecture Library (libi386, \\-li386)") > LINE("libintl", "Internationalized Message Handling Library (libintl, \\-lintl)") > > Modified: head/etc/mtree/BSD.tests.dist > ============================================================================== > --- head/etc/mtree/BSD.tests.dist Fri Mar 15 21:11:47 2019 (r345202) > +++ head/etc/mtree/BSD.tests.dist Fri Mar 15 21:43:52 2019 (r345203) > @@ -278,6 +278,16 @@ > static > .. > .. > + googletest > + gmock > + .. > + gmock_main > + .. > + gtest > + .. > + gtest_main > + .. > + .. > libarchive > .. > libc > @@ -429,6 +439,8 @@ > examples > tests > atf > + .. > + googletest > .. > plain > .. > > Modified: head/etc/mtree/BSD.usr.dist > ============================================================================== > --- head/etc/mtree/BSD.usr.dist Fri Mar 15 21:11:47 2019 (r345202) > +++ head/etc/mtree/BSD.usr.dist Fri Mar 15 21:43:52 2019 (r345203) > @@ -13,6 +13,18 @@ > .. > event > .. > + gmock > + internal > + custom > + .. > + .. > + .. > + gtest > + internal > + custom > + .. > + .. > + .. > sqlite3 > .. > ucl > > Modified: head/lib/Makefile > ============================================================================== > --- head/lib/Makefile Fri Mar 15 21:11:47 2019 (r345202) > +++ head/lib/Makefile Fri Mar 15 21:43:52 2019 (r345203) > @@ -170,6 +170,7 @@ _libcplusplus+= libc++fs > .endif > > SUBDIR.${MK_EFI}+= libefivar > +SUBDIR.${MK_GOOGLETEST}+= googletest > SUBDIR.${MK_LIBTHR}+= libthr > SUBDIR.${MK_LLVM_LIBUNWIND}+= libgcc_eh > SUBDIR.${MK_LLVM_LIBUNWIND}+= libgcc_s > > Modified: head/share/examples/tests/tests/Makefile > ============================================================================== > --- head/share/examples/tests/tests/Makefile Fri Mar 15 21:11:47 2019 (r345202) > +++ head/share/examples/tests/tests/Makefile Fri Mar 15 21:43:52 2019 (r345203) > @@ -1,5 +1,7 @@ > # $FreeBSD$ > > +.include > + > # Directory into which the Kyuafile provided by this directory will be > # installed. > # > @@ -20,6 +22,10 @@ > TESTS_SUBDIRS+= atf > TESTS_SUBDIRS+= plain > TESTS_SUBDIRS+= tap > + > +.if ${MK_GOOGLETEST} != no > +TESTS_SUBDIRS+= googletest > +.endif > > # We leave KYUAFILE unset so that bsd.test.mk auto-generates a Kyuafile > # for us based on the contents of the TESTS_SUBDIRS line above. The > > Modified: head/share/examples/tests/tests/googletest/Makefile > ============================================================================== > --- projects/import-googletest-1.8.1/share/examples/tests/tests/googletest/Makefile Mon Mar 11 21:56:35 2019 (r345031) > +++ head/share/examples/tests/tests/googletest/Makefile Fri Mar 15 21:43:52 2019 (r345203) > @@ -1,5 +1,25 @@ > # $FreeBSD$ > +# > +# This Makefile differs from the other examples, in the sense that its purpose > +# is to install the upstream provided googletest sample unit tests. > > +# The release package to use for the tests contained within the directory > +# > +# This applies to components which rely on ^/projects/release-pkg support > +# (see UPDATING XXXXXXXXX / svn revision r298107). > +PACKAGE= tests > + > +# Directory into which the Kyuafile provided by this directory will be > +# installed. > +# > +# This is always a subdirectory of ${TESTSBASE}/. The remainder of the > +# path has to match the relative path within the source tree in which > +# these files are found modulo the tests/ component at the end. > +# > +# For example: if this Makefile were in src/bin/cp/tests/, its TESTSDIR > +# would point at ${TESTSBASE}/bin/cp/. > +TESTSDIR= ${TESTSBASE}/share/examples/tests/googletest > + > .PATH: ${SRCTOP}/contrib/googletest/googletest/samples > > GTEST_MAIN_REQ_TESTS+= sample1_unittest > @@ -16,18 +36,21 @@ GTEST_MAIN_REQ_TESTS+= sample8_unittest > #GTEST_REQ_TESTS+= sample9_unittest > GTEST_REQ_TESTS+= sample10_unittest > > -.for t in ${GTEST_MAIN_REQ_TESTS} > -GTESTS+= $t > -LIBADD.$t+= gtest_main > -SRCS.$t+= $t.cc > -.endfor > +# List of test programs to build. Note that we can build more than one > +# test from a single directory, and this is expected. > +GTESTS+= ${GTEST_MAIN_REQ_TESTS} ${GTEST_REQ_TESTS} > > -.for t in ${GTEST_REQ_TESTS} > -GTESTS+= $t > +# > +.for t in ${GTESTS} > +.if ${GTEST_MAIN_REQ_TESTS:M$t} > +LIBADD.$t+= gtest_main > +.else > LIBADD.$t+= gtest > +.endif > SRCS.$t+= $t.cc > .endfor > > +# Additional sources for sample testcase 1, 2, 4, and 5. > SRCS.sample1_unittest+= sample1.cc > SRCS.sample2_unittest+= sample2.cc > SRCS.sample4_unittest+= sample4.cc > > Modified: head/share/mk/Makefile > ============================================================================== > --- head/share/mk/Makefile Fri Mar 15 21:11:47 2019 (r345202) > +++ head/share/mk/Makefile Fri Mar 15 21:43:52 2019 (r345203) > @@ -73,6 +73,8 @@ FILESDIR= ${BINDIR}/mk > > .if ${MK_TESTS} != "no" > FILES+= atf.test.mk > +FILES+= googletest.test.inc.mk > +FILES+= googletest.test.mk > FILES+= plain.test.mk > FILES+= suite.test.mk > FILES+= tap.test.mk > > Modified: head/share/mk/bsd.README > ============================================================================== > --- head/share/mk/bsd.README Fri Mar 15 21:11:47 2019 (r345202) > +++ head/share/mk/bsd.README Fri Mar 15 21:43:52 2019 (r345203) > @@ -649,6 +649,8 @@ ATF_TESTS_CXX The names of the ATF C++ test programs t > > ATF_TESTS_SH The names of the ATF sh test programs to build. > > +GTESTS The names of the GoogleTest test programs to build. > + > KYUAFILE If 'auto' (the default), generate a Kyuafile out of the > test programs defined in the Makefile. If 'yes', then a > manually-crafted Kyuafile must be supplied with the > > Modified: head/share/mk/bsd.test.mk > ============================================================================== > --- head/share/mk/bsd.test.mk Fri Mar 15 21:11:47 2019 (r345202) > +++ head/share/mk/bsd.test.mk Fri Mar 15 21:43:52 2019 (r345203) > @@ -63,6 +63,7 @@ _TESTS= > > # Pull in the definitions of all supported test interfaces. > .include > +.include > .include > .include > > > Copied and modified: head/share/mk/googletest.test.inc.mk (from r345031, projects/import-googletest-1.8.1/share/mk/googletest.test.inc.mk) > ============================================================================== > --- projects/import-googletest-1.8.1/share/mk/googletest.test.inc.mk Mon Mar 11 21:56:35 2019 (r345031, copy source) > +++ head/share/mk/googletest.test.inc.mk Fri Mar 15 21:43:52 2019 (r345203) > @@ -1,10 +1,13 @@ > # $FreeBSD$ > > +# XXX: this should be defined in bsd.sys.mk > +CXXSTD?= c++11 > + > GTESTS_CXXFLAGS+= -DGTEST_HAS_POSIX_RE=1 > GTESTS_CXXFLAGS+= -DGTEST_HAS_PTHREAD=1 > GTESTS_CXXFLAGS+= -DGTEST_HAS_STREAM_REDIRECTION=1 > GTESTS_CXXFLAGS+= -frtti > -GTESTS_CXXFLAGS+= -std=c++11 > +GTESTS_CXXFLAGS+= -std=${CXXSTD} > > # XXX: src.libnames.mk should handle adding this directory. > GTESTS_CXXFLAGS+= -I${DESTDIR}${INCLUDEDIR}/private > > Copied: head/share/mk/googletest.test.mk (from r345031, projects/import-googletest-1.8.1/share/mk/googletest.test.mk) > ============================================================================== > --- /dev/null 00:00:00 1970 (empty, because file is newly added) > +++ head/share/mk/googletest.test.mk Fri Mar 15 21:43:52 2019 (r345203, copy of r345031, projects/import-googletest-1.8.1/share/mk/googletest.test.mk) > @@ -0,0 +1,41 @@ > +# $FreeBSD$ > +# > +# You must include bsd.test.mk instead of this file from your Makefile. > +# > +# Logic to build and install GoogleTest based test programs. > +# > +# GoogleTest is a C++ test framework, thus, it does not describe/articulate how > +# to write tests in other languages, e.g., C or shell, unlike the ATF, plain, > +# and TAP raw test interfaces. > +# > +# For now this is a thin wrapper around the `plain` test interface, but in the > +# future this will rely on a newer version of kyua which will integrate in > +# GoogleTest support. > + > +.if !target(____) > +.error googletest.test.mk cannot be included directly. > +.endif > + > +# List of GoogleTest test programs to build. > +# > +# Programs listed here are built according to the semantics of bsd.progs.mk for > +# PROGS_CXX. > +# > +# Test programs registered in this manner are set to be installed into TESTSDIR > +# (which should be overridden by the Makefile) and are not required to provide a > +# manpage. > +GTESTS?= > + > +.if !empty(GTESTS) > +.include > + > +PROGS_CXX+= ${GTESTS} > +_TESTS+= ${GTESTS} > +.for _T in ${GTESTS} > +BINDIR.${_T}= ${TESTSDIR} > +CXXFLAGS.${_T}+= ${GTESTS_CXXFLAGS} > +MAN.${_T}?= # empty > +SRCS.${_T}?= ${_T}.cc > +TEST_INTERFACE.${_T}= plain > +.endfor > +.endif > > Modified: head/share/mk/src.libnames.mk > ============================================================================== > --- head/share/mk/src.libnames.mk Fri Mar 15 21:11:47 2019 (r345202) > +++ head/share/mk/src.libnames.mk Fri Mar 15 21:43:52 2019 (r345203) > @@ -18,6 +18,10 @@ _PRIVATELIBS= \ > bsdstat \ > devdctl \ > event \ > + gmock \ > + gtest \ > + gmock_main \ > + gtest_main \ > heimipcc \ > heimipcs \ > ldns \ > @@ -302,6 +306,10 @@ _DP_dpv= dialog figpar util ncursesw > _DP_dialog= ncursesw m > _DP_cuse= pthread > _DP_atf_cxx= atf_c > +_DP_gtest= pthread > +_DP_gmock= gtest > +_DP_gmock_main= gmock > +_DP_gtest_main= gtest > _DP_devstat= kvm > _DP_pam= radius tacplus opie md util > .if ${MK_KERBEROS} != "no" > @@ -379,6 +387,15 @@ LIBATF_CXX= ${LIBDESTDIR}${LIBDIR_BASE}/libprivateatf- > LDADD_atf_c= -lprivateatf-c > LDADD_atf_cxx= -lprivateatf-c++ > > +LIBGMOCK= ${LIBDESTDIR}${LIBDIR_BASE}/libprivategmock.a > +LIBGMOCK_MAIN= ${LIBDESTDIR}${LIBDIR_BASE}/libprivategmock_main.a > +LIBGTEST= ${LIBDESTDIR}${LIBDIR_BASE}/libprivategtest.a > +LIBGTEST_MAIN= ${LIBDESTDIR}${LIBDIR_BASE}/libprivategtest_main.a > +LDADD_gmock= -lprivategmock > +LDADD_gtest= -lprivategtest > +LDADD_gmock_main= -lprivategmock_main > +LDADD_gtest_main= -lprivategtest_main > + > .for _l in ${_PRIVATELIBS} > LIB${_l:tu}?= ${LIBDESTDIR}${LIBDIR_BASE}/libprivate${_l}.a > .endfor > @@ -421,6 +438,15 @@ LDADD_${_l}+= ${LDADD_${_d}} > DPADD_atf_cxx+= ${DPADD_atf_c} > LDADD_atf_cxx+= ${LDADD_atf_c} > > +DPADD_gmock+= ${DPADD_gtest} > +LDADD_gmock+= ${LDADD_gtest} > + > +DPADD_gmock_main+= ${DPADD_gmock} > +LDADD_gmock_main+= ${LDADD_gmock} > + > +DPADD_gtest_main+= ${DPADD_gtest} > +LDADD_gtest_main+= ${LDADD_gtest} > + > # Detect LDADD/DPADD that should be LIBADD, before modifying LDADD here. > _BADLDADD= > .for _l in ${LDADD:M-l*:N-l*/*:C,^-l,,} > @@ -562,6 +588,10 @@ LIBROKENDIR= ${OBJTOP}/kerberos5/lib/libroken > LIBWINDDIR= ${OBJTOP}/kerberos5/lib/libwind > LIBATF_CDIR= ${OBJTOP}/lib/atf/libatf-c > LIBATF_CXXDIR= ${OBJTOP}/lib/atf/libatf-c++ > +LIBGMOCKDIR= ${OBJTOP}/lib/googletest/gmock > +LIBGMOCK_MAINDIR= ${OBJTOP}/lib/googletest/gmock_main > +LIBGTESTDIR= ${OBJTOP}/lib/googletest/gtest > +LIBGTEST_MAINDIR= ${OBJTOP}/lib/googletest/gtest_main > LIBALIASDIR= ${OBJTOP}/lib/libalias/libalias > LIBBLACKLISTDIR= ${OBJTOP}/lib/libblacklist > LIBBLOCKSRUNTIMEDIR= ${OBJTOP}/lib/libblocksruntime > > Modified: head/share/mk/src.opts.mk > ============================================================================== > --- head/share/mk/src.opts.mk Fri Mar 15 21:11:47 2019 (r345202) > +++ head/share/mk/src.opts.mk Fri Mar 15 21:43:52 2019 (r345203) > @@ -108,6 +108,7 @@ __DEFAULT_YES_OPTIONS = \ > GDB \ > GNU_DIFF \ > GNU_GREP \ > + GOOGLETEST \ > GPIO \ > HAST \ > HTML \ > @@ -427,6 +428,7 @@ MK_${var}:= no > # Order is somewhat important. > # > .if !${COMPILER_FEATURES:Mc++11} > +MK_GOOGLETEST:= no > MK_LLVM_LIBUNWIND:= no > .endif > > @@ -505,6 +507,10 @@ MK_FREEBSD_UPDATE:= no > > .if ${MK_TESTS} == "no" > MK_DTRACE_TESTS:= no > +.endif > + > +.if ${MK_TESTS_SUPPORT} == "no" > +MK_GOOGLETEST:= no > .endif > > .if ${MK_ZONEINFO} == "no" > > Modified: head/tools/build/mk/OptionalObsoleteFiles.inc > ============================================================================== > --- head/tools/build/mk/OptionalObsoleteFiles.inc Fri Mar 15 21:11:47 2019 (r345202) > +++ head/tools/build/mk/OptionalObsoleteFiles.inc Fri Mar 15 21:43:52 2019 (r345203) > @@ -2776,6 +2776,135 @@ OLD_FILES+=usr/libexec/gdb > OLD_FILES+=usr/libexec/kgdb > .endif > > +.if ${MK_GOOGLETEST} == no > +OLD_FILES+=usr/include/gmock/gmock-actions.h > +OLD_FILES+=usr/include/gmock/gmock-cardinalities.h > +OLD_FILES+=usr/include/gmock/gmock-generated-actions.h > +OLD_FILES+=usr/include/gmock/gmock-generated-function-mockers.h > +OLD_FILES+=usr/include/gmock/gmock-generated-matchers.h > +OLD_FILES+=usr/include/gmock/gmock-generated-nice-strict.h > +OLD_FILES+=usr/include/gmock/gmock-matchers.h > +OLD_FILES+=usr/include/gmock/gmock-more-actions.h > +OLD_FILES+=usr/include/gmock/gmock-more-matchers.h > +OLD_FILES+=usr/include/gmock/gmock-spec-builders.h > +OLD_FILES+=usr/include/gmock/gmock.h > +OLD_FILES+=usr/include/gmock/internal/custom/gmock-generated-actions.h > +OLD_FILES+=usr/include/gmock/internal/custom/gmock-matchers.h > +OLD_FILES+=usr/include/gmock/internal/custom/gmock-port.h > +OLD_FILES+=usr/include/gmock/internal/gmock-generated-internal-utils.h > +OLD_FILES+=usr/include/gmock/internal/gmock-internal-utils.h > +OLD_FILES+=usr/include/gmock/internal/gmock-port.h > +OLD_DIRS+=usr/include/gmock > +OLD_FILES+=usr/include/gtest/gtest_pred_impl.h > +OLD_FILES+=usr/include/gtest/gtest_prod.h > +OLD_FILES+=usr/include/gtest/gtest-death-test.h > +OLD_FILES+=usr/include/gtest/gtest-message.h > +OLD_FILES+=usr/include/gtest/gtest-param-test.h > +OLD_FILES+=usr/include/gtest/gtest-printers.h > +OLD_FILES+=usr/include/gtest/gtest-spi.h > +OLD_FILES+=usr/include/gtest/gtest-test-part.h > +OLD_FILES+=usr/include/gtest/gtest-typed-test.h > +OLD_FILES+=usr/include/gtest/gtest.h > +OLD_FILES+=usr/include/gtest/internal/custom/gtest-port.h > +OLD_FILES+=usr/include/gtest/internal/custom/gtest-printers.h > +OLD_FILES+=usr/include/gtest/internal/custom/gtest.h > +OLD_FILES+=usr/include/gtest/internal/gtest-death-test-internal.h > +OLD_FILES+=usr/include/gtest/internal/gtest-filepath.h > +OLD_FILES+=usr/include/gtest/internal/gtest-internal.h > +OLD_FILES+=usr/include/gtest/internal/gtest-linked_ptr.h > +OLD_FILES+=usr/include/gtest/internal/gtest-param-util-generated.h > +OLD_FILES+=usr/include/gtest/internal/gtest-param-util.h > +OLD_FILES+=usr/include/gtest/internal/gtest-port-arch.h > +OLD_FILES+=usr/include/gtest/internal/gtest-port.h > +OLD_FILES+=usr/include/gtest/internal/gtest-string.h > +OLD_FILES+=usr/include/gtest/internal/gtest-tuple.h > +OLD_FILES+=usr/include/gtest/internal/gtest-type-util.h > +OLD_DIRS+=usr/include/gtest > +OLD_FILES+=usr/lib/libprivategmock_main.a > +OLD_FILES+=usr/lib/libprivategmock_main.so > +OLD_LIBS+=usr/lib/libprivategmock_main.so.0 > +OLD_FILES+=usr/lib/libprivategmock_main_p.a > +OLD_FILES+=usr/lib/libprivategmock.a > +OLD_FILES+=usr/lib/libprivategmock.so > +OLD_LIBS+=usr/lib/libprivategmock.so.0 > +OLD_FILES+=usr/lib/libprivategmock_p.a > +OLD_FILES+=usr/lib/libprivategtest_main.a > +OLD_FILES+=usr/lib/libprivategtest_main.so > +OLD_LIBS+=usr/lib/libprivategtest_main.so.0 > +OLD_FILES+=usr/lib/libprivategtest_main_p.a > +OLD_FILES+=usr/lib/libprivategtest.a > +OLD_FILES+=usr/lib/libprivategtest.so > +OLD_LIBS+=usr/lib/libprivategtest.so.0 > +OLD_FILES+=usr/lib/libprivategtest_p.a > +OLD_FILES+=usr/tests/lib/googletest/gmock/gmock_stress_test > +OLD_FILES+=usr/tests/lib/googletest/gmock/Kyuafile > +OLD_DIRS+=usr/tests/lib/googletest/gmock > +OLD_FILES+=usr/tests/lib/googletest/gmock_main/gmock_ex_test > +OLD_FILES+=usr/tests/lib/googletest/gmock_main/gmock_link_test > +OLD_FILES+=usr/tests/lib/googletest/gmock_main/gmock_test > +OLD_FILES+=usr/tests/lib/googletest/gmock_main/gmock-actions_test > +OLD_FILES+=usr/tests/lib/googletest/gmock_main/gmock-cardinalities_test > +OLD_FILES+=usr/tests/lib/googletest/gmock_main/gmock-ex_test > +OLD_FILES+=usr/tests/lib/googletest/gmock_main/gmock-generated-actions_test > +OLD_FILES+=usr/tests/lib/googletest/gmock_main/gmock-generated-function-mockers_test > +OLD_FILES+=usr/tests/lib/googletest/gmock_main/gmock-generated-internal-utils_test > +OLD_FILES+=usr/tests/lib/googletest/gmock_main/gmock-generated-matchers_test > +OLD_FILES+=usr/tests/lib/googletest/gmock_main/gmock-internal-utils_test > +OLD_FILES+=usr/tests/lib/googletest/gmock_main/gmock-matchers_test > +OLD_FILES+=usr/tests/lib/googletest/gmock_main/gmock-more-actions_test > +OLD_FILES+=usr/tests/lib/googletest/gmock_main/gmock-nice-strict_test > +OLD_FILES+=usr/tests/lib/googletest/gmock_main/gmock-port_test > +OLD_FILES+=usr/tests/lib/googletest/gmock_main/gmock-spec-builders_test > +OLD_FILES+=usr/tests/lib/googletest/gmock_main/Kyuafile > +OLD_DIRS+=usr/tests/lib/googletest/gmock_main > +OLD_FILES+=usr/tests/lib/googletest/gtest/googletest-param-test-test > +OLD_FILES+=usr/tests/lib/googletest/gtest/gtest_all_test > +OLD_FILES+=usr/tests/lib/googletest/gtest/gtest_environment_test > +OLD_FILES+=usr/tests/lib/googletest/gtest/gtest_no_test_unittest > +OLD_FILES+=usr/tests/lib/googletest/gtest/gtest_premature_exit_test > +OLD_FILES+=usr/tests/lib/googletest/gtest/gtest_repeat_test > +OLD_FILES+=usr/tests/lib/googletest/gtest/gtest_stress_test > +OLD_FILES+=usr/tests/lib/googletest/gtest/gtest_throw_on_failure_ex_test > +OLD_FILES+=usr/tests/lib/googletest/gtest/gtest-death-test_ex_catch_test > +OLD_FILES+=usr/tests/lib/googletest/gtest/gtest-death-test_ex_nocatch_test > +OLD_FILES+=usr/tests/lib/googletest/gtest/gtest-unittest-api_test > +OLD_FILES+=usr/tests/lib/googletest/gtest/Kyuafile > +OLD_DIRS+=usr/tests/lib/googletest/gtest > +OLD_FILES+=usr/tests/lib/googletest/gtest_main/googletest-death-test-test > +OLD_FILES+=usr/tests/lib/googletest/gtest_main/googletest-filepath-test > +OLD_FILES+=usr/tests/lib/googletest/gtest_main/googletest-linked-ptr-test > +OLD_FILES+=usr/tests/lib/googletest/gtest_main/googletest-listener-test > +OLD_FILES+=usr/tests/lib/googletest/gtest_main/googletest-message-test > +OLD_FILES+=usr/tests/lib/googletest/gtest_main/googletest-options-test > +OLD_FILES+=usr/tests/lib/googletest/gtest_main/googletest-port-test > +OLD_FILES+=usr/tests/lib/googletest/gtest_main/googletest-printers-test > +OLD_FILES+=usr/tests/lib/googletest/gtest_main/googletest-test-part-test > +OLD_FILES+=usr/tests/lib/googletest/gtest_main/gtest_help_test_ > +OLD_FILES+=usr/tests/lib/googletest/gtest_main/gtest_main_unittest > +OLD_FILES+=usr/tests/lib/googletest/gtest_main/gtest_pred_impl_unittest > +OLD_FILES+=usr/tests/lib/googletest/gtest_main/gtest_prod_test > +OLD_FILES+=usr/tests/lib/googletest/gtest_main/gtest_sole_header_test > +OLD_FILES+=usr/tests/lib/googletest/gtest_main/gtest_unittest > +OLD_FILES+=usr/tests/lib/googletest/gtest_main/gtest_xml_outfile1_test_ > +OLD_FILES+=usr/tests/lib/googletest/gtest_main/gtest_xml_outfile2_test_ > +OLD_FILES+=usr/tests/lib/googletest/gtest_main/gtest-typed-test_test > +OLD_FILES+=usr/tests/lib/googletest/gtest_main/Kyuafile > +OLD_DIRS+=usr/tests/lib/googletest/gtest_main > +OLD_FILES+=usr/tests/lib/googletest/Kyuafile > +OLD_DIRS+=usr/tests/lib/googletest/ > +OLD_FILES+=usr/tests/share/examples/tests/googletest/Kyuafile > +OLD_FILES+=usr/tests/share/examples/tests/googletest/sample1_unittest > +OLD_FILES+=usr/tests/share/examples/tests/googletest/sample10_unittest > +OLD_FILES+=usr/tests/share/examples/tests/googletest/sample2_unittest > +OLD_FILES+=usr/tests/share/examples/tests/googletest/sample3_unittest > +OLD_FILES+=usr/tests/share/examples/tests/googletest/sample4_unittest > +OLD_FILES+=usr/tests/share/examples/tests/googletest/sample5_unittest > +OLD_FILES+=usr/tests/share/examples/tests/googletest/sample6_unittest > +OLD_FILES+=usr/tests/share/examples/tests/googletest/sample7_unittest > +OLD_FILES+=usr/tests/share/examples/tests/googletest/sample8_unittest > +OLD_DIRS+=usr/tests/share/examples/tests/googletest > +.endif > + > .if ${MK_GPIO} == no > OLD_FILES+=usr/include/libgpio.h > OLD_FILES+=usr/lib/libgpio.a > > Copied and modified: head/tools/build/options/WITHOUT_GOOGLETEST (from r345031, projects/import-googletest-1.8.1/tools/build/options/WITHOUT_GOOGLETEST) > ============================================================================== > --- projects/import-googletest-1.8.1/tools/build/options/WITHOUT_GOOGLETEST Mon Mar 11 21:56:35 2019 (r345031, copy source) > +++ head/tools/build/options/WITHOUT_GOOGLETEST Fri Mar 15 21:43:52 2019 (r345203) > @@ -1,5 +1,5 @@ > .\" $FreeBSD$ > -Set to not build nor install > +Set to neither build nor install > .Lb libgmock , > .Lb libgtest , > and dependent tests. > From owner-svn-src-head@freebsd.org Fri May 31 03:13:10 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7B1C615B15CD; Fri, 31 May 2019 03:13:10 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 1DC3C80648; Fri, 31 May 2019 03:13:10 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id EB1C72278A; Fri, 31 May 2019 03:13:09 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x4V3D94t005142; Fri, 31 May 2019 03:13:09 GMT (envelope-from rmacklem@FreeBSD.org) Received: (from rmacklem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4V3D9Aq005141; Fri, 31 May 2019 03:13:09 GMT (envelope-from rmacklem@FreeBSD.org) Message-Id: <201905310313.x4V3D9Aq005141@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rmacklem set sender to rmacklem@FreeBSD.org using -f From: Rick Macklem Date: Fri, 31 May 2019 03:13:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r348453 - head/sys/fs/nfsclient X-SVN-Group: head X-SVN-Commit-Author: rmacklem X-SVN-Commit-Paths: head/sys/fs/nfsclient X-SVN-Commit-Revision: 348453 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 1DC3C80648 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.96)[-0.965,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 31 May 2019 03:13:10 -0000 Author: rmacklem Date: Fri May 31 03:13:09 2019 New Revision: 348453 URL: https://svnweb.freebsd.org/changeset/base/348453 Log: Get rid of extraneous initialization. Get rid of an extraneous initialization, mainly to keep a static analyser happy. No semantic change. PR: 238167 Submitted by: Alexey Dokuchaev Modified: head/sys/fs/nfsclient/nfs_clvnops.c Modified: head/sys/fs/nfsclient/nfs_clvnops.c ============================================================================== --- head/sys/fs/nfsclient/nfs_clvnops.c Fri May 31 01:28:48 2019 (r348452) +++ head/sys/fs/nfsclient/nfs_clvnops.c Fri May 31 03:13:09 2019 (r348453) @@ -1181,7 +1181,6 @@ nfs_lookup(struct vop_lookup_args *ap) cache_purge_negative(dvp); } - error = 0; newvp = NULLVP; NFSINCRGLOBAL(nfsstatsv1.lookupcache_misses); error = nfsrpc_lookup(dvp, cnp->cn_nameptr, cnp->cn_namelen, From owner-svn-src-head@freebsd.org Fri May 31 03:14:55 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 10E9415B1669; Fri, 31 May 2019 03:14:55 +0000 (UTC) (envelope-from bjkfbsd@gmail.com) Received: from mail-ot1-x330.google.com (mail-ot1-x330.google.com [IPv6:2607:f8b0:4864:20::330]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 955EB807DD; Fri, 31 May 2019 03:14:54 +0000 (UTC) (envelope-from bjkfbsd@gmail.com) Received: by mail-ot1-x330.google.com with SMTP id k24so2647980otn.6; Thu, 30 May 2019 20:14:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=+WcQlD23NH7LAzVxJ6pPu1Hf/qGj38fxYTR+kAv+Px4=; b=g54z2Tzg3OUerSeUJV26IWgJ4fs6DplyBjTcan0ENGASsPiSsg1fm4Mt092cYXzyWl wCQmr5qRex9CYqVlx1RFUJA2u1gEHQY3Wn2Qrqx8AK1OgcCziITpHJlSEq5qJr54Wi33 iXTwGy7bJQRnb3hvQJHD1ibWc3FloxNa9zIaL+lgZhzs3rVhwf7rxsc7f8K/QVnYJoQ9 cUnfr4LQ/FXOsDwdd6+C/7UzUBb4t7Vou88h98SgNbqKWKQurIBG0P7adiRwZg/a7dV1 6Ib6GBkkovfHmJApVkxSa53uze3Z+ybnagTGppd65lmQDdXleGocoIsZBemODvBirmg5 exlg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=+WcQlD23NH7LAzVxJ6pPu1Hf/qGj38fxYTR+kAv+Px4=; b=adnYQpl4DzhEIteM4LRMjubBf4WR6kYdIpR0DwrOe1ggSidiprGxw6XQX2mawdzKuh 22FRRFWBzc2Cvnh8+BeTIe3sU82687XM55FmhViRUsfaR2pV8AD64kpitKPiJDASvvw3 thTk+JQwHpIsnDVR2dyTTLc6NowsKn405M6kkjf9oDMEwHceVm8MBP1Hyig1/QGngSdl Okeawa9x/Dka6U5LNQid6SBITWI3poaN8fKMb5AdK6te18HpHCmJYzNhOeRQuyaIHBLE lZANye0D1fFDk/6qqWNWk9q/0fCup9K/dAUfv8YBY5mywnALvmYaJQf2lBtoGeCUk298 EnCQ== X-Gm-Message-State: APjAAAUhSiZakuz+MW1Kd6o9MTMGw5yp3e5opHse8HwRP2gxPiGZDnKh guzcK1X/A9fdwFvEy0O4+OQJrsPlW9CGXTBt4ZU4JgIn2PMIjZbX X-Google-Smtp-Source: APXvYqwMu3nGKFuv139P8mQwgT05ZHSIN8sIG1xiiediHlhZV8MVK714mAs3+wCF93CEqZ8PzFyLNAR39y3cz5mlb8c= X-Received: by 2002:a9d:3782:: with SMTP id x2mr36644otb.354.1559272493527; Thu, 30 May 2019 20:14:53 -0700 (PDT) MIME-Version: 1.0 References: <201905301504.x4UF49UT019928@repo.freebsd.org> In-Reply-To: <201905301504.x4UF49UT019928@repo.freebsd.org> From: Benjamin Kaduk Date: Thu, 30 May 2019 20:14:42 -0700 Message-ID: Subject: Re: svn commit: r348421 - head/sys/kern To: Konstantin Belousov Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org X-Rspamd-Queue-Id: 955EB807DD X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.92 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; REPLY(-4.00)[]; NEURAL_HAM_SHORT(-0.92)[-0.923,0] Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.29 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 31 May 2019 03:14:55 -0000 On Thu, May 30, 2019 at 8:04 AM Konstantin Belousov wrote: > Author: kib > Date: Thu May 30 15:04:09 2019 > New Revision: 348421 > URL: https://svnweb.freebsd.org/changeset/base/348421 > > Log: > Silence witness warning about duplicated mutex type. > > The order is correct, it is nullfs vnode interlock -> lower vnode > interlock. vop_stdadd_writecount() is called from nullfs > VOP_ADD_WRITECOUNT() and both take interlocks. > > Requested by: markj > Sponsored by: The FreeBSD Foundation > MFC after: 2 weeks > > Modified: > head/sys/kern/vfs_default.c > > Modified: head/sys/kern/vfs_default.c > > ============================================================================== > --- head/sys/kern/vfs_default.c Thu May 30 14:40:23 2019 (r348420) > +++ head/sys/kern/vfs_default.c Thu May 30 15:04:09 2019 (r348421) > @@ -1113,7 +1113,7 @@ vop_stdadd_writecount(struct vop_add_writecount_args > * > int error; > > vp = ap->a_vp; > - VI_LOCK(vp); > + VI_LOCK_FLAGS(vp, MTX_DUPOK); > if (vp->v_writecount < 0) { > error = ETXTBSY; > } else { > > Does this merit a comment justifying the use of DUPOK? -Ben From owner-svn-src-head@freebsd.org Fri May 31 04:29:30 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5A54915B25C2; Fri, 31 May 2019 04:29:30 +0000 (UTC) (envelope-from lwhsu@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id F18A182460; Fri, 31 May 2019 04:29:29 +0000 (UTC) (envelope-from lwhsu@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C0D6323386; Fri, 31 May 2019 04:29:29 +0000 (UTC) (envelope-from lwhsu@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x4V4TT5G041404; Fri, 31 May 2019 04:29:29 GMT (envelope-from lwhsu@FreeBSD.org) Received: (from lwhsu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4V4TTcf041402; Fri, 31 May 2019 04:29:29 GMT (envelope-from lwhsu@FreeBSD.org) Message-Id: <201905310429.x4V4TTcf041402@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: lwhsu set sender to lwhsu@FreeBSD.org using -f From: Li-Wen Hsu Date: Fri, 31 May 2019 04:29:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r348454 - head/tests/sys/geom/class/eli X-SVN-Group: head X-SVN-Commit-Author: lwhsu X-SVN-Commit-Paths: head/tests/sys/geom/class/eli X-SVN-Commit-Revision: 348454 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: F18A182460 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.96)[-0.964,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 31 May 2019 04:29:30 -0000 Author: lwhsu Date: Fri May 31 04:29:29 2019 New Revision: 348454 URL: https://svnweb.freebsd.org/changeset/base/348454 Log: Remove tests for the deprecated algorithms in r348206 The tests are failing because the return value and output have changed, but before test code structure adjusted, removing these test cases help people be able to focus on more important cases. Discussed with: emaste MFC with: r348206 Sponsored by: The FreeBSD Foundation Modified: head/tests/sys/geom/class/eli/conf.sh head/tests/sys/geom/class/eli/init_test.sh Modified: head/tests/sys/geom/class/eli/conf.sh ============================================================================== --- head/tests/sys/geom/class/eli/conf.sh Fri May 31 03:13:09 2019 (r348453) +++ head/tests/sys/geom/class/eli/conf.sh Fri May 31 04:29:29 2019 (r348454) @@ -37,15 +37,10 @@ for_each_geli_config() { for cipher in aes-xts:128 aes-xts:256 \ aes-cbc:128 aes-cbc:192 aes-cbc:256 \ - 3des-cbc:192 \ - blowfish-cbc:128 blowfish-cbc:160 blowfish-cbc:192 \ - blowfish-cbc:224 blowfish-cbc:256 blowfish-cbc:288 \ - blowfish-cbc:320 blowfish-cbc:352 blowfish-cbc:384 \ - blowfish-cbc:416 blowfish-cbc:448 \ camellia-cbc:128 camellia-cbc:192 camellia-cbc:256; do ealgo=${cipher%%:*} keylen=${cipher##*:} - for aalgo in hmac/md5 hmac/sha1 hmac/ripemd160 hmac/sha256 \ + for aalgo in hmac/sha1 hmac/ripemd160 hmac/sha256 \ hmac/sha384 hmac/sha512; do for secsize in 512 1024 2048 4096 $MAX_SECSIZE; do ${func} $cipher $aalgo $secsize @@ -66,11 +61,6 @@ for_each_geli_config_nointegrity() { md=$(attach_md -t malloc -s $bytes) for cipher in aes-xts:128 aes-xts:256 \ aes-cbc:128 aes-cbc:192 aes-cbc:256 \ - 3des-cbc:192 \ - blowfish-cbc:128 blowfish-cbc:160 blowfish-cbc:192 \ - blowfish-cbc:224 blowfish-cbc:256 blowfish-cbc:288 \ - blowfish-cbc:320 blowfish-cbc:352 blowfish-cbc:384 \ - blowfish-cbc:416 blowfish-cbc:448 \ camellia-cbc:128 camellia-cbc:192 camellia-cbc:256; do ealgo=${cipher%%:*} keylen=${cipher##*:} Modified: head/tests/sys/geom/class/eli/init_test.sh ============================================================================== --- head/tests/sys/geom/class/eli/init_test.sh Fri May 31 03:13:09 2019 (r348453) +++ head/tests/sys/geom/class/eli/init_test.sh Fri May 31 04:29:29 2019 (r348454) @@ -308,13 +308,6 @@ init_alias_body() atf_check dd if=/dev/random of=keyfile bs=512 count=16 status=none for spec in aes:0:AES-XTS:128 aes:128:AES-XTS:128 aes:256:AES-XTS:256 \ - 3des:0:3DES-CBC:192 3des:192:3DES-CBC:192 \ - blowfish:0:Blowfish-CBC:128 blowfish:128:Blowfish-CBC:128 \ - blowfish:160:Blowfish-CBC:160 blowfish:192:Blowfish-CBC:192 \ - blowfish:224:Blowfish-CBC:224 blowfish:256:Blowfish-CBC:256 \ - blowfish:288:Blowfish-CBC:288 blowfish:352:Blowfish-CBC:352 \ - blowfish:384:Blowfish-CBC:384 blowfish:416:Blowfish-CBC:416 \ - blowfish:448:Blowfish-CBC:448 \ camellia:0:CAMELLIA-CBC:128 camellia:128:CAMELLIA-CBC:128 \ camellia:256:CAMELLIA-CBC:256 ; do From owner-svn-src-head@freebsd.org Fri May 31 13:54:02 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9DD6215BDF75; Fri, 31 May 2019 13:54:02 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 422FF6DBC5; Fri, 31 May 2019 13:54:02 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1B3701376; Fri, 31 May 2019 13:54:02 +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 x4VDs1wT044157; Fri, 31 May 2019 13:54:01 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4VDs13j044156; Fri, 31 May 2019 13:54:01 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201905311354.x4VDs13j044156@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Fri, 31 May 2019 13:54:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r348456 - head/sys/conf X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: head/sys/conf X-SVN-Commit-Revision: 348456 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 422FF6DBC5 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.96)[-0.957,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 31 May 2019 13:54:02 -0000 Author: emaste Date: Fri May 31 13:54:01 2019 New Revision: 348456 URL: https://svnweb.freebsd.org/changeset/base/348456 Log: newvers.sh correct typo from r348175 Modified: head/sys/conf/newvers.sh Modified: head/sys/conf/newvers.sh ============================================================================== --- head/sys/conf/newvers.sh Fri May 31 11:21:30 2019 (r348455) +++ head/sys/conf/newvers.sh Fri May 31 13:54:01 2019 (r348456) @@ -48,7 +48,7 @@ # # -V var Print ${var}="${val-of-var}" and exit # -# -v Print TYPE REVISION BRANCH RELEASE VERSION RELDATE variabkes +# -v Print TYPE REVISION BRANCH RELEASE VERSION RELDATE variables # like the -V command # From owner-svn-src-head@freebsd.org Fri May 31 14:59:41 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6F73515BF37F; Fri, 31 May 2019 14:59:41 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 0942E6FA1F; Fri, 31 May 2019 14:59:41 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id CD5B71D61; Fri, 31 May 2019 14:59:40 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x4VExe7g075892; Fri, 31 May 2019 14:59:40 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4VExenG075891; Fri, 31 May 2019 14:59:40 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201905311459.x4VExenG075891@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Fri, 31 May 2019 14:59:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r348457 - head/sys/vm X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: head/sys/vm X-SVN-Commit-Revision: 348457 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 0942E6FA1F X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.98 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.98)[-0.976,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 31 May 2019 14:59:41 -0000 Author: markj Date: Fri May 31 14:59:40 2019 New Revision: 348457 URL: https://svnweb.freebsd.org/changeset/base/348457 Log: Remove a redundant vm_page_remove() call. vm_page_free_prep() removes the page from its object. No functional change intended. Reviewed by: alc, kib MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D20469 Modified: head/sys/vm/vm_page.c Modified: head/sys/vm/vm_page.c ============================================================================== --- head/sys/vm/vm_page.c Fri May 31 13:54:01 2019 (r348456) +++ head/sys/vm/vm_page.c Fri May 31 14:59:40 2019 (r348457) @@ -2645,7 +2645,6 @@ retry: } else { m->flags &= ~PG_ZERO; vm_page_dequeue(m); - vm_page_remove(m); if (vm_page_free_prep(m)) SLIST_INSERT_HEAD(&free, m, plinks.s.ss); From owner-svn-src-head@freebsd.org Fri May 31 15:20:58 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B3EF115BFC73; Fri, 31 May 2019 15:20:58 +0000 (UTC) (envelope-from brooks@spindle.one-eyed-alien.net) Received: from spindle.one-eyed-alien.net (spindle.one-eyed-alien.net [199.48.129.229]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B626F70BCF; Fri, 31 May 2019 15:20:57 +0000 (UTC) (envelope-from brooks@spindle.one-eyed-alien.net) Received: by spindle.one-eyed-alien.net (Postfix, from userid 3001) id 209113C0182; Fri, 31 May 2019 15:20:50 +0000 (UTC) Date: Fri, 31 May 2019 15:20:50 +0000 From: Brooks Davis To: Alexey Dokuchaev Cc: Mateusz Guzik , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r344648 - in head: . sys/kern sys/sys Message-ID: <20190531152049.GA93288@spindle.one-eyed-alien.net> References: <201902272256.x1RMutdK085216@repo.freebsd.org> <20190228074750.GA35369@FreeBSD.org> <20190310151140.GB97029@FreeBSD.org> <20190524091136.GA80897@FreeBSD.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="6TrnltStXW4iwmi0" Content-Disposition: inline In-Reply-To: <20190524091136.GA80897@FreeBSD.org> User-Agent: Mutt/1.9.4 (2018-02-28) X-Rspamd-Queue-Id: B626F70BCF X-Spamd-Bar: --- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-3.45 / 15.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; MIME_GOOD(-0.20)[multipart/signed,text/plain]; RCVD_TLS_LAST(0.00)[]; DMARC_NA(0.00)[freebsd.org]; AUTH_NA(1.00)[]; RCPT_COUNT_FIVE(0.00)[5]; IP_SCORE(-3.58)[ip: (-9.33), ipnet: 199.48.128.0/22(-4.64), asn: 36236(-3.88), country: US(-0.06)]; MX_GOOD(-0.01)[spindle.one-eyed-alien.net]; MX_MISSING(3.50)[requested record is not found]; NEURAL_HAM_SHORT(-0.45)[-0.454,0]; R_SPF_NA(0.00)[]; SIGNED_PGP(-2.00)[]; FORGED_SENDER(0.30)[brooks@freebsd.org,brooks@spindle.one-eyed-alien.net]; R_DKIM_NA(0.00)[]; MIME_TRACE(0.00)[0:+,1:+]; ASN(0.00)[asn:36236, ipnet:199.48.128.0/22, country:US]; FROM_NEQ_ENVFROM(0.00)[brooks@freebsd.org,brooks@spindle.one-eyed-alien.net]; RCVD_COUNT_TWO(0.00)[2] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 31 May 2019 15:20:58 -0000 --6TrnltStXW4iwmi0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Fri, May 24, 2019 at 09:11:36AM +0000, Alexey Dokuchaev wrote: > On Sun, Mar 10, 2019 at 03:11:40PM +0000, Alexey Dokuchaev wrote: > > On Thu, Feb 28, 2019 at 07:47:51AM +0000, Alexey Dokuchaev wrote: > > > On Wed, Feb 27, 2019 at 10:56:55PM +0000, Mateusz Guzik wrote: > > > > New Revision: 344648 > > > > URL: https://svnweb.freebsd.org/changeset/base/344648 > > > >=20 > > > > Log: > > > > Rename seq to seqc to avoid namespace clashes with Linux > > > > =20 > > > > ... > > > > Added: > > > > head/sys/sys/seqc.h (contents, props changed) > > > > Deleted: > > > > head/sys/sys/seq.h > > >=20 > > > Why it was deleted and added as new file instead of being repocopied? > >=20 > > Retransmit. >=20 > Ping! Do you have nothing better to do? -- Brooks --6TrnltStXW4iwmi0 Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQEcBAEBAgAGBQJc8UZRAAoJEKzQXbSebgfAtsYH/j4XEPa/EJ0lg+fj0hS7Thyi +3kVOv79zccCV9dqiL7NESqat6UI4gwtbSMLCArk6XiFZUgrAsDEw9HVepQBk//x f9u8x4WJtUKXQrDr5oMWn5lfU34jsUYcdJFbvsazjLnrtOcuYKQFQgrv+XsGtvEy p9Ebd3WlrsIMkqOjkpZMuHIriSjucbuZYxjQcDOJFp5i2s72exZlgXoU4kR2cJXQ Af+1KSK+uYiP2Kr+6d9qrHS/HzP54ZZ+xTr1LdLEFxsH042jRRy0WtUEpvkHmykr nPYW482E8gSFVl0JlAXTXR/2dUi6tLmKZpdPZCivtZRXJ7TAZk84GzrHwqxK36U= =l0uI -----END PGP SIGNATURE----- --6TrnltStXW4iwmi0-- From owner-svn-src-head@freebsd.org Fri May 31 15:44:35 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1704D15C0226; Fri, 31 May 2019 15:44:35 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id AED07716BC; Fri, 31 May 2019 15:44:34 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 7FA6A25D1; Fri, 31 May 2019 15:44:34 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x4VFiYWG002489; Fri, 31 May 2019 15:44:34 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4VFiYNM002487; Fri, 31 May 2019 15:44:34 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201905311544.x4VFiYNM002487@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Fri, 31 May 2019 15:44:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r348459 - in head: sbin/devd sys/dev/acpica X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: in head: sbin/devd sys/dev/acpica X-SVN-Commit-Revision: 348459 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: AED07716BC X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_SHORT(-0.98)[-0.975,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 31 May 2019 15:44:35 -0000 Author: markj Date: Fri May 31 15:44:33 2019 New Revision: 348459 URL: https://svnweb.freebsd.org/changeset/base/348459 Log: acpi_dock(4): Notify devd(8) on dock status change. PR: 238138 Submitted by: Muhammad Kaisar Arkhan MFC after: 2 weeks Modified: head/sbin/devd/devd.conf.5 head/sys/dev/acpica/acpi_dock.c Modified: head/sbin/devd/devd.conf.5 ============================================================================== --- head/sbin/devd/devd.conf.5 Fri May 31 15:05:54 2019 (r348458) +++ head/sbin/devd/devd.conf.5 Fri May 31 15:44:33 2019 (r348459) @@ -41,7 +41,7 @@ .\" ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS .\" SOFTWARE. .\" -.Dd March 29, 2019 +.Dd May 31, 2019 .Dt DEVD.CONF 5 .Os .Sh NAME @@ -341,6 +341,8 @@ AC line state ($notify=0x00 is offline, 0x01 is online Button state ($notify=0x00 is power, 0x01 is sleep). .It Li CMBAT Battery events. +.It Li Dock +Dock state ($notify=0x00 is undocked, 0x01 is docked). .It Li Lid Lid state ($notify=0x00 is closed, 0x01 is open). .It Li PROCESSOR Modified: head/sys/dev/acpica/acpi_dock.c ============================================================================== --- head/sys/dev/acpica/acpi_dock.c Fri May 31 15:05:54 2019 (r348458) +++ head/sys/dev/acpica/acpi_dock.c Fri May 31 15:44:33 2019 (r348459) @@ -256,11 +256,13 @@ acpi_dock_insert_children(device_t dev) static void acpi_dock_insert(device_t dev) { - struct acpi_dock_softc *sc; + struct acpi_dock_softc *sc; + ACPI_HANDLE h; ACPI_SERIAL_ASSERT(dock); sc = device_get_softc(dev); + h = acpi_get_handle(dev); if (sc->status == ACPI_DOCK_STATUS_UNDOCKED || sc->status == ACPI_DOCK_STATUS_UNKNOWN) { @@ -270,8 +272,12 @@ acpi_dock_insert(device_t dev) return; } - if (!cold) + if (!cold) { acpi_dock_insert_children(dev); + + acpi_UserNotify("Dock", h, 1); + } + sc->status = ACPI_DOCK_STATUS_DOCKED; } } @@ -325,10 +331,13 @@ static void acpi_dock_removal(device_t dev) { struct acpi_dock_softc *sc; + ACPI_HANDLE h; ACPI_SERIAL_ASSERT(dock); sc = device_get_softc(dev); + h = acpi_get_handle(dev); + if (sc->status == ACPI_DOCK_STATUS_DOCKED || sc->status == ACPI_DOCK_STATUS_UNKNOWN) { acpi_dock_eject_children(dev); @@ -342,6 +351,8 @@ acpi_dock_removal(device_t dev) return; } + acpi_UserNotify("Dock", h, 0); + sc->status = ACPI_DOCK_STATUS_UNDOCKED; } @@ -534,4 +545,3 @@ static devclass_t acpi_dock_devclass; DRIVER_MODULE(acpi_dock, acpi, acpi_dock_driver, acpi_dock_devclass, 0, 0); MODULE_DEPEND(acpi_dock, acpi, 1, 1, 1); - From owner-svn-src-head@freebsd.org Fri May 31 15:50:14 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1C5B215C0316; Fri, 31 May 2019 15:50:14 +0000 (UTC) (envelope-from danfe@freebsd.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2610:1c1:1:6074::16:84]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "freefall.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id B50457188E; Fri, 31 May 2019 15:50:13 +0000 (UTC) (envelope-from danfe@freebsd.org) Received: by freefall.freebsd.org (Postfix, from userid 1033) id A873FC758; Fri, 31 May 2019 15:50:13 +0000 (UTC) Date: Fri, 31 May 2019 15:50:13 +0000 From: Alexey Dokuchaev To: Brooks Davis Cc: Mateusz Guzik , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r344648 - in head: . sys/kern sys/sys Message-ID: <20190531155013.GA79837@FreeBSD.org> References: <201902272256.x1RMutdK085216@repo.freebsd.org> <20190228074750.GA35369@FreeBSD.org> <20190310151140.GB97029@FreeBSD.org> <20190524091136.GA80897@FreeBSD.org> <20190531152049.GA93288@spindle.one-eyed-alien.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190531152049.GA93288@spindle.one-eyed-alien.net> User-Agent: Mutt/1.11.4 (2019-03-13) X-Rspamd-Queue-Id: B50457188E X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.92 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.92)[-0.920,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; REPLY(-4.00)[] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 31 May 2019 15:50:14 -0000 On Fri, May 31, 2019 at 03:20:50PM +0000, Brooks Davis wrote: > On Fri, May 24, 2019 at 09:11:36AM +0000, Alexey Dokuchaev wrote: > > On Sun, Mar 10, 2019 at 03:11:40PM +0000, Alexey Dokuchaev wrote: > > > On Thu, Feb 28, 2019 at 07:47:51AM +0000, Alexey Dokuchaev wrote: > > > > On Wed, Feb 27, 2019 at 10:56:55PM +0000, Mateusz Guzik wrote: > > > > > New Revision: 344648 > > > > > URL: https://svnweb.freebsd.org/changeset/base/344648 > > > > > > > > > > Log: > > > > > Rename seq to seqc to avoid namespace clashes with Linux > > > > > > > > > > ... > > > > > Added: > > > > > head/sys/sys/seqc.h (contents, props changed) > > > > > Deleted: > > > > > head/sys/sys/seq.h > > > > > > > > Why it was deleted and added as new file instead of being repocopied? > > > > > > Retransmit. > > > > Ping! > > Do you have nothing better to do? Oh, I have a lot on my plate, thanks for asking. Now, back to the subject: - I think that this commit was executed badly (not via repocopy) - I've been trying to contact mjg@ for several weeks, to no avail :( - All I get in return is an email from a fellow committer asking me if I have anything better to do Sorry, I don't understand this. I don't understand why we ignore email from our own community. I don't understand why we do not correct or at least explain why what looks like a mistake is actually not(?). I don't understand why I'm being ridiculed, not those who make dubious commits and fail to defend them. ./danfe From owner-svn-src-head@freebsd.org Fri May 31 17:10:17 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3C2CA15C1CCC; Fri, 31 May 2019 17:10:17 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3091074F56; Fri, 31 May 2019 17:10:16 +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 x4VHA8lj022464 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NO); Fri, 31 May 2019 20:10:11 +0300 (EEST) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua x4VHA8lj022464 Received: (from kostik@localhost) by tom.home (8.15.2/8.15.2/Submit) id x4VHA81t022462; Fri, 31 May 2019 20:10:08 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Fri, 31 May 2019 20:10:08 +0300 From: Konstantin Belousov To: Benjamin Kaduk Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r348421 - head/sys/kern Message-ID: <20190531171008.GE27392@kib.kiev.ua> References: <201905301504.x4UF49UT019928@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.12.0 (2019-05-25) X-Spam-Status: No, score=-1.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FORGED_GMAIL_RCVD,FREEMAIL_FROM, NML_ADSP_CUSTOM_MED autolearn=no autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on tom.home X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 31 May 2019 17:10:17 -0000 On Thu, May 30, 2019 at 08:14:42PM -0700, Benjamin Kaduk wrote: > On Thu, May 30, 2019 at 8:04 AM Konstantin Belousov wrote: > > > Author: kib > > Date: Thu May 30 15:04:09 2019 > > New Revision: 348421 > > URL: https://svnweb.freebsd.org/changeset/base/348421 > > > > Log: > > Silence witness warning about duplicated mutex type. > > > > The order is correct, it is nullfs vnode interlock -> lower vnode > > interlock. vop_stdadd_writecount() is called from nullfs > > VOP_ADD_WRITECOUNT() and both take interlocks. > > > > Requested by: markj > > Sponsored by: The FreeBSD Foundation > > MFC after: 2 weeks > > > > Modified: > > head/sys/kern/vfs_default.c > > > > Modified: head/sys/kern/vfs_default.c > > > > ============================================================================== > > --- head/sys/kern/vfs_default.c Thu May 30 14:40:23 2019 (r348420) > > +++ head/sys/kern/vfs_default.c Thu May 30 15:04:09 2019 (r348421) > > @@ -1113,7 +1113,7 @@ vop_stdadd_writecount(struct vop_add_writecount_args > > * > > int error; > > > > vp = ap->a_vp; > > - VI_LOCK(vp); > > + VI_LOCK_FLAGS(vp, MTX_DUPOK); > > if (vp->v_writecount < 0) { > > error = ETXTBSY; > > } else { > > > > > Does this merit a comment justifying the use of DUPOK? This is a common pattern in nullfs, because if upper layer operations is done which requires vnode interlock, it is very common to have the op done on lower layer as well, when you need to take the lower layer vnode interlock. I think it is obvious enough what happens when the flag is used. From owner-svn-src-head@freebsd.org Fri May 31 17:44:23 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 137C615C26BB; Fri, 31 May 2019 17:44:23 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id A0F2C761FF; Fri, 31 May 2019 17:44:22 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 7736C3C3F; Fri, 31 May 2019 17:44:22 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x4VHiMin066103; Fri, 31 May 2019 17:44:22 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4VHiMDQ066102; Fri, 31 May 2019 17:44:22 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201905311744.x4VHiMDQ066102@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Fri, 31 May 2019 17:44:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r348471 - head/stand/libsa/zfs X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/stand/libsa/zfs X-SVN-Commit-Revision: 348471 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: A0F2C761FF X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.97)[-0.974,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 31 May 2019 17:44:23 -0000 Author: kevans Date: Fri May 31 17:44:22 2019 New Revision: 348471 URL: https://svnweb.freebsd.org/changeset/base/348471 Log: stand: zfs: Free bouncebuf on error path in vdev_read r344226 inadvertently added this path in which we return from failure on an lseek and do not free bouncebuf on the way out. MFC after: 3 days Modified: head/stand/libsa/zfs/zfs.c Modified: head/stand/libsa/zfs/zfs.c ============================================================================== --- head/stand/libsa/zfs/zfs.c Fri May 31 17:18:09 2019 (r348470) +++ head/stand/libsa/zfs/zfs.c Fri May 31 17:44:22 2019 (r348471) @@ -425,8 +425,10 @@ vdev_read(vdev_t *vdev, void *priv, off_t offset, void } } - if (lseek(fd, start_sec * secsz, SEEK_SET) == -1) - return (errno); + if (lseek(fd, start_sec * secsz, SEEK_SET) == -1) { + ret = errno; + goto error; + } /* Partial data return from first sector */ if (head > 0) { From owner-svn-src-head@freebsd.org Fri May 31 18:00:45 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3F6D115C299A; Fri, 31 May 2019 18:00:45 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id D30A976A5B; Fri, 31 May 2019 18:00:44 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 90C673E03; Fri, 31 May 2019 18:00:44 +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 x4VI0iDe071866; Fri, 31 May 2019 18:00:44 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4VI0iBj071865; Fri, 31 May 2019 18:00:44 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201905311800.x4VI0iBj071865@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Fri, 31 May 2019 18:00:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r348472 - head/usr.sbin/bhyve X-SVN-Group: head X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: head/usr.sbin/bhyve X-SVN-Commit-Revision: 348472 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: D30A976A5B X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.98)[-0.975,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 31 May 2019 18:00:45 -0000 Author: jhb Date: Fri May 31 18:00:44 2019 New Revision: 348472 URL: https://svnweb.freebsd.org/changeset/base/348472 Log: Whitespace cleanups, no functional change. Modified: head/usr.sbin/bhyve/pci_emul.c Modified: head/usr.sbin/bhyve/pci_emul.c ============================================================================== --- head/usr.sbin/bhyve/pci_emul.c Fri May 31 17:44:22 2019 (r348471) +++ head/usr.sbin/bhyve/pci_emul.c Fri May 31 18:00:44 2019 (r348472) @@ -56,8 +56,8 @@ __FBSDID("$FreeBSD$"); #include "pci_irq.h" #include "pci_lpc.h" -#define CONF1_ADDR_PORT 0x0cf8 -#define CONF1_DATA_PORT 0x0cfc +#define CONF1_ADDR_PORT 0x0cf8 +#define CONF1_DATA_PORT 0x0cfc #define CONF1_ENABLE 0x80000000ul @@ -479,7 +479,7 @@ modify_bar_registration(struct pci_devinst *pi, int id iop.handler = pci_emul_io_handler; iop.arg = pi; error = register_inout(&iop); - } else + } else error = unregister_inout(&iop); break; case PCIBAR_MEM32: @@ -547,7 +547,7 @@ memen(struct pci_devinst *pi) * the address range decoded by the BAR register. */ static void -update_bar_address(struct pci_devinst *pi, uint64_t addr, int idx, int type) +update_bar_address(struct pci_devinst *pi, uint64_t addr, int idx, int type) { int decode; @@ -670,7 +670,7 @@ pci_emul_alloc_pbar(struct pci_devinst *pdi, int idx, pdi->pi_bar[idx + 1].type = PCIBAR_MEMHI64; pci_set_cfgdata32(pdi, PCIR_BAR(idx + 1), bar >> 32); } - + register_bar(pdi, idx); return (0); @@ -843,7 +843,7 @@ pci_emul_add_msixcap(struct pci_devinst *pi, int msgnu assert(msgnum >= 1 && msgnum <= MAX_MSIX_TABLE_ENTRIES); assert(barnum >= 0 && barnum <= PCIR_MAX_BAR_0); - + tab_size = msgnum * MSIX_TABLE_ENTRY_SIZE; /* Align table size to nearest 4K */ @@ -1093,7 +1093,7 @@ init_pci(struct vmctx *ctx) for (bus = 0; bus < MAXBUSES; bus++) { if ((bi = pci_businfo[bus]) == NULL) continue; - /* + /* * Keep track of the i/o and memory resources allocated to * this bus. */ @@ -1726,9 +1726,9 @@ pci_emul_cmdsts_write(struct pci_devinst *pi, int coff else unregister_bar(pi, i); } - break; + break; default: - assert(0); + assert(0); } } @@ -1944,7 +1944,7 @@ INOUT_PORT(pci_cfgdata, CONF1_DATA_PORT+3, IOPORT_F_IN #define DIOSZ 8 #define DMEMSZ 4096 struct pci_emul_dsoftc { - uint8_t ioregs[DIOSZ]; + uint8_t ioregs[DIOSZ]; uint8_t memregs[2][DMEMSZ]; }; @@ -2036,7 +2036,7 @@ pci_emul_diow(struct vmctx *ctx, int vcpu, struct pci_ } else { printf("diow: memw unknown size %d\n", size); } - + /* * magic interrupt ?? */ @@ -2061,7 +2061,7 @@ pci_emul_dior(struct vmctx *ctx, int vcpu, struct pci_ offset, size); return (0); } - + value = 0; if (size == 1) { value = sc->ioregs[offset]; @@ -2080,7 +2080,7 @@ pci_emul_dior(struct vmctx *ctx, int vcpu, struct pci_ offset, size); return (0); } - + i = baridx - 1; /* 'memregs' index */ if (size == 1) { From owner-svn-src-head@freebsd.org Fri May 31 18:29:13 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6095815C30FB; Fri, 31 May 2019 18:29:13 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 00B8B775C0; Fri, 31 May 2019 18:29:13 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id DBA844339; Fri, 31 May 2019 18:29:12 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x4VITCd3087246; Fri, 31 May 2019 18:29:12 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4VITCgW087245; Fri, 31 May 2019 18:29:12 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201905311829.x4VITCgW087245@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Fri, 31 May 2019 18:29:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r348473 - head/sys/netinet/netdump X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: head/sys/netinet/netdump X-SVN-Commit-Revision: 348473 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 00B8B775C0 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.97)[-0.974,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 31 May 2019 18:29:13 -0000 Author: markj Date: Fri May 31 18:29:12 2019 New Revision: 348473 URL: https://svnweb.freebsd.org/changeset/base/348473 Log: netdump: Buffer pages to avoid calling netdump_send() on each 4KB write. netdump waits for acknowledgement from the server for each write. When dumping page table pages, we perform many small writes, limiting throughput. Use the netdump client's buffer to buffer small contiguous writes before calling netdump_send() to flush the MAXDUMPPGS-sized buffer. This results in a significant reduction in the time taken to complete a netdump. Submitted by: Sam Gwydir Reviewed by: cem MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D20317 Modified: head/sys/netinet/netdump/netdump_client.c Modified: head/sys/netinet/netdump/netdump_client.c ============================================================================== --- head/sys/netinet/netdump/netdump_client.c Fri May 31 18:00:44 2019 (r348472) +++ head/sys/netinet/netdump/netdump_client.c Fri May 31 18:29:12 2019 (r348473) @@ -130,6 +130,9 @@ static struct { union kd_ip ndc_client; union kd_ip ndc_gateway; uint8_t ndc_af; + /* Runtime State */ + off_t nd_tx_off; + size_t nd_buf_len; } nd_conf; #define nd_server nd_conf.ndc_server.in4 #define nd_client nd_conf.ndc_client.in4 @@ -945,6 +948,14 @@ netdump_dumper(void *priv __unused, void *virtual, virtual, (uintmax_t)offset, length); if (virtual == NULL) { + if (nd_conf.nd_buf_len != 0) { + error = netdump_send(NETDUMP_VMCORE, nd_conf.nd_tx_off, nd_buf, + nd_conf.nd_buf_len); + if (error != 0) { + dump_failed = 1; + } + } + if (dump_failed != 0) printf("failed to dump the kernel core\n"); else if (netdump_send(NETDUMP_FINISHED, 0, NULL, 0) != 0) @@ -957,12 +968,22 @@ netdump_dumper(void *priv __unused, void *virtual, if (length > sizeof(nd_buf)) return (ENOSPC); - memmove(nd_buf, virtual, length); - error = netdump_send(NETDUMP_VMCORE, offset, nd_buf, length); - if (error != 0) { - dump_failed = 1; - return (error); + if (nd_conf.nd_buf_len + length > sizeof(nd_buf) || + (nd_conf.nd_buf_len != 0 && nd_conf.nd_tx_off + + nd_conf.nd_buf_len != offset)) { + error = netdump_send(NETDUMP_VMCORE, nd_conf.nd_tx_off, nd_buf, + nd_conf.nd_buf_len); + if (error != 0) { + dump_failed = 1; + return (error); + } + nd_conf.nd_buf_len = 0; + nd_conf.nd_tx_off = offset; } + + memmove(nd_buf + nd_conf.nd_buf_len, virtual, length); + nd_conf.nd_buf_len += length; + return (0); } From owner-svn-src-head@freebsd.org Fri May 31 18:40:21 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C469115C34B2; Fri, 31 May 2019 18:40:20 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 66F2C77CFF; Fri, 31 May 2019 18:40:20 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 448F144F1; Fri, 31 May 2019 18:40:20 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x4VIeKnS092817; Fri, 31 May 2019 18:40:20 GMT (envelope-from gjb@FreeBSD.org) Received: (from gjb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4VIeJj7092816; Fri, 31 May 2019 18:40:19 GMT (envelope-from gjb@FreeBSD.org) Message-Id: <201905311840.x4VIeJj7092816@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gjb set sender to gjb@FreeBSD.org using -f From: Glen Barber Date: Fri, 31 May 2019 18:40:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r348474 - head/release/tools X-SVN-Group: head X-SVN-Commit-Author: gjb X-SVN-Commit-Paths: head/release/tools X-SVN-Commit-Revision: 348474 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 66F2C77CFF X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.96)[-0.962,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 31 May 2019 18:40:21 -0000 Author: gjb Date: Fri May 31 18:40:19 2019 New Revision: 348474 URL: https://svnweb.freebsd.org/changeset/base/348474 Log: Revert r348438. The fix to override the default python version when building the sysutils/py-google-compute-engine did not work, and there are still issues that need to be addressed in the port itself. See bugzilla 238267 for additional details. MFC after: 6 days MFC with: r348438 MFC note: no-op to appease the merge tracker Sponsored by: The FreeBSD Foundation Modified: head/release/tools/gce.conf head/release/tools/vmimage.subr Modified: head/release/tools/gce.conf ============================================================================== --- head/release/tools/gce.conf Fri May 31 18:29:12 2019 (r348473) +++ head/release/tools/gce.conf Fri May 31 18:40:19 2019 (r348474) @@ -6,14 +6,10 @@ # The default of 3GB is too small for GCE, so override the size here. export VMSIZE=20G -# The sysutils/py-google-compute-engine port needs the lang/python -# symbolic link to point to lang/python2. -export DEFAULT_VERSIONS="python=2.7" - # Set to a list of packages to install. export VM_EXTRA_PACKAGES="firstboot-freebsd-update firstboot-pkgs \ google-cloud-sdk panicmail sudo sysutils/py-google-compute-engine \ - lang/python lang/python2" + lang/python lang/python2 lang/python3" # Set to a list of third-party software to enable in rc.conf(5). export VM_RC_LIST="ntpd sshd growfs \ Modified: head/release/tools/vmimage.subr ============================================================================== --- head/release/tools/vmimage.subr Fri May 31 18:29:12 2019 (r348473) +++ head/release/tools/vmimage.subr Fri May 31 18:40:19 2019 (r348474) @@ -72,10 +72,6 @@ cleanup() { mdconfig -d -u ${mddev} fi - # Avoid inheriting the DEFAULT_VERSIONS for lang/python from - # the gce.conf. - unset DEFAULT_VERSIONS - return 0 } From owner-svn-src-head@freebsd.org Fri May 31 18:53:05 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B304815C3974; Fri, 31 May 2019 18:53:05 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 55C0C80730; Fri, 31 May 2019 18:53:05 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 2798C484A; Fri, 31 May 2019 18:53:05 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x4VIr54v003301; Fri, 31 May 2019 18:53:05 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4VIr5FL003300; Fri, 31 May 2019 18:53:05 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201905311853.x4VIr5FL003300@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Fri, 31 May 2019 18:53:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r348476 - head/sys/amd64/amd64 X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: head/sys/amd64/amd64 X-SVN-Commit-Revision: 348476 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 55C0C80730 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.96)[-0.964,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 31 May 2019 18:53:06 -0000 Author: kib Date: Fri May 31 18:53:04 2019 New Revision: 348476 URL: https://svnweb.freebsd.org/changeset/base/348476 Log: Simplify flow of pmap_demote_pde_locked() and add more comprehensive debugging checks. In particular, - Move the code to handle failure to allocate page table page into a helper. - After the previous item is done, it is possible to distinguish !PG_A case and case of missed page, in the control flow. - Make the variable to indicate that in-kernel mapping is demoted. - Assert that missed page table page can only happen for in-kernel mapping when demoting direct map. - If DIAGNOSTIC is enabled, and the page table page should be already filled, check all ptes instead of only first one. Reviewed by: alc, markj Tested by: pho (previous version) Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D20266 Modified: head/sys/amd64/amd64/pmap.c Modified: head/sys/amd64/amd64/pmap.c ============================================================================== --- head/sys/amd64/amd64/pmap.c Fri May 31 18:46:35 2019 (r348475) +++ head/sys/amd64/amd64/pmap.c Fri May 31 18:53:04 2019 (r348476) @@ -4490,6 +4490,50 @@ pmap_demote_pde(pmap_t pmap, pd_entry_t *pde, vm_offse return (rv); } +static void +pmap_demote_pde_check(pt_entry_t *firstpte __unused, pt_entry_t newpte __unused) +{ +#ifdef INVARIANTS +#ifdef DIAGNOSTIC + pt_entry_t *xpte, *ypte; + + for (xpte = firstpte; xpte < firstpte + NPTEPG; + xpte++, newpte += PAGE_SIZE) { + if ((*xpte & PG_FRAME) != (newpte & PG_FRAME)) { + printf("pmap_demote_pde: xpte %zd and newpte map " + "different pages: found %#lx, expected %#lx\n", + xpte - firstpte, *xpte, newpte); + printf("page table dump\n"); + for (ypte = firstpte; ypte < firstpte + NPTEPG; ypte++) + printf("%zd %#lx\n", ypte - firstpte, *ypte); + panic("firstpte"); + } + } +#else + KASSERT((*firstpte & PG_FRAME) == (newpte & PG_FRAME), + ("pmap_demote_pde: firstpte and newpte map different physical" + " addresses")); +#endif +#endif +} + +static void +pmap_demote_pde_abort(pmap_t pmap, vm_offset_t va, pd_entry_t *pde, + pd_entry_t oldpde, struct rwlock **lockp) +{ + struct spglist free; + vm_offset_t sva; + + SLIST_INIT(&free); + sva = trunc_2mpage(va); + pmap_remove_pde(pmap, pde, sva, &free, lockp); + if ((oldpde & pmap_global_bit(pmap)) == 0) + pmap_invalidate_pde_page(pmap, sva, oldpde); + vm_page_free_pages_toq(&free, true); + CTR2(KTR_PMAP, "pmap_demote_pde: failure for va %#lx in pmap %p", + va, pmap); +} + static boolean_t pmap_demote_pde_locked(pmap_t pmap, pd_entry_t *pde, vm_offset_t va, struct rwlock **lockp) @@ -4499,12 +4543,11 @@ pmap_demote_pde_locked(pmap_t pmap, pd_entry_t *pde, v pt_entry_t PG_A, PG_G, PG_M, PG_PKU_MASK, PG_RW, PG_V; vm_paddr_t mptepa; vm_page_t mpte; - struct spglist free; - vm_offset_t sva; int PG_PTE_CACHE; + bool in_kernel; - PG_G = pmap_global_bit(pmap); PG_A = pmap_accessed_bit(pmap); + PG_G = pmap_global_bit(pmap); PG_M = pmap_modified_bit(pmap); PG_RW = pmap_rw_bit(pmap); PG_V = pmap_valid_bit(pmap); @@ -4512,42 +4555,59 @@ pmap_demote_pde_locked(pmap_t pmap, pd_entry_t *pde, v PG_PKU_MASK = pmap_pku_mask_bit(pmap); PMAP_LOCK_ASSERT(pmap, MA_OWNED); + in_kernel = va >= VM_MAXUSER_ADDRESS; oldpde = *pde; KASSERT((oldpde & (PG_PS | PG_V)) == (PG_PS | PG_V), ("pmap_demote_pde: oldpde is missing PG_PS and/or PG_V")); - if ((oldpde & PG_A) == 0 || (mpte = pmap_remove_pt_page(pmap, va)) == - NULL) { + + /* + * Invalidate the 2MB page mapping and return "failure" if the + * mapping was never accessed. + */ + if ((oldpde & PG_A) == 0) { + pmap_demote_pde_abort(pmap, va, pde, oldpde, lockp); + return (FALSE); + } + + mpte = pmap_remove_pt_page(pmap, va); + if (mpte == NULL) { KASSERT((oldpde & PG_W) == 0, ("pmap_demote_pde: page table page for a wired mapping" " is missing")); /* - * Invalidate the 2MB page mapping and return "failure" if the - * mapping was never accessed or the allocation of the new - * page table page fails. If the 2MB page mapping belongs to - * the direct map region of the kernel's address space, then - * the page allocation request specifies the highest possible - * priority (VM_ALLOC_INTERRUPT). Otherwise, the priority is - * normal. Page table pages are preallocated for every other - * part of the kernel address space, so the direct map region - * is the only part of the kernel address space that must be - * handled here. + * If the page table page is missing and the mapping + * is for a kernel address, the mapping must belong to + * the direct map. Page table pages are preallocated + * for every other part of the kernel address space, + * so the direct map region is the only part of the + * kernel address space that must be handled here. */ - if ((oldpde & PG_A) == 0 || (mpte = vm_page_alloc(NULL, - pmap_pde_pindex(va), (va >= DMAP_MIN_ADDRESS && va < - DMAP_MAX_ADDRESS ? VM_ALLOC_INTERRUPT : VM_ALLOC_NORMAL) | - VM_ALLOC_NOOBJ | VM_ALLOC_WIRED)) == NULL) { - SLIST_INIT(&free); - sva = trunc_2mpage(va); - pmap_remove_pde(pmap, pde, sva, &free, lockp); - if ((oldpde & PG_G) == 0) - pmap_invalidate_pde_page(pmap, sva, oldpde); - vm_page_free_pages_toq(&free, true); - CTR2(KTR_PMAP, "pmap_demote_pde: failure for va %#lx" - " in pmap %p", va, pmap); + KASSERT(!in_kernel || (va >= DMAP_MIN_ADDRESS && + va < DMAP_MAX_ADDRESS), + ("pmap_demote_pde: No saved mpte for va %#lx", va)); + + /* + * If the 2MB page mapping belongs to the direct map + * region of the kernel's address space, then the page + * allocation request specifies the highest possible + * priority (VM_ALLOC_INTERRUPT). Otherwise, the + * priority is normal. + */ + mpte = vm_page_alloc(NULL, pmap_pde_pindex(va), + (in_kernel ? VM_ALLOC_INTERRUPT : VM_ALLOC_NORMAL) | + VM_ALLOC_NOOBJ | VM_ALLOC_WIRED); + + /* + * If the allocation of the new page table page fails, + * invalidate the 2MB page mapping and return "failure". + */ + if (mpte == NULL) { + pmap_demote_pde_abort(pmap, va, pde, oldpde, lockp); return (FALSE); } - if (va < VM_MAXUSER_ADDRESS) { + + if (!in_kernel) { mpte->wire_count = NPTEPG; pmap_resident_count_inc(pmap, 1); } @@ -4569,9 +4629,7 @@ pmap_demote_pde_locked(pmap_t pmap, pd_entry_t *pde, v if ((oldpde & PG_PROMOTED) == 0) pmap_fill_ptp(firstpte, newpte); - KASSERT((*firstpte & PG_FRAME) == (newpte & PG_FRAME), - ("pmap_demote_pde: firstpte and newpte map different physical" - " addresses")); + pmap_demote_pde_check(firstpte, newpte); /* * If the mapping has changed attributes, update the page table @@ -4606,7 +4664,7 @@ pmap_demote_pde_locked(pmap_t pmap, pd_entry_t *pde, v /* * Invalidate a stale recursive mapping of the page table page. */ - if (va >= VM_MAXUSER_ADDRESS) + if (in_kernel) pmap_invalidate_page(pmap, (vm_offset_t)vtopte(va)); /* @@ -4616,8 +4674,8 @@ pmap_demote_pde_locked(pmap_t pmap, pd_entry_t *pde, v pmap_pv_demote_pde(pmap, va, oldpde & PG_PS_FRAME, lockp); atomic_add_long(&pmap_pde_demotions, 1); - CTR2(KTR_PMAP, "pmap_demote_pde: success for va %#lx" - " in pmap %p", va, pmap); + CTR2(KTR_PMAP, "pmap_demote_pde: success for va %#lx in pmap %p", + va, pmap); return (TRUE); } From owner-svn-src-head@freebsd.org Fri May 31 21:02:44 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EAC7A15C5C9B; Fri, 31 May 2019 21:02:43 +0000 (UTC) (envelope-from dougm@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 8ACB384771; Fri, 31 May 2019 21:02:43 +0000 (UTC) (envelope-from dougm@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 627095DFB; Fri, 31 May 2019 21:02:43 +0000 (UTC) (envelope-from dougm@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x4VL2hne071813; Fri, 31 May 2019 21:02:43 GMT (envelope-from dougm@FreeBSD.org) Received: (from dougm@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4VL2gvw071809; Fri, 31 May 2019 21:02:42 GMT (envelope-from dougm@FreeBSD.org) Message-Id: <201905312102.x4VL2gvw071809@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dougm set sender to dougm@FreeBSD.org using -f From: Doug Moore Date: Fri, 31 May 2019 21:02:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r348484 - head/sys/vm X-SVN-Group: head X-SVN-Commit-Author: dougm X-SVN-Commit-Paths: head/sys/vm X-SVN-Commit-Revision: 348484 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 8ACB384771 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.96)[-0.964,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 31 May 2019 21:02:44 -0000 Author: dougm Date: Fri May 31 21:02:42 2019 New Revision: 348484 URL: https://svnweb.freebsd.org/changeset/base/348484 Log: The function vm_phys_free_contig invokes vm_phys_free_pages for every power-of-two page block it frees, launching an unsuccessful search for a buddy to pair up with each time. The only possible buddy-up mergers are across the boundaries of the freed region, so change vm_phys_free_contig simply to enqueue the freed interior blocks, via a new function vm_phys_enqueue_contig, and then call vm_phys_free_pages on the bounding blocks to create as big a cross-boundary block as possible after buddy-merging. The only callers of vm_phys_free_contig at the moment call it in situations where merging blocks across the boundary is clearly impossible, so just call vm_phys_enqueue_contig in those places and avoid trying to buddy-up at all. One beneficiary of this change is in breaking reservations. For the case where memory is freed in breaking a reservation with only the first and last pages allocated, the number of cycles consumed by the operation drops about 11% with this change. Suggested by: alc Reviewed by: alc Approved by: kib, markj (mentors) Differential Revision: https://reviews.freebsd.org/D16901 Modified: head/sys/vm/vm_page.c head/sys/vm/vm_phys.c head/sys/vm/vm_phys.h head/sys/vm/vm_reserv.c Modified: head/sys/vm/vm_page.c ============================================================================== --- head/sys/vm/vm_page.c Fri May 31 20:36:32 2019 (r348483) +++ head/sys/vm/vm_page.c Fri May 31 21:02:42 2019 (r348484) @@ -833,7 +833,7 @@ vm_page_startup(vm_offset_t vaddr) vmd = VM_DOMAIN(seg->domain); vm_domain_free_lock(vmd); - vm_phys_free_contig(m, pagecount); + vm_phys_enqueue_contig(m, pagecount); vm_domain_free_unlock(vmd); vm_domain_freecnt_inc(vmd, pagecount); vm_cnt.v_page_count += (u_int)pagecount; Modified: head/sys/vm/vm_phys.c ============================================================================== --- head/sys/vm/vm_phys.c Fri May 31 20:36:32 2019 (r348483) +++ head/sys/vm/vm_phys.c Fri May 31 21:02:42 2019 (r348484) @@ -1095,14 +1095,35 @@ vm_phys_free_pages(vm_page_t m, int order) } /* - * Free a contiguous, arbitrarily sized set of physical pages. + * Return the largest possible order of a set of pages starting at m. + */ +static int +max_order(vm_page_t m) +{ + + /* + * Unsigned "min" is used here so that "order" is assigned + * "VM_NFREEORDER - 1" when "m"'s physical address is zero + * or the low-order bits of its physical address are zero + * because the size of a physical address exceeds the size of + * a long. + */ + return (min(ffsl(VM_PAGE_TO_PHYS(m) >> PAGE_SHIFT) - 1, + VM_NFREEORDER - 1)); +} + +/* + * Free a contiguous, arbitrarily sized set of physical pages, without + * merging across set boundaries. * * The free page queues must be locked. */ void -vm_phys_free_contig(vm_page_t m, u_long npages) +vm_phys_enqueue_contig(vm_page_t m, u_long npages) { - u_int n; + struct vm_freelist *fl; + struct vm_phys_seg *seg; + vm_page_t m_end; int order; /* @@ -1110,29 +1131,68 @@ vm_phys_free_contig(vm_page_t m, u_long npages) * possible power-of-two-sized subsets. */ vm_domain_free_assert_locked(vm_pagequeue_domain(m)); - for (;; npages -= n) { - /* - * Unsigned "min" is used here so that "order" is assigned - * "VM_NFREEORDER - 1" when "m"'s physical address is zero - * or the low-order bits of its physical address are zero - * because the size of a physical address exceeds the size of - * a long. - */ - order = min(ffsl(VM_PAGE_TO_PHYS(m) >> PAGE_SHIFT) - 1, - VM_NFREEORDER - 1); - n = 1 << order; - if (npages < n) - break; - vm_phys_free_pages(m, order); - m += n; + seg = &vm_phys_segs[m->segind]; + fl = (*seg->free_queues)[m->pool]; + m_end = m + npages; + /* Free blocks of increasing size. */ + while ((order = max_order(m)) < VM_NFREEORDER - 1 && + m + (1 << order) <= m_end) { + KASSERT(seg == &vm_phys_segs[m->segind], + ("%s: page range [%p,%p) spans multiple segments", + __func__, m_end - npages, m)); + vm_freelist_add(fl, m, order, 1); + m += 1 << order; } - /* The residual "npages" is less than "1 << (VM_NFREEORDER - 1)". */ - for (; npages > 0; npages -= n) { - order = flsl(npages) - 1; - n = 1 << order; - vm_phys_free_pages(m, order); - m += n; + /* Free blocks of maximum size. */ + while (m + (1 << order) <= m_end) { + KASSERT(seg == &vm_phys_segs[m->segind], + ("%s: page range [%p,%p) spans multiple segments", + __func__, m_end - npages, m)); + vm_freelist_add(fl, m, order, 1); + m += 1 << order; } + /* Free blocks of diminishing size. */ + while (m < m_end) { + KASSERT(seg == &vm_phys_segs[m->segind], + ("%s: page range [%p,%p) spans multiple segments", + __func__, m_end - npages, m)); + order = flsl(m_end - m) - 1; + vm_freelist_add(fl, m, order, 1); + m += 1 << order; + } +} + +/* + * Free a contiguous, arbitrarily sized set of physical pages. + * + * The free page queues must be locked. + */ +void +vm_phys_free_contig(vm_page_t m, u_long npages) +{ + int order_start, order_end; + vm_page_t m_start, m_end; + + vm_domain_free_assert_locked(vm_pagequeue_domain(m)); + + m_start = m; + order_start = max_order(m_start); + if (order_start < VM_NFREEORDER - 1) + m_start += 1 << order_start; + m_end = m + npages; + order_end = max_order(m_end); + if (order_end < VM_NFREEORDER - 1) + m_end -= 1 << order_end; + /* + * Avoid unnecessary coalescing by freeing the pages at the start and + * end of the range last. + */ + if (m_start < m_end) + vm_phys_enqueue_contig(m_start, m_end - m_start); + if (order_start < VM_NFREEORDER - 1) + vm_phys_free_pages(m, order_start); + if (order_end < VM_NFREEORDER - 1) + vm_phys_free_pages(m_end, order_end); } /* Modified: head/sys/vm/vm_phys.h ============================================================================== --- head/sys/vm/vm_phys.h Fri May 31 20:36:32 2019 (r348483) +++ head/sys/vm/vm_phys.h Fri May 31 21:02:42 2019 (r348484) @@ -84,6 +84,7 @@ vm_page_t vm_phys_alloc_freelist_pages(int domain, int int vm_phys_alloc_npages(int domain, int pool, int npages, vm_page_t ma[]); vm_page_t vm_phys_alloc_pages(int domain, int pool, int order); int vm_phys_domain_match(int prefer, vm_paddr_t low, vm_paddr_t high); +void vm_phys_enqueue_contig(vm_page_t m, u_long npages); int vm_phys_fictitious_reg_range(vm_paddr_t start, vm_paddr_t end, vm_memattr_t memattr); void vm_phys_fictitious_unreg_range(vm_paddr_t start, vm_paddr_t end); Modified: head/sys/vm/vm_reserv.c ============================================================================== --- head/sys/vm/vm_reserv.c Fri May 31 20:36:32 2019 (r348483) +++ head/sys/vm/vm_reserv.c Fri May 31 21:02:42 2019 (r348484) @@ -1066,7 +1066,7 @@ vm_reserv_break(vm_reserv_t rv) else { hi = NBPOPMAP * i + bitpos; vm_domain_free_lock(VM_DOMAIN(rv->domain)); - vm_phys_free_contig(&rv->pages[lo], hi - lo); + vm_phys_enqueue_contig(&rv->pages[lo], hi - lo); vm_domain_free_unlock(VM_DOMAIN(rv->domain)); lo = hi; } From owner-svn-src-head@freebsd.org Fri May 31 21:05:06 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1430B15C5D1F for ; Fri, 31 May 2019 21:05:06 +0000 (UTC) (envelope-from kevin.bowling@kev009.com) Received: from mail-it1-x130.google.com (mail-it1-x130.google.com [IPv6:2607:f8b0:4864:20::130]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id A6A35848ED for ; Fri, 31 May 2019 21:05:05 +0000 (UTC) (envelope-from kevin.bowling@kev009.com) Received: by mail-it1-x130.google.com with SMTP id j17so11858543itk.0 for ; Fri, 31 May 2019 14:05:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kev009.com; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=hgtJENyNszFz4uYioI9Uh5kkK7mYEJpibW0aKspridw=; b=CNcaO3htOO8oZkGqeqyxhQTl/9Is6TZz65Pi0H2LuDl/jvhqu6VnCaF8aFkdeHnM0/ DPNiGnVmWUOs9CiV/zo5bmEYuy3smtET9S7pNmrW10Kb2gedertv7gN4veo9an6H52sz sG/CWxyndPv2Gb3ykqSvJG9qHqx70ADwIYd5Q= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=hgtJENyNszFz4uYioI9Uh5kkK7mYEJpibW0aKspridw=; b=KTWgHmzt1Cn/5q1o9/YZAfaXPtODiEG0eKz6nK6D8FcyU3rgqmgXCyNtoR71GI5BWC b41MJ7Ni2AeFpzqxZxl6t2EmdrwcV7qkMw4+aO7TllJgKGNZLHjEadvEYZNMLqCWn2jg /HyHd+pfG0ETCuTBYbA/nuJOaW96smK8ByvOEZlKqNuOc4w+1cQvnn7XUQnkAqUAZ1tk 2v/h0Ngpg72LD3qU3r7Yw/SshYSk2V3HntwfmU4QIM1E00/F69jMXgfFnN0yEQw3fG81 QArJ6l/l6tm1dRMskyAFP52pX7vtMMz5Oo8jypJKXfXpKcLBiS6JKebR75HaUt8P0KP5 Njjg== X-Gm-Message-State: APjAAAU9nMa2cq2MCEnBE2oo3zvvQAtKMUWKj9hySPp5hJemr+CFr3A1 Cnlac13d1o83wYI5WfhTup5G8hXZkk3nKN1D0M84zg== X-Google-Smtp-Source: APXvYqwf55aV/t6LzQLeBN1X/galEvG9qFm0x4fUHBhjP4rkCMJV1d5HQg4mHONx2IMeQfdXuQY38ONyIAhV4sVQ3aw= X-Received: by 2002:a24:28c1:: with SMTP id h184mr9594591ith.105.1559336704835; Fri, 31 May 2019 14:05:04 -0700 (PDT) MIME-Version: 1.0 References: <201902272256.x1RMutdK085216@repo.freebsd.org> <20190228074750.GA35369@FreeBSD.org> <20190310151140.GB97029@FreeBSD.org> <20190524091136.GA80897@FreeBSD.org> <20190531152049.GA93288@spindle.one-eyed-alien.net> <20190531155013.GA79837@FreeBSD.org> In-Reply-To: <20190531155013.GA79837@FreeBSD.org> From: Kevin Bowling Date: Fri, 31 May 2019 14:04:53 -0700 Message-ID: Subject: Re: svn commit: r344648 - in head: . sys/kern sys/sys To: Alexey Dokuchaev Cc: Brooks Davis , svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers , Mateusz Guzik Content-Type: text/plain; charset="UTF-8" X-Rspamd-Queue-Id: A6A35848ED X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.96 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; REPLY(-4.00)[]; NEURAL_HAM_SHORT(-0.96)[-0.957,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 31 May 2019 21:05:06 -0000 I know of several people that have blocked your mail. Maybe a moment for reflection on your attitude and approach if you want to be taken seriously. On Fri, May 31, 2019 at 8:50 AM Alexey Dokuchaev wrote: > > On Fri, May 31, 2019 at 03:20:50PM +0000, Brooks Davis wrote: > > On Fri, May 24, 2019 at 09:11:36AM +0000, Alexey Dokuchaev wrote: > > > On Sun, Mar 10, 2019 at 03:11:40PM +0000, Alexey Dokuchaev wrote: > > > > On Thu, Feb 28, 2019 at 07:47:51AM +0000, Alexey Dokuchaev wrote: > > > > > On Wed, Feb 27, 2019 at 10:56:55PM +0000, Mateusz Guzik wrote: > > > > > > New Revision: 344648 > > > > > > URL: https://svnweb.freebsd.org/changeset/base/344648 > > > > > > > > > > > > Log: > > > > > > Rename seq to seqc to avoid namespace clashes with Linux > > > > > > > > > > > > ... > > > > > > Added: > > > > > > head/sys/sys/seqc.h (contents, props changed) > > > > > > Deleted: > > > > > > head/sys/sys/seq.h > > > > > > > > > > Why it was deleted and added as new file instead of being repocopied? > > > > > > > > Retransmit. > > > > > > Ping! > > > > Do you have nothing better to do? > > Oh, I have a lot on my plate, thanks for asking. Now, back to the subject: > > - I think that this commit was executed badly (not via repocopy) > - I've been trying to contact mjg@ for several weeks, to no avail :( > - All I get in return is an email from a fellow committer asking me > if I have anything better to do > > Sorry, I don't understand this. I don't understand why we ignore email > from our own community. I don't understand why we do not correct or at > least explain why what looks like a mistake is actually not(?). I don't > understand why I'm being ridiculed, not those who make dubious commits > and fail to defend them. > > ./danfe > _______________________________________________ > 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" From owner-svn-src-head@freebsd.org Fri May 31 22:17:13 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1C98615C7246; Fri, 31 May 2019 22:17:13 +0000 (UTC) (envelope-from freebsd@gndrsh.dnsmgr.net) Received: from gndrsh.dnsmgr.net (br1.CN84in.dnsmgr.net [69.59.192.140]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6D2C486B87; Fri, 31 May 2019 22:17:12 +0000 (UTC) (envelope-from freebsd@gndrsh.dnsmgr.net) Received: from gndrsh.dnsmgr.net (localhost [127.0.0.1]) by gndrsh.dnsmgr.net (8.13.3/8.13.3) with ESMTP id x4VMH3H2031669; Fri, 31 May 2019 15:17:03 -0700 (PDT) (envelope-from freebsd@gndrsh.dnsmgr.net) Received: (from freebsd@localhost) by gndrsh.dnsmgr.net (8.13.3/8.13.3/Submit) id x4VMH3YH031668; Fri, 31 May 2019 15:17:03 -0700 (PDT) (envelope-from freebsd) From: "Rodney W. Grimes" Message-Id: <201905312217.x4VMH3YH031668@gndrsh.dnsmgr.net> Subject: Re: svn commit: r344648 - in head: . sys/kern sys/sys In-Reply-To: To: Kevin Bowling Date: Fri, 31 May 2019 15:17:03 -0700 (PDT) CC: Alexey Dokuchaev , Brooks Davis , svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers , Mateusz Guzik Reply-To: rgrimes@freebsd.org X-Mailer: ELM [version 2.4ME+ PL121h (25)] MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII X-Rspamd-Queue-Id: 6D2C486B87 X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.96 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.96)[-0.959,0]; REPLY(-4.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 31 May 2019 22:17:13 -0000 > I know of several people that have blocked your mail. Maybe a moment > for reflection on your attitude and approach if you want to be taken > seriously. I would consider repository damange and abuse to be VERY serious. I would also consider the treatmeant I am seeing of danfe boarder line on contempt. But then I also know there are probably some that have blocked me. The project, sadly is spiraling around a toilet, and someone is about to flush.... It is not what you hear, it is what you are not hearing that makes me say these things... And espcially what core seams to not be willing to hear, and is literly (I can proove this) paying lip service to "solicited feedback". I asked about some of my solicited feedback, and a core member said he could not find it in his inbox and that I needed to locate and provide him a pointer to it. THAT my friends is not solicited feedback, that is /dev/null of feedback and just plain out right unexcusable. And note above all else the "product" of the FreeBSD project is NOT releases, it IS the repository, and if we get sloppy with that product it makes life harder for our consumers. If you have ever tried to find the history of a deleted object (which is what the process being complained about here creaetes) it is a royal PITA. Regards, Rod > On Fri, May 31, 2019 at 8:50 AM Alexey Dokuchaev wrote: > > > > On Fri, May 31, 2019 at 03:20:50PM +0000, Brooks Davis wrote: > > > On Fri, May 24, 2019 at 09:11:36AM +0000, Alexey Dokuchaev wrote: > > > > On Sun, Mar 10, 2019 at 03:11:40PM +0000, Alexey Dokuchaev wrote: > > > > > On Thu, Feb 28, 2019 at 07:47:51AM +0000, Alexey Dokuchaev wrote: > > > > > > On Wed, Feb 27, 2019 at 10:56:55PM +0000, Mateusz Guzik wrote: > > > > > > > New Revision: 344648 > > > > > > > URL: https://svnweb.freebsd.org/changeset/base/344648 > > > > > > > > > > > > > > Log: > > > > > > > Rename seq to seqc to avoid namespace clashes with Linux > > > > > > > > > > > > > > ... > > > > > > > Added: > > > > > > > head/sys/sys/seqc.h (contents, props changed) > > > > > > > Deleted: > > > > > > > head/sys/sys/seq.h > > > > > > > > > > > > Why it was deleted and added as new file instead of being repocopied? > > > > > > > > > > Retransmit. > > > > > > > > Ping! > > > > > > Do you have nothing better to do? > > > > Oh, I have a lot on my plate, thanks for asking. Now, back to the subject: > > > > - I think that this commit was executed badly (not via repocopy) > > - I've been trying to contact mjg@ for several weeks, to no avail :( > > - All I get in return is an email from a fellow committer asking me > > if I have anything better to do > > > > Sorry, I don't understand this. I don't understand why we ignore email > > from our own community. I don't understand why we do not correct or at > > least explain why what looks like a mistake is actually not(?). I don't > > understand why I'm being ridiculed, not those who make dubious commits > > and fail to defend them. > > > > ./danfe > > _______________________________________________ > > 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" > > -- Rod Grimes rgrimes@freebsd.org From owner-svn-src-head@freebsd.org Fri May 31 22:56:42 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 59BCA15C7DC1 for ; Fri, 31 May 2019 22:56:42 +0000 (UTC) (envelope-from kevin.bowling@kev009.com) Received: from mail-it1-x135.google.com (mail-it1-x135.google.com [IPv6:2607:f8b0:4864:20::135]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id E810188202 for ; Fri, 31 May 2019 22:56:41 +0000 (UTC) (envelope-from kevin.bowling@kev009.com) Received: by mail-it1-x135.google.com with SMTP id h9so3695981itk.3 for ; Fri, 31 May 2019 15:56:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kev009.com; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=sNBHXk8xhqXjo3/LT5LFVNNfY82pTafPOr1962tLwP4=; b=e3nFLlGRFpI4xCnjIGQGbAgN/xOW607oY9IeMZXwKaw9NUKbp+lF/nXnX34sZskSrg F6Dbg92NkJDRfosWaGWp87qy0OqIV2JNF5tnXJDSgTt1+0v2345HoFKSvyRjEfZCxJ/C aXOjk+eFAXj8GfXcnNGtY2V0h1u6qBiYWjOsw= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=sNBHXk8xhqXjo3/LT5LFVNNfY82pTafPOr1962tLwP4=; b=NnTYPXeElMWx3cIdw8gcScjdQNmyzXO3l7v9jn22u1gRtcAVDrKMw+PzHaUnjkzvqt oNCZ+WvKf4Yb6Ikn/1y2qkpHxJTWJylb8JPko1gPiVmFwF2oEhwVrQV7ZIg7+jz1Yrpg F9CiLQ43D0X+MdfFfcX8FX/UJSL9/zLmwMvQfV0Ms+i9pIRTwbx3u2tLtqsLb88etIEK el4h/m6PFCfnNWWZWpeN/JE8eRRZWXjk9P62T6n2GX0rqU7lOEAZqcInnzGE4pQTMQt1 h+AAqER0PnR+2vs2R8OOsvxJ/OvVP26c6WJFbZ4TRbsG4EfaQfZEUIZRjeb1wz1qfarK pq3w== X-Gm-Message-State: APjAAAUggEgsQgfWANOG+Q8Cv5+aGx8HpcJo8bObc3J68jPvjAc8paYC +nPTabhs4GSTbdgGDDiP6MOLOVCW375BfbMczGRGKw== X-Google-Smtp-Source: APXvYqxpbvlNxHyR2z++mh5cpCxoVSzk9pNtbPcRkvvgAXI+1VFlqs8VI08LcY234PQShcM9hs7FIaHtj5ZXjiFkJAg= X-Received: by 2002:a05:6638:3e4:: with SMTP id s4mr2221481jaq.141.1559343400959; Fri, 31 May 2019 15:56:40 -0700 (PDT) MIME-Version: 1.0 References: <201905312217.x4VMH3YH031668@gndrsh.dnsmgr.net> In-Reply-To: <201905312217.x4VMH3YH031668@gndrsh.dnsmgr.net> From: Kevin Bowling Date: Fri, 31 May 2019 15:56:30 -0700 Message-ID: Subject: Re: svn commit: r344648 - in head: . sys/kern sys/sys To: rgrimes@freebsd.org Cc: Alexey Dokuchaev , Brooks Davis , svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers , Mateusz Guzik Content-Type: text/plain; charset="UTF-8" X-Rspamd-Queue-Id: E810188202 X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.93 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.93)[-0.933,0]; REPLY(-4.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 31 May 2019 22:56:42 -0000 The vast majority of contributors don't enjoy nit-picking on these trivialities. If the broader developer community is not rallying for the revert and some core conspiracy doesn't care about it either, that forms the de facto opinion of the FreeBSD community of today that this is trivial and irrelevant. Yes, there is vocal absolutism on the fringes about SHALLS and MUSTS about all sorts of things aside from modernizing FreeBSD and making it viable on current generation hardware. These parties might be happier and better aligned with OpenBSD ideologically as well as personalities. Regards, Kevin On Fri, May 31, 2019 at 3:17 PM Rodney W. Grimes wrote: > > > I know of several people that have blocked your mail. Maybe a moment > > for reflection on your attitude and approach if you want to be taken > > seriously. > > I would consider repository damange and abuse to be VERY serious. > I would also consider the treatmeant I am seeing of danfe boarder > line on contempt. > But then I also know there are probably some that have blocked me. > The project, sadly is spiraling around a toilet, and someone is about to flush.... > > It is not what you hear, it is what you are not hearing that makes me say these things... > And espcially what core seams to not be willing to hear, and is literly (I can proove this) > paying lip service to "solicited feedback". > > I asked about some of my solicited feedback, and a core member said he > could not find it in his inbox and that I needed to locate and provide > him a pointer to it. THAT my friends is not solicited feedback, that is > /dev/null of feedback and just plain out right unexcusable. > > And note above all else the "product" of the FreeBSD project is NOT > releases, it IS the repository, and if we get sloppy with that product > it makes life harder for our consumers. If you have ever tried to > find the history of a deleted object (which is what the process being > complained about here creaetes) it is a royal PITA. > > Regards, > Rod > > > On Fri, May 31, 2019 at 8:50 AM Alexey Dokuchaev wrote: > > > > > > On Fri, May 31, 2019 at 03:20:50PM +0000, Brooks Davis wrote: > > > > On Fri, May 24, 2019 at 09:11:36AM +0000, Alexey Dokuchaev wrote: > > > > > On Sun, Mar 10, 2019 at 03:11:40PM +0000, Alexey Dokuchaev wrote: > > > > > > On Thu, Feb 28, 2019 at 07:47:51AM +0000, Alexey Dokuchaev wrote: > > > > > > > On Wed, Feb 27, 2019 at 10:56:55PM +0000, Mateusz Guzik wrote: > > > > > > > > New Revision: 344648 > > > > > > > > URL: https://svnweb.freebsd.org/changeset/base/344648 > > > > > > > > > > > > > > > > Log: > > > > > > > > Rename seq to seqc to avoid namespace clashes with Linux > > > > > > > > > > > > > > > > ... > > > > > > > > Added: > > > > > > > > head/sys/sys/seqc.h (contents, props changed) > > > > > > > > Deleted: > > > > > > > > head/sys/sys/seq.h > > > > > > > > > > > > > > Why it was deleted and added as new file instead of being repocopied? > > > > > > > > > > > > Retransmit. > > > > > > > > > > Ping! > > > > > > > > Do you have nothing better to do? > > > > > > Oh, I have a lot on my plate, thanks for asking. Now, back to the subject: > > > > > > - I think that this commit was executed badly (not via repocopy) > > > - I've been trying to contact mjg@ for several weeks, to no avail :( > > > - All I get in return is an email from a fellow committer asking me > > > if I have anything better to do > > > > > > Sorry, I don't understand this. I don't understand why we ignore email > > > from our own community. I don't understand why we do not correct or at > > > least explain why what looks like a mistake is actually not(?). I don't > > > understand why I'm being ridiculed, not those who make dubious commits > > > and fail to defend them. > > > > > > ./danfe > > > _______________________________________________ > > > 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" > > > > > > -- > Rod Grimes rgrimes@freebsd.org From owner-svn-src-head@freebsd.org Fri May 31 22:57:21 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A143915C7E1C; Fri, 31 May 2019 22:57:21 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 41BF788346; Fri, 31 May 2019 22:57:21 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1A025710A; Fri, 31 May 2019 22:57:21 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x4VMvKqH030128; Fri, 31 May 2019 22:57:20 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4VMvKfm030127; Fri, 31 May 2019 22:57:20 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201905312257.x4VMvKfm030127@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Fri, 31 May 2019 22:57:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r348486 - head/sys/conf X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head/sys/conf X-SVN-Commit-Revision: 348486 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 41BF788346 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.94 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.95)[-0.945,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 31 May 2019 22:57:22 -0000 Author: imp Date: Fri May 31 22:57:20 2019 New Revision: 348486 URL: https://svnweb.freebsd.org/changeset/base/348486 Log: Defer evaluation of modified until after it's set With the reorg r348175, we now look at modified before it is set. Rearrange things so that we can set include_metadata to either yes, no or if-modified. This should fix the -R flag that was broken in r348175, which broke WITH_REPRODUCIBLE_BUILD for kernels. Feedback From: emaste@ Differential Revision: https://reviews.freebsd.org/D20480 Modified: head/sys/conf/newvers.sh Modified: head/sys/conf/newvers.sh ============================================================================== --- head/sys/conf/newvers.sh Fri May 31 21:22:58 2019 (r348485) +++ head/sys/conf/newvers.sh Fri May 31 22:57:20 2019 (r348486) @@ -96,7 +96,10 @@ fi COPYRIGHT="$COPYRIGHT " -include_metadata=true +# We expand include_metadata later since we may set it to the +# future value of modified. +include_metadata=yes +modified=no while getopts crRvV: opt; do case "$opt" in c) @@ -104,12 +107,10 @@ while getopts crRvV: opt; do exit 0 ;; r) - include_metadata= + include_metadata=no ;; R) - if [ -z "${modified}" ]; then - include_metadata= - fi + include_metadata=if-modified ;; v) # Only put variables that are single lines here. @@ -253,7 +254,7 @@ if [ -n "$svnversion" ] ; then case "$svn" in [0-9]*[MSP]|*:*) svn=" r${svn}" - modified=true + modified=yes ;; [0-9]*) svn=" r${svn}" @@ -296,7 +297,7 @@ if [ -n "$git_cmd" ] ; then fi if git_tree_modified; then git="${git}-dirty" - modified=true + modified=yes fi fi @@ -312,7 +313,8 @@ if [ -n "$hg_cmd" ] ; then fi fi -if [ -z "${include_metadata}" ]; then +[ ${include_metadata} = "if-modified" -a ${modified} = "yes" ] && include_metadata=yes +if [ ${include_metadata} != "yes" ]; then VERINFO="${VERSION}${svn}${git}${hg} ${i}" VERSTR="${VERINFO}\\n" else From owner-svn-src-head@freebsd.org Sat Jun 1 00:46:36 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4E90315A5EEB for ; Sat, 1 Jun 2019 00:46:36 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-qk1-x729.google.com (mail-qk1-x729.google.com [IPv6:2607:f8b0:4864:20::729]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id D9DF48B0D7 for ; Sat, 1 Jun 2019 00:46:35 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-qk1-x729.google.com with SMTP id p18so7540430qkk.0 for ; Fri, 31 May 2019 17:46:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=7LlIRJ3TeOqm1pfWcFlC41yR8xvvLKlmfPOyIZr8rxs=; b=O5JZ60FOSP0Z7xgbIF5LF99fMwtNB68mIgSLF2e0/CYSmaYqqtagihCxCHQrAWxN5E yUoSBHXMMRLXUw4dk3lx5t7WNxYIIBvMN5TM5EtlNihCrbDO4nB2+h6UDIO3pgpv9rMF QGG9S5hmWu7BACUVi7shCxZYE9pI4SnvJvu3MFv0Cod5/sFssI5/8vRwmxFfL5mMGjHp jobEpYnCj6bzOYVuu7nYMh9lQOlgJ8/+KxNkQeS9+qHDKxgXZCGt8NaFQ+8ImeBOAf9s JVeCNFmun7ngSehXJcTsDo+ufn0ryS95hsounHTQ2zaxboECKLZU4EyxkGlze2vwBN0i BLPg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=7LlIRJ3TeOqm1pfWcFlC41yR8xvvLKlmfPOyIZr8rxs=; b=iEHxn1W0Cnj5LCBfycZdvLklvKhAzsClFB4cpz6QRQZ+bldvkDqzsi+VUwCf+sX1um Ni4+iMc+chjb3ASN/jrWZAFcxC2H1NsWuBMUh7jcyTVsc0XLzdfyPoEjeKtvvUnCO39p ffXQ2gJiaI7XJE2WpLQTJGycprTEaOlC+ehLMsN7abg5sCyhodC0+DMf6QvPZ4ee8ibk StqipLQ02Cpt8evr9trDQZ9ZnDdpLA1TD71Pj7WoeVfYesvR7bykiQGBlfaX/j4yAo8O sHd5cpSHJzn5CFJq/QPGk9D5/DsgHU9YrJ/Zq6FjUIsJVL5SxGsqU+oGTnSao02G9sn2 fE6g== X-Gm-Message-State: APjAAAW40j0mklRk0smBEZfCDUrYGIDIHOO6B9CNenuPugHFn4GOi/so l23Z7H3EisUCWafBVcyn4YSYwLB5nE0XnVqX+etXM3kF X-Google-Smtp-Source: APXvYqxJMEnBSyPRVPwhdzGkaYp83w3RpTnGzhDeFs8msNKfZ5Rqu8kzQH3lCQOeaHeKGFF/8gLsZmmPl/atgX4z6QE= X-Received: by 2002:a37:484e:: with SMTP id v75mr10950949qka.331.1559349995046; Fri, 31 May 2019 17:46:35 -0700 (PDT) MIME-Version: 1.0 References: <201905312217.x4VMH3YH031668@gndrsh.dnsmgr.net> In-Reply-To: From: Warner Losh Date: Fri, 31 May 2019 18:46:23 -0600 Message-ID: Subject: Re: svn commit: r344648 - in head: . sys/kern sys/sys To: Kevin Bowling Cc: "Rodney W. Grimes" , Alexey Dokuchaev , Brooks Davis , svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers , Mateusz Guzik X-Rspamd-Queue-Id: D9DF48B0D7 X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.96 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.96)[-0.965,0]; REPLY(-4.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0] Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.29 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 01 Jun 2019 00:46:36 -0000 When we move to git, stuff like this just won't matter. So it's hard to get worked up about it now... and even if we weren't heading that way, the history preserved is so small as to say more than "meh" here. There is too little ROI to get worked up about. Warner On Fri, May 31, 2019, 4:56 PM Kevin Bowling wrote: > The vast majority of contributors don't enjoy nit-picking on these > trivialities. If the broader developer community is not rallying for > the revert and some core conspiracy doesn't care about it either, that > forms the de facto opinion of the FreeBSD community of today that this > is trivial and irrelevant. > > Yes, there is vocal absolutism on the fringes about SHALLS and MUSTS > about all sorts of things aside from modernizing FreeBSD and making it > viable on current generation hardware. These parties might be happier > and better aligned with OpenBSD ideologically as well as > personalities. > > Regards, > Kevin > > On Fri, May 31, 2019 at 3:17 PM Rodney W. Grimes > wrote: > > > > > I know of several people that have blocked your mail. Maybe a moment > > > for reflection on your attitude and approach if you want to be taken > > > seriously. > > > > I would consider repository damange and abuse to be VERY serious. > > I would also consider the treatmeant I am seeing of danfe boarder > > line on contempt. > > But then I also know there are probably some that have blocked me. > > The project, sadly is spiraling around a toilet, and someone is about to > flush.... > > > > It is not what you hear, it is what you are not hearing that makes me > say these things... > > And espcially what core seams to not be willing to hear, and is literly > (I can proove this) > > paying lip service to "solicited feedback". > > > > I asked about some of my solicited feedback, and a core member said he > > could not find it in his inbox and that I needed to locate and provide > > him a pointer to it. THAT my friends is not solicited feedback, that is > > /dev/null of feedback and just plain out right unexcusable. > > > > And note above all else the "product" of the FreeBSD project is NOT > > releases, it IS the repository, and if we get sloppy with that product > > it makes life harder for our consumers. If you have ever tried to > > find the history of a deleted object (which is what the process being > > complained about here creaetes) it is a royal PITA. > > > > Regards, > > Rod > > > > > On Fri, May 31, 2019 at 8:50 AM Alexey Dokuchaev > wrote: > > > > > > > > On Fri, May 31, 2019 at 03:20:50PM +0000, Brooks Davis wrote: > > > > > On Fri, May 24, 2019 at 09:11:36AM +0000, Alexey Dokuchaev wrote: > > > > > > On Sun, Mar 10, 2019 at 03:11:40PM +0000, Alexey Dokuchaev wrote: > > > > > > > On Thu, Feb 28, 2019 at 07:47:51AM +0000, Alexey Dokuchaev > wrote: > > > > > > > > On Wed, Feb 27, 2019 at 10:56:55PM +0000, Mateusz Guzik > wrote: > > > > > > > > > New Revision: 344648 > > > > > > > > > URL: https://svnweb.freebsd.org/changeset/base/344648 > > > > > > > > > > > > > > > > > > Log: > > > > > > > > > Rename seq to seqc to avoid namespace clashes with Linux > > > > > > > > > > > > > > > > > > ... > > > > > > > > > Added: > > > > > > > > > head/sys/sys/seqc.h (contents, props changed) > > > > > > > > > Deleted: > > > > > > > > > head/sys/sys/seq.h > > > > > > > > > > > > > > > > Why it was deleted and added as new file instead of being > repocopied? > > > > > > > > > > > > > > Retransmit. > > > > > > > > > > > > Ping! > > > > > > > > > > Do you have nothing better to do? > > > > > > > > Oh, I have a lot on my plate, thanks for asking. Now, back to the > subject: > > > > > > > > - I think that this commit was executed badly (not via repocopy) > > > > - I've been trying to contact mjg@ for several weeks, to no avail :( > > > > - All I get in return is an email from a fellow committer asking me > > > > if I have anything better to do > > > > > > > > Sorry, I don't understand this. I don't understand why we ignore > email > > > > from our own community. I don't understand why we do not correct or > at > > > > least explain why what looks like a mistake is actually not(?). I > don't > > > > understand why I'm being ridiculed, not those who make dubious > commits > > > > and fail to defend them. > > > > > > > > ./danfe > > > > _______________________________________________ > > > > 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" > > > > > > > > > > -- > > Rod Grimes > rgrimes@freebsd.org > > From owner-svn-src-head@freebsd.org Sat Jun 1 01:22:23 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3F7B315A6DD7; Sat, 1 Jun 2019 01:22:23 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id D92C28C7C8; Sat, 1 Jun 2019 01:22:22 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B60A18A06; Sat, 1 Jun 2019 01:22:22 +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 x511MMk5009353; Sat, 1 Jun 2019 01:22:22 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x511MLMo009345; Sat, 1 Jun 2019 01:22:21 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201906010122.x511MLMo009345@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: Conrad Meyer Date: Sat, 1 Jun 2019 01:22:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r348489 - in head/sys: conf dev/random dev/virtio/random X-SVN-Group: head X-SVN-Commit-Author: cem X-SVN-Commit-Paths: in head/sys: conf dev/random dev/virtio/random X-SVN-Commit-Revision: 348489 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: D92C28C7C8 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.97)[-0.967,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 01 Jun 2019 01:22:23 -0000 Author: cem Date: Sat Jun 1 01:22:21 2019 New Revision: 348489 URL: https://svnweb.freebsd.org/changeset/base/348489 Log: random(4): Fix RANDOM_LOADABLE build I introduced an obvious compiler error in r346282, so this change fixes that. Unfortunately, RANDOM_LOADABLE isn't covered by our existing tinderbox, and it seems like there were existing latent linking problems. I believe these were introduced on accident in r338324 during reduction of the boolean expression(s) adjacent to randomdev.c and hash.c. It seems the RANDOM_LOADABLE build breakage has gone unnoticed for nine months. This change correctly annotates randomdev.c and hash.c with !random_loadable to match the pre-r338324 logic; and additionally updates the HWRNG drivers in MD 'files.*', which depend on random_device symbols, with !random_loadable (it is invalid for the kernel to depend on symbols from a module). (The expression for both randomdev.c and hash.c was the same, prior to r338324: "optional random random_yarrow | random !random_yarrow !random_loadable". I.e., "random && (yarrow || !loadable)." When Yarrow was removed ("yarrow := False"), the expression was incorrectly reduced to "optional random" when it should have retained "random && !loadable".) Additionally, I discovered that virtio_random was missing a MODULE_DEPEND on random_device, which breaks kld load/link of the driver on RANDOM_LOADABLE kernels. Address that issue as well. PR: 238223 Reported by: Eir Nym Reviewed by: delphij, markm Approved by: secteam(delphij) Sponsored by: Dell EMC Isilon Differential Revision: https://reviews.freebsd.org/D20466 Modified: head/sys/conf/files head/sys/conf/files.amd64 head/sys/conf/files.arm64 head/sys/conf/files.i386 head/sys/conf/files.powerpc head/sys/dev/random/random_infra.c head/sys/dev/virtio/random/virtio_random.c Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Sat Jun 1 01:08:40 2019 (r348488) +++ head/sys/conf/files Sat Jun 1 01:22:21 2019 (r348489) @@ -2758,9 +2758,9 @@ rt2860.fw optional rt2860fw | ralfw \ clean "rt2860.fw" dev/random/random_infra.c optional random dev/random/random_harvestq.c optional random -dev/random/randomdev.c optional random +dev/random/randomdev.c optional random !random_loadable dev/random/fortuna.c optional random !random_loadable -dev/random/hash.c optional random +dev/random/hash.c optional random !random_loadable dev/rc/rc.c optional rc dev/rccgpio/rccgpio.c optional rccgpio gpio dev/re/if_re.c optional re Modified: head/sys/conf/files.amd64 ============================================================================== --- head/sys/conf/files.amd64 Sat Jun 1 01:08:40 2019 (r348488) +++ head/sys/conf/files.amd64 Sat Jun 1 01:22:21 2019 (r348489) @@ -368,8 +368,8 @@ dev/nvme/nvme_sysctl.c optional nvme dev/nvme/nvme_test.c optional nvme dev/nvme/nvme_util.c optional nvme dev/nvram/nvram.c optional nvram isa -dev/random/ivy.c optional rdrand_rng -dev/random/nehemiah.c optional padlock_rng +dev/random/ivy.c optional rdrand_rng !random_loadable +dev/random/nehemiah.c optional padlock_rng !random_loadable dev/qlxge/qls_dbg.c optional qlxge pci dev/qlxge/qls_dump.c optional qlxge pci dev/qlxge/qls_hw.c optional qlxge pci Modified: head/sys/conf/files.arm64 ============================================================================== --- head/sys/conf/files.arm64 Sat Jun 1 01:08:40 2019 (r348488) +++ head/sys/conf/files.arm64 Sat Jun 1 01:22:21 2019 (r348489) @@ -87,7 +87,7 @@ arm/broadcom/bcm2835/bcm2835_ft5406.c optional evdev arm/broadcom/bcm2835/bcm2835_gpio.c optional gpio soc_brcm_bcm2837 fdt arm/broadcom/bcm2835/bcm2835_intr.c optional soc_brcm_bcm2837 fdt arm/broadcom/bcm2835/bcm2835_mbox.c optional soc_brcm_bcm2837 fdt -arm/broadcom/bcm2835/bcm2835_rng.c optional random soc_brcm_bcm2837 fdt +arm/broadcom/bcm2835/bcm2835_rng.c optional random !random_loadable soc_brcm_bcm2837 fdt arm/broadcom/bcm2835/bcm2835_sdhci.c optional sdhci soc_brcm_bcm2837 fdt arm/broadcom/bcm2835/bcm2835_sdhost.c optional sdhci soc_brcm_bcm2837 fdt arm/broadcom/bcm2835/bcm2835_spi.c optional bcm2835_spi soc_brcm_bcm2837 fdt Modified: head/sys/conf/files.i386 ============================================================================== --- head/sys/conf/files.i386 Sat Jun 1 01:08:40 2019 (r348488) +++ head/sys/conf/files.i386 Sat Jun 1 01:22:21 2019 (r348489) @@ -301,8 +301,8 @@ dev/nvme/nvme_util.c optional nvme dev/nvram/nvram.c optional nvram isa dev/ofw/ofwpci.c optional fdt pci dev/pcf/pcf_isa.c optional pcf -dev/random/ivy.c optional rdrand_rng -dev/random/nehemiah.c optional padlock_rng +dev/random/ivy.c optional rdrand_rng !random_loadable +dev/random/nehemiah.c optional padlock_rng !random_loadable dev/sbni/if_sbni.c optional sbni dev/sbni/if_sbni_isa.c optional sbni isa dev/sbni/if_sbni_pci.c optional sbni pci Modified: head/sys/conf/files.powerpc ============================================================================== --- head/sys/conf/files.powerpc Sat Jun 1 01:08:40 2019 (r348488) +++ head/sys/conf/files.powerpc Sat Jun 1 01:22:21 2019 (r348489) @@ -62,7 +62,7 @@ dev/ofw/ofw_standard.c optional aim powerpc dev/ofw/ofw_subr.c standard dev/powermac_nvram/powermac_nvram.c optional powermac_nvram powermac dev/quicc/quicc_bfe_fdt.c optional quicc mpc85xx -dev/random/darn.c optional powerpc64 random +dev/random/darn.c optional powerpc64 random !random_loadable dev/scc/scc_bfe_macio.c optional scc powermac dev/sdhci/fsl_sdhci.c optional mpc85xx sdhci dev/sec/sec.c optional sec mpc85xx Modified: head/sys/dev/random/random_infra.c ============================================================================== --- head/sys/dev/random/random_infra.c Sat Jun 1 01:08:40 2019 (r348488) +++ head/sys/dev/random/random_infra.c Sat Jun 1 01:22:21 2019 (r348489) @@ -198,9 +198,12 @@ read_random(void *buf, u_int len) bool is_random_seeded(void) { + bool result; + RANDOM_CONFIG_S_LOCK(); - random_reader_context.is_random_seeded(); + result = random_reader_context.is_random_seeded(); RANDOM_CONFIG_S_UNLOCK(); + return (result); } Modified: head/sys/dev/virtio/random/virtio_random.c ============================================================================== --- head/sys/dev/virtio/random/virtio_random.c Sat Jun 1 01:08:40 2019 (r348488) +++ head/sys/dev/virtio/random/virtio_random.c Sat Jun 1 01:22:21 2019 (r348489) @@ -88,6 +88,7 @@ DRIVER_MODULE(virtio_random, virtio_pci, vtrnd_driver, vtrnd_modevent, 0); MODULE_VERSION(virtio_random, 1); MODULE_DEPEND(virtio_random, virtio, 1, 1, 1); +MODULE_DEPEND(virtio_random, random_device, 1, 1, 1); static int vtrnd_modevent(module_t mod, int type, void *unused) From owner-svn-src-head@freebsd.org Sat Jun 1 01:40:15 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D183F15A75CA; Sat, 1 Jun 2019 01:40:15 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 711448CF06; Sat, 1 Jun 2019 01:40:15 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4C0668BE0; Sat, 1 Jun 2019 01:40:15 +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 x511eFuQ015649; Sat, 1 Jun 2019 01:40:15 GMT (envelope-from jhibbits@FreeBSD.org) Received: (from jhibbits@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x511eF54015648; Sat, 1 Jun 2019 01:40:15 GMT (envelope-from jhibbits@FreeBSD.org) Message-Id: <201906010140.x511eF54015648@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhibbits set sender to jhibbits@FreeBSD.org using -f From: Justin Hibbits Date: Sat, 1 Jun 2019 01:40:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r348490 - head/sys/powerpc/aim X-SVN-Group: head X-SVN-Commit-Author: jhibbits X-SVN-Commit-Paths: head/sys/powerpc/aim X-SVN-Commit-Revision: 348490 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 711448CF06 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.97)[-0.966,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 01 Jun 2019 01:40:16 -0000 Author: jhibbits Date: Sat Jun 1 01:40:14 2019 New Revision: 348490 URL: https://svnweb.freebsd.org/changeset/base/348490 Log: powerpc/moea: Fix moea64 native VA invalidation Summary: moea64_insert_pteg_native()'s invalidation only works by happenstance. The purpose of the shifts and XORs is to extract the VSID in order to reverse-engineer the lower bits of the VPN. Currently a segment size is 256MB (2**28), and ADDR_API_SHFT64 is 16, so ADDR_PIDX_SHIFT is equivalent. However, it's semantically incorrect, in that we don't want to shift by the page shift size, we want to shift to get to the VSID. Tested by: bdragon Differential Revision: https://reviews.freebsd.org/D20467 Modified: head/sys/powerpc/aim/moea64_native.c Modified: head/sys/powerpc/aim/moea64_native.c ============================================================================== --- head/sys/powerpc/aim/moea64_native.c Sat Jun 1 01:22:21 2019 (r348489) +++ head/sys/powerpc/aim/moea64_native.c Sat Jun 1 01:40:14 2019 (r348490) @@ -646,15 +646,12 @@ moea64_insert_to_pteg_native(struct lpte *pvo_pt, uint * "Modifying a Page Table Entry". Need to reconstruct * the virtual address for the outgoing entry to do that. */ - if (oldptehi & LPTE_BIG) - va = oldptehi >> moea64_large_page_shift; - else - va = oldptehi >> ADDR_PIDX_SHFT; + va = oldptehi >> (ADDR_SR_SHFT - ADDR_API_SHFT64); if (oldptehi & LPTE_HID) va = (((k >> 3) ^ moea64_pteg_mask) ^ va) & - VSID_HASH_MASK; + (ADDR_PIDX >> ADDR_PIDX_SHFT); else - va = ((k >> 3) ^ va) & VSID_HASH_MASK; + va = ((k >> 3) ^ va) & (ADDR_PIDX >> ADDR_PIDX_SHFT); va |= (oldptehi & LPTE_AVPN_MASK) << (ADDR_API_SHFT64 - ADDR_PIDX_SHFT); PTESYNC(); From owner-svn-src-head@freebsd.org Sat Jun 1 03:03:51 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DCB5815A94F8; Sat, 1 Jun 2019 03:03:50 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 800D48F45D; Sat, 1 Jun 2019 03:03: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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 40BA49B27; Sat, 1 Jun 2019 03:03: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 x5133o2Q062994; Sat, 1 Jun 2019 03:03:50 GMT (envelope-from np@FreeBSD.org) Received: (from np@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x5133mV3062988; Sat, 1 Jun 2019 03:03:48 GMT (envelope-from np@FreeBSD.org) Message-Id: <201906010303.x5133mV3062988@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: np set sender to np@FreeBSD.org using -f From: Navdeep Parhar Date: Sat, 1 Jun 2019 03:03:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r348491 - in head/sys/dev/cxgbe: cxgbei tom X-SVN-Group: head X-SVN-Commit-Author: np X-SVN-Commit-Paths: in head/sys/dev/cxgbe: cxgbei tom X-SVN-Commit-Revision: 348491 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 800D48F45D X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.96)[-0.964,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 01 Jun 2019 03:03:51 -0000 Author: np Date: Sat Jun 1 03:03:48 2019 New Revision: 348491 URL: https://svnweb.freebsd.org/changeset/base/348491 Log: cxgbe/t4_tom: adjust the hardware receive window to match changes to the receive sockbuf's high water mark. Calculate rx credits on the spot instead of tracking sbused/sb_cc and rx_credits in the toepcb. The previous method worked when the high water mark changed due to SB_AUTOSIZE but not when it was adjusted directly (for example, by the soreserve in nfsrvd_addsock). This fixes a connection hang while running iozone over an NFS mounted share where nfsd's TCP sockets are being handled by t4_tom. MFC after: 3 days Sponsored by: Chelsio Communications Modified: head/sys/dev/cxgbe/cxgbei/cxgbei.c head/sys/dev/cxgbe/tom/t4_connect.c head/sys/dev/cxgbe/tom/t4_cpl_io.c head/sys/dev/cxgbe/tom/t4_ddp.c head/sys/dev/cxgbe/tom/t4_listen.c head/sys/dev/cxgbe/tom/t4_tls.c head/sys/dev/cxgbe/tom/t4_tom.h Modified: head/sys/dev/cxgbe/cxgbei/cxgbei.c ============================================================================== --- head/sys/dev/cxgbe/cxgbei/cxgbei.c Sat Jun 1 01:40:14 2019 (r348490) +++ head/sys/dev/cxgbe/cxgbei/cxgbei.c Sat Jun 1 03:03:48 2019 (r348491) @@ -398,7 +398,6 @@ do_rx_iscsi_ddp(struct sge_iq *iq, const struct rss_he tp->t_rcvtime = ticks; /* update rx credits */ - toep->rx_credits += pdu_len; t4_rcvd(&toep->td->tod, tp); /* XXX: sc->tom_softc.tod */ so = inp->inp_socket; Modified: head/sys/dev/cxgbe/tom/t4_connect.c ============================================================================== --- head/sys/dev/cxgbe/tom/t4_connect.c Sat Jun 1 01:40:14 2019 (r348490) +++ head/sys/dev/cxgbe/tom/t4_connect.c Sat Jun 1 03:03:48 2019 (r348491) @@ -385,8 +385,7 @@ t4_connect(struct toedev *tod, struct socket *so, stru toep->vnet = so->so_vnet; set_ulp_mode(toep, select_ulp_mode(so, sc, &settings)); SOCKBUF_LOCK(&so->so_rcv); - /* opt0 rcv_bufsiz initially, assumes its normal meaning later */ - toep->rx_credits = min(select_rcv_wnd(so) >> 10, M_RCV_BUFSIZ); + toep->opt0_rcv_bufsize = min(select_rcv_wnd(so) >> 10, M_RCV_BUFSIZ); SOCKBUF_UNLOCK(&so->so_rcv); /* @@ -440,7 +439,7 @@ t4_connect(struct toedev *tod, struct socket *so, stru cpl->peer_ip_hi = *(uint64_t *)&inp->in6p_faddr.s6_addr[0]; cpl->peer_ip_lo = *(uint64_t *)&inp->in6p_faddr.s6_addr[8]; cpl->opt0 = calc_opt0(so, vi, toep->l2te, mtu_idx, rscale, - toep->rx_credits, toep->ulp_mode, &settings); + toep->opt0_rcv_bufsize, toep->ulp_mode, &settings); cpl->opt2 = calc_opt2a(so, toep, &settings); } else { struct cpl_act_open_req *cpl = wrtod(wr); @@ -469,7 +468,7 @@ t4_connect(struct toedev *tod, struct socket *so, stru inp_4tuple_get(inp, &cpl->local_ip, &cpl->local_port, &cpl->peer_ip, &cpl->peer_port); cpl->opt0 = calc_opt0(so, vi, toep->l2te, mtu_idx, rscale, - toep->rx_credits, toep->ulp_mode, &settings); + toep->opt0_rcv_bufsize, toep->ulp_mode, &settings); cpl->opt2 = calc_opt2a(so, toep, &settings); } Modified: head/sys/dev/cxgbe/tom/t4_cpl_io.c ============================================================================== --- head/sys/dev/cxgbe/tom/t4_cpl_io.c Sat Jun 1 01:40:14 2019 (r348490) +++ head/sys/dev/cxgbe/tom/t4_cpl_io.c Sat Jun 1 03:03:48 2019 (r348491) @@ -399,20 +399,10 @@ make_established(struct toepcb *toep, uint32_t iss, ui tp->irs = irs; tcp_rcvseqinit(tp); - tp->rcv_wnd = toep->rx_credits << 10; + tp->rcv_wnd = toep->opt0_rcv_bufsize << 10; tp->rcv_adv += tp->rcv_wnd; tp->last_ack_sent = tp->rcv_nxt; - /* - * If we were unable to send all rx credits via opt0, save the remainder - * in rx_credits so that they can be handed over with the next credit - * update. - */ - SOCKBUF_LOCK(&so->so_rcv); - bufsize = select_rcv_wnd(so); - SOCKBUF_UNLOCK(&so->so_rcv); - toep->rx_credits = bufsize - tp->rcv_wnd; - tp->iss = iss; tcp_sendseqinit(tp); tp->snd_una = iss + 1; @@ -483,37 +473,29 @@ t4_rcvd_locked(struct toedev *tod, struct tcpcb *tp) struct socket *so = inp->inp_socket; struct sockbuf *sb = &so->so_rcv; struct toepcb *toep = tp->t_toe; - int credits; + int rx_credits; INP_WLOCK_ASSERT(inp); - SOCKBUF_LOCK_ASSERT(sb); - KASSERT(toep->sb_cc >= sbused(sb), - ("%s: sb %p has more data (%d) than last time (%d).", - __func__, sb, sbused(sb), toep->sb_cc)); - credits = toep->sb_cc - sbused(sb); - toep->sb_cc = sbused(sb); + rx_credits = sbspace(sb) > tp->rcv_wnd ? sbspace(sb) - tp->rcv_wnd : 0; if (toep->ulp_mode == ULP_MODE_TLS) { - if (toep->tls.rcv_over >= credits) { - toep->tls.rcv_over -= credits; - credits = 0; + if (toep->tls.rcv_over >= rx_credits) { + toep->tls.rcv_over -= rx_credits; + rx_credits = 0; } else { - credits -= toep->tls.rcv_over; + rx_credits -= toep->tls.rcv_over; toep->tls.rcv_over = 0; } } - toep->rx_credits += credits; - if (toep->rx_credits > 0 && - (tp->rcv_wnd <= 32 * 1024 || toep->rx_credits >= 64 * 1024 || - (toep->rx_credits >= 16 * 1024 && tp->rcv_wnd <= 128 * 1024) || - toep->sb_cc + tp->rcv_wnd < sb->sb_lowat)) { - - credits = send_rx_credits(sc, toep, toep->rx_credits); - toep->rx_credits -= credits; - tp->rcv_wnd += credits; - tp->rcv_adv += credits; + if (rx_credits > 0 && + (tp->rcv_wnd <= 32 * 1024 || rx_credits >= 64 * 1024 || + (rx_credits >= 16 * 1024 && tp->rcv_wnd <= 128 * 1024) || + sbused(sb) + tp->rcv_wnd < sb->sb_lowat)) { + rx_credits = send_rx_credits(sc, toep, rx_credits); + tp->rcv_wnd += rx_credits; + tp->rcv_adv += rx_credits; } else if (toep->flags & TPF_FORCE_CREDITS) send_rx_modulate(sc, toep); } @@ -1551,7 +1533,7 @@ do_rx_data(struct sge_iq *iq, const struct rss_header struct socket *so; struct sockbuf *sb; struct epoch_tracker et; - int len; + int len, rx_credits; uint32_t ddp_placed = 0; if (__predict_false(toep->flags & TPF_SYNQE)) { @@ -1636,8 +1618,6 @@ do_rx_data(struct sge_iq *iq, const struct rss_header if (!sbreserve_locked(sb, newsize, so, NULL)) sb->sb_flags &= ~SB_AUTOSIZE; - else - toep->rx_credits += newsize - hiwat; } if (toep->ulp_mode == ULP_MODE_TCPDDP) { @@ -1675,19 +1655,12 @@ do_rx_data(struct sge_iq *iq, const struct rss_header } } - KASSERT(toep->sb_cc >= sbused(sb), - ("%s: sb %p has more data (%d) than last time (%d).", - __func__, sb, sbused(sb), toep->sb_cc)); - toep->rx_credits += toep->sb_cc - sbused(sb); sbappendstream_locked(sb, m, 0); - toep->sb_cc = sbused(sb); - if (toep->rx_credits > 0 && toep->sb_cc + tp->rcv_wnd < sb->sb_lowat) { - int credits; - - credits = send_rx_credits(sc, toep, toep->rx_credits); - toep->rx_credits -= credits; - tp->rcv_wnd += credits; - tp->rcv_adv += credits; + rx_credits = sbspace(sb) > tp->rcv_wnd ? sbspace(sb) - tp->rcv_wnd : 0; + if (rx_credits > 0 && sbused(sb) + tp->rcv_wnd < sb->sb_lowat) { + rx_credits = send_rx_credits(sc, toep, rx_credits); + tp->rcv_wnd += rx_credits; + tp->rcv_adv += rx_credits; } if (toep->ulp_mode == ULP_MODE_TCPDDP && toep->ddp.waiting_count > 0 && Modified: head/sys/dev/cxgbe/tom/t4_ddp.c ============================================================================== --- head/sys/dev/cxgbe/tom/t4_ddp.c Sat Jun 1 01:40:14 2019 (r348490) +++ head/sys/dev/cxgbe/tom/t4_ddp.c Sat Jun 1 03:03:48 2019 (r348491) @@ -304,9 +304,6 @@ insert_ddp_data(struct toepcb *toep, uint32_t n) KASSERT(tp->rcv_wnd >= n, ("%s: negative window size", __func__)); tp->rcv_wnd -= n; #endif -#ifndef USE_DDP_RX_FLOW_CONTROL - toep->rx_credits += n; -#endif CTR2(KTR_CXGBE, "%s: placed %u bytes before falling out of DDP", __func__, n); while (toep->ddp.active_count > 0) { @@ -556,16 +553,10 @@ handle_ddp_data(struct toepcb *toep, __be32 ddp_report if (!sbreserve_locked(sb, newsize, so, NULL)) sb->sb_flags &= ~SB_AUTOSIZE; - else - toep->rx_credits += newsize - hiwat; } SOCKBUF_UNLOCK(sb); CURVNET_RESTORE(); -#ifndef USE_DDP_RX_FLOW_CONTROL - toep->rx_credits += len; -#endif - job->msgrcv = 1; if (db->cancel_pending) { /* @@ -714,12 +705,9 @@ handle_ddp_close(struct toepcb *toep, struct tcpcb *tp INP_WLOCK_ASSERT(toep->inp); DDP_ASSERT_LOCKED(toep); - len = be32toh(rcv_nxt) - tp->rcv_nxt; + len = be32toh(rcv_nxt) - tp->rcv_nxt; tp->rcv_nxt += len; -#ifndef USE_DDP_RX_FLOW_CONTROL - toep->rx_credits += len; -#endif while (toep->ddp.active_count > 0) { MPASS(toep->ddp.active_id != -1); Modified: head/sys/dev/cxgbe/tom/t4_listen.c ============================================================================== --- head/sys/dev/cxgbe/tom/t4_listen.c Sat Jun 1 01:40:14 2019 (r348490) +++ head/sys/dev/cxgbe/tom/t4_listen.c Sat Jun 1 03:03:48 2019 (r348491) @@ -1400,7 +1400,6 @@ found: mtu_idx = find_best_mtu_idx(sc, &inc, &settings); rscale = cpl->tcpopt.wsf && V_tcp_do_rfc1323 ? select_rcv_wscale() : 0; - /* opt0 rcv_bufsiz initially, assumes its normal meaning later */ wnd = max(so->sol_sbrcv_hiwat, MIN_RCV_WND); wnd = min(wnd, MAX_RCV_WND); rx_credits = min(wnd >> 10, M_RCV_BUFSIZ); @@ -1552,8 +1551,7 @@ reset: toep->l2te = &sc->l2t->l2tab[synqe->l2e_idx]; toep->vnet = lctx->vnet; set_ulp_mode(toep, synqe->ulp_mode); - /* opt0 rcv_bufsiz initially, assumes its normal meaning later */ - toep->rx_credits = synqe->rcv_bufsize; + toep->opt0_rcv_bufsize = synqe->rcv_bufsize; MPASS(be32toh(cpl->snd_isn) - 1 == synqe->iss); MPASS(be32toh(cpl->rcv_isn) - 1 == synqe->irs); Modified: head/sys/dev/cxgbe/tom/t4_tls.c ============================================================================== --- head/sys/dev/cxgbe/tom/t4_tls.c Sat Jun 1 01:40:14 2019 (r348490) +++ head/sys/dev/cxgbe/tom/t4_tls.c Sat Jun 1 03:03:48 2019 (r348491) @@ -1458,7 +1458,7 @@ do_rx_tls_cmp(struct sge_iq *iq, const struct rss_head struct socket *so; struct sockbuf *sb; struct mbuf *tls_data; - int len, pdu_length, pdu_overhead, sb_length; + int len, pdu_length, rx_credits; KASSERT(toep->tid == tid, ("%s: toep tid/atid mismatch", __func__)); KASSERT(!(toep->flags & TPF_SYNQE), @@ -1562,24 +1562,10 @@ do_rx_tls_cmp(struct sge_iq *iq, const struct rss_head } /* - * Not all of the bytes on the wire are included in the socket - * buffer (e.g. the MAC of the TLS record). However, those - * bytes are included in the TCP sequence space. To handle - * this, compute the delta for this TLS record in - * 'pdu_overhead' and treat those bytes as having already been - * "read" by the application for the purposes of expanding the - * window. The meat of the TLS record passed to the - * application ('sb_length') will still not be counted as - * "read" until userland actually reads the bytes. - * - * XXX: Some of the calculations below are probably still not - * really correct. + * Not all of the bytes on the wire are included in the socket buffer + * (e.g. the MAC of the TLS record). However, those bytes are included + * in the TCP sequence space. */ - sb_length = m->m_pkthdr.len; - pdu_overhead = pdu_length - sb_length; - toep->rx_credits += pdu_overhead; - tp->rcv_wnd += pdu_overhead; - tp->rcv_adv += pdu_overhead; /* receive buffer autosize */ MPASS(toep->vnet == so->so_vnet); @@ -1587,34 +1573,25 @@ do_rx_tls_cmp(struct sge_iq *iq, const struct rss_head if (sb->sb_flags & SB_AUTOSIZE && V_tcp_do_autorcvbuf && sb->sb_hiwat < V_tcp_autorcvbuf_max && - sb_length > (sbspace(sb) / 8 * 7)) { + m->m_pkthdr.len > (sbspace(sb) / 8 * 7)) { unsigned int hiwat = sb->sb_hiwat; unsigned int newsize = min(hiwat + sc->tt.autorcvbuf_inc, V_tcp_autorcvbuf_max); if (!sbreserve_locked(sb, newsize, so, NULL)) sb->sb_flags &= ~SB_AUTOSIZE; - else - toep->rx_credits += newsize - hiwat; } - KASSERT(toep->sb_cc >= sbused(sb), - ("%s: sb %p has more data (%d) than last time (%d).", - __func__, sb, sbused(sb), toep->sb_cc)); - toep->rx_credits += toep->sb_cc - sbused(sb); sbappendstream_locked(sb, m, 0); - toep->sb_cc = sbused(sb); + rx_credits = sbspace(sb) > tp->rcv_wnd ? sbspace(sb) - tp->rcv_wnd : 0; #ifdef VERBOSE_TRACES CTR5(KTR_CXGBE, "%s: tid %u PDU overhead %d rx_credits %u rcv_wnd %u", - __func__, tid, pdu_overhead, toep->rx_credits, tp->rcv_wnd); + __func__, tid, pdu_overhead, rx_credits, tp->rcv_wnd); #endif - if (toep->rx_credits > 0 && toep->sb_cc + tp->rcv_wnd < sb->sb_lowat) { - int credits; - - credits = send_rx_credits(sc, toep, toep->rx_credits); - toep->rx_credits -= credits; - tp->rcv_wnd += credits; - tp->rcv_adv += credits; + if (rx_credits > 0 && sbused(sb) + tp->rcv_wnd < sb->sb_lowat) { + rx_credits = send_rx_credits(sc, toep, rx_credits); + tp->rcv_wnd += rx_credits; + tp->rcv_adv += rx_credits; } sorwakeup_locked(so); Modified: head/sys/dev/cxgbe/tom/t4_tom.h ============================================================================== --- head/sys/dev/cxgbe/tom/t4_tom.h Sat Jun 1 01:40:14 2019 (r348490) +++ head/sys/dev/cxgbe/tom/t4_tom.h Sat Jun 1 03:03:48 2019 (r348491) @@ -181,9 +181,7 @@ struct toepcb { u_int tx_nocompl; /* tx WR credits since last compl request */ u_int plen_nocompl; /* payload since last compl request */ - /* rx credit handling */ - u_int sb_cc; /* last noted value of so_rcv->sb_cc */ - int rx_credits; /* rx credits (in bytes) to be returned to hw */ + int opt0_rcv_bufsize; /* XXX: save full opt0/opt2 for later? */ u_int ulp_mode; /* ULP mode */ void *ulpcb; From owner-svn-src-head@freebsd.org Sat Jun 1 03:05:21 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C6E8F15A962A; Sat, 1 Jun 2019 03:05:21 +0000 (UTC) (envelope-from koobs.freebsd@gmail.com) Received: from mail-pf1-x441.google.com (mail-pf1-x441.google.com [IPv6:2607:f8b0:4864:20::441]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 396698F5FC; Sat, 1 Jun 2019 03:05:21 +0000 (UTC) (envelope-from koobs.freebsd@gmail.com) Received: by mail-pf1-x441.google.com with SMTP id c14so4894724pfi.1; Fri, 31 May 2019 20:05:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:reply-to:subject:to:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=fjjdl/8iwdUP9kV3zGo/Xs0YmShXZWlJ3B1lSxNdEpA=; b=uqFYG6tuAHh7Qu4AVY/ggF7/8svKFXwa6ER2YLmgLSZ8COdZjosTRhbxpQQifgQOH9 sGQDVfG9v7HQNEqYONJbhSfu7E6yymffoYmCME/itzYwI57iVos1TmxSYPQW48eY4f0l EgWloX+8fQcbpLA+agONtGjkGrqDqCN+AI8JrYpYioOPug8krepN8q9oDbWP2tzjvgVg wxhHajrJJrd1rcItV0bqfG0UWQpNRYdaSyvbSlwO8cF62FQrmSUrchyDQF3mbFJHNgQa zETIpwnRUTm7eIpEkZumfQH+0LWmcxrEHXlcR9s2WH3hqBkRrLVUQNkaI7jsRYmGOvAC 5kNA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:reply-to:subject:to:references:from :message-id:date:user-agent:mime-version:in-reply-to :content-language:content-transfer-encoding; bh=fjjdl/8iwdUP9kV3zGo/Xs0YmShXZWlJ3B1lSxNdEpA=; b=ctXYWFkgTGhtJf+SXfoCOdNsWhKI1a7eDtOeoIFTPkP5fQGpU9X7U0ED4fmLEqKC9a oQY8wCJcLqazi+TBrYhZILHZXlOqpXm9SBrrIabWUi6G0XUhOLIKufcTKePO70GqnOj3 pioaP9buIbFlmlWtCzpp8flOygi7U4v3SN2VSBVjdMZcCbuUR1grl3pDCGvWmRKjSOn4 jhl3oOH7jTxM8CleC3RnLj3HLvmEJj8qGQafuTKswhv4Axz9mP9if/r6A9ePbyzM8o+x 4GIWqhWLuzqkffUsPrAJl8cRpl7NxH0M0rXOmg4efpVRiofvTnBF+k3a9CBH96mYh6iY fC7Q== X-Gm-Message-State: APjAAAWVRY/jzyS6Y12pmVHxeYP0uBTvV0JvfVpId1zhXBGjdKbxAwxZ c0yTr+ZpuZ8RnTh0yY7aWfSGFi/O X-Google-Smtp-Source: APXvYqzzCvof+UKZobApj/7V0rXneGjJGgMVrltRGCN5GNdK04k3vMO45A9j1I9G+kvkQ8CSbDLlDQ== X-Received: by 2002:a62:ae19:: with SMTP id q25mr14020455pff.35.1559358319634; Fri, 31 May 2019 20:05:19 -0700 (PDT) Received: from [192.168.1.105] (167-179-150-231.a7b396.bne.nbn.aussiebb.net. [167.179.150.231]) by smtp.gmail.com with ESMTPSA id a26sm12074903pfl.177.2019.05.31.20.05.17 (version=TLS1_3 cipher=AEAD-AES128-GCM-SHA256 bits=128/128); Fri, 31 May 2019 20:05:19 -0700 (PDT) Sender: Kubilay Kocak Reply-To: koobs@FreeBSD.org Subject: Re: svn commit: r348484 - head/sys/vm To: Doug Moore , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201905312102.x4VL2gvw071809@repo.freebsd.org> From: Kubilay Kocak Message-ID: Date: Sat, 1 Jun 2019 13:05:16 +1000 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:67.0) Gecko/20100101 Thunderbird/67.0 MIME-Version: 1.0 In-Reply-To: <201905312102.x4VL2gvw071809@repo.freebsd.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: 396698F5FC X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.97 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.97)[-0.974,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; REPLY(-4.00)[]; TAGGED_FROM(0.00)[] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 01 Jun 2019 03:05:22 -0000 On 1/06/2019 7:02 am, Doug Moore wrote: > Author: dougm > Date: Fri May 31 21:02:42 2019 > New Revision: 348484 > URL: https://svnweb.freebsd.org/changeset/base/348484 > > Log: > The function vm_phys_free_contig invokes vm_phys_free_pages for every > power-of-two page block it frees, launching an unsuccessful search for > a buddy to pair up with each time. The only possible buddy-up mergers > are across the boundaries of the freed region, so change > vm_phys_free_contig simply to enqueue the freed interior blocks, via a > new function vm_phys_enqueue_contig, and then call vm_phys_free_pages > on the bounding blocks to create as big a cross-boundary block as > possible after buddy-merging. > > The only callers of vm_phys_free_contig at the moment call it in > situations where merging blocks across the boundary is clearly > impossible, so just call vm_phys_enqueue_contig in those places and > avoid trying to buddy-up at all. > > One beneficiary of this change is in breaking reservations. For the > case where memory is freed in breaking a reservation with only the > first and last pages allocated, the number of cycles consumed by the > operation drops about 11% with this change. > > Suggested by: alc > Reviewed by: alc > Approved by: kib, markj (mentors) > Differential Revision: https://reviews.freebsd.org/D16901 Can this be an MFC candidate? > Modified: > head/sys/vm/vm_page.c > head/sys/vm/vm_phys.c > head/sys/vm/vm_phys.h > head/sys/vm/vm_reserv.c > > Modified: head/sys/vm/vm_page.c > ============================================================================== > --- head/sys/vm/vm_page.c Fri May 31 20:36:32 2019 (r348483) > +++ head/sys/vm/vm_page.c Fri May 31 21:02:42 2019 (r348484) > @@ -833,7 +833,7 @@ vm_page_startup(vm_offset_t vaddr) > > vmd = VM_DOMAIN(seg->domain); > vm_domain_free_lock(vmd); > - vm_phys_free_contig(m, pagecount); > + vm_phys_enqueue_contig(m, pagecount); > vm_domain_free_unlock(vmd); > vm_domain_freecnt_inc(vmd, pagecount); > vm_cnt.v_page_count += (u_int)pagecount; > > Modified: head/sys/vm/vm_phys.c > ============================================================================== > --- head/sys/vm/vm_phys.c Fri May 31 20:36:32 2019 (r348483) > +++ head/sys/vm/vm_phys.c Fri May 31 21:02:42 2019 (r348484) > @@ -1095,14 +1095,35 @@ vm_phys_free_pages(vm_page_t m, int order) > } > > /* > - * Free a contiguous, arbitrarily sized set of physical pages. > + * Return the largest possible order of a set of pages starting at m. > + */ > +static int > +max_order(vm_page_t m) > +{ > + > + /* > + * Unsigned "min" is used here so that "order" is assigned > + * "VM_NFREEORDER - 1" when "m"'s physical address is zero > + * or the low-order bits of its physical address are zero > + * because the size of a physical address exceeds the size of > + * a long. > + */ > + return (min(ffsl(VM_PAGE_TO_PHYS(m) >> PAGE_SHIFT) - 1, > + VM_NFREEORDER - 1)); > +} > + > +/* > + * Free a contiguous, arbitrarily sized set of physical pages, without > + * merging across set boundaries. > * > * The free page queues must be locked. > */ > void > -vm_phys_free_contig(vm_page_t m, u_long npages) > +vm_phys_enqueue_contig(vm_page_t m, u_long npages) > { > - u_int n; > + struct vm_freelist *fl; > + struct vm_phys_seg *seg; > + vm_page_t m_end; > int order; > > /* > @@ -1110,29 +1131,68 @@ vm_phys_free_contig(vm_page_t m, u_long npages) > * possible power-of-two-sized subsets. > */ > vm_domain_free_assert_locked(vm_pagequeue_domain(m)); > - for (;; npages -= n) { > - /* > - * Unsigned "min" is used here so that "order" is assigned > - * "VM_NFREEORDER - 1" when "m"'s physical address is zero > - * or the low-order bits of its physical address are zero > - * because the size of a physical address exceeds the size of > - * a long. > - */ > - order = min(ffsl(VM_PAGE_TO_PHYS(m) >> PAGE_SHIFT) - 1, > - VM_NFREEORDER - 1); > - n = 1 << order; > - if (npages < n) > - break; > - vm_phys_free_pages(m, order); > - m += n; > + seg = &vm_phys_segs[m->segind]; > + fl = (*seg->free_queues)[m->pool]; > + m_end = m + npages; > + /* Free blocks of increasing size. */ > + while ((order = max_order(m)) < VM_NFREEORDER - 1 && > + m + (1 << order) <= m_end) { > + KASSERT(seg == &vm_phys_segs[m->segind], > + ("%s: page range [%p,%p) spans multiple segments", > + __func__, m_end - npages, m)); > + vm_freelist_add(fl, m, order, 1); > + m += 1 << order; > } > - /* The residual "npages" is less than "1 << (VM_NFREEORDER - 1)". */ > - for (; npages > 0; npages -= n) { > - order = flsl(npages) - 1; > - n = 1 << order; > - vm_phys_free_pages(m, order); > - m += n; > + /* Free blocks of maximum size. */ > + while (m + (1 << order) <= m_end) { > + KASSERT(seg == &vm_phys_segs[m->segind], > + ("%s: page range [%p,%p) spans multiple segments", > + __func__, m_end - npages, m)); > + vm_freelist_add(fl, m, order, 1); > + m += 1 << order; > } > + /* Free blocks of diminishing size. */ > + while (m < m_end) { > + KASSERT(seg == &vm_phys_segs[m->segind], > + ("%s: page range [%p,%p) spans multiple segments", > + __func__, m_end - npages, m)); > + order = flsl(m_end - m) - 1; > + vm_freelist_add(fl, m, order, 1); > + m += 1 << order; > + } > +} > + > +/* > + * Free a contiguous, arbitrarily sized set of physical pages. > + * > + * The free page queues must be locked. > + */ > +void > +vm_phys_free_contig(vm_page_t m, u_long npages) > +{ > + int order_start, order_end; > + vm_page_t m_start, m_end; > + > + vm_domain_free_assert_locked(vm_pagequeue_domain(m)); > + > + m_start = m; > + order_start = max_order(m_start); > + if (order_start < VM_NFREEORDER - 1) > + m_start += 1 << order_start; > + m_end = m + npages; > + order_end = max_order(m_end); > + if (order_end < VM_NFREEORDER - 1) > + m_end -= 1 << order_end; > + /* > + * Avoid unnecessary coalescing by freeing the pages at the start and > + * end of the range last. > + */ > + if (m_start < m_end) > + vm_phys_enqueue_contig(m_start, m_end - m_start); > + if (order_start < VM_NFREEORDER - 1) > + vm_phys_free_pages(m, order_start); > + if (order_end < VM_NFREEORDER - 1) > + vm_phys_free_pages(m_end, order_end); > } > > /* > > Modified: head/sys/vm/vm_phys.h > ============================================================================== > --- head/sys/vm/vm_phys.h Fri May 31 20:36:32 2019 (r348483) > +++ head/sys/vm/vm_phys.h Fri May 31 21:02:42 2019 (r348484) > @@ -84,6 +84,7 @@ vm_page_t vm_phys_alloc_freelist_pages(int domain, int > int vm_phys_alloc_npages(int domain, int pool, int npages, vm_page_t ma[]); > vm_page_t vm_phys_alloc_pages(int domain, int pool, int order); > int vm_phys_domain_match(int prefer, vm_paddr_t low, vm_paddr_t high); > +void vm_phys_enqueue_contig(vm_page_t m, u_long npages); > int vm_phys_fictitious_reg_range(vm_paddr_t start, vm_paddr_t end, > vm_memattr_t memattr); > void vm_phys_fictitious_unreg_range(vm_paddr_t start, vm_paddr_t end); > > Modified: head/sys/vm/vm_reserv.c > ============================================================================== > --- head/sys/vm/vm_reserv.c Fri May 31 20:36:32 2019 (r348483) > +++ head/sys/vm/vm_reserv.c Fri May 31 21:02:42 2019 (r348484) > @@ -1066,7 +1066,7 @@ vm_reserv_break(vm_reserv_t rv) > else { > hi = NBPOPMAP * i + bitpos; > vm_domain_free_lock(VM_DOMAIN(rv->domain)); > - vm_phys_free_contig(&rv->pages[lo], hi - lo); > + vm_phys_enqueue_contig(&rv->pages[lo], hi - lo); > vm_domain_free_unlock(VM_DOMAIN(rv->domain)); > lo = hi; > } From owner-svn-src-head@freebsd.org Sat Jun 1 08:08:40 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2C30A15BEC4A; Sat, 1 Jun 2019 08:08:40 +0000 (UTC) (envelope-from agapon@gmail.com) Received: from mail-lj1-f193.google.com (mail-lj1-f193.google.com [209.85.208.193]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 64A8886809; Sat, 1 Jun 2019 08:08:39 +0000 (UTC) (envelope-from agapon@gmail.com) Received: by mail-lj1-f193.google.com with SMTP id m22so11497485ljc.3; Sat, 01 Jun 2019 01:08:39 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:openpgp:autocrypt :message-id:date:user-agent:mime-version:in-reply-to :content-language:content-transfer-encoding; bh=E6CuIwhyF3PYW4Qgv9l8FahNfn9JrXhrjAW3QSs1beo=; b=IRIYjnmg90Q9+Lz39jzBLPeP2bER3Pq3oopU94ash6OFKREkMv+ibF2hseduiIPLkt EI+rcOoyhwtO+HvGXq+AnyYX8hJe2x8ViWrvdCFUxz7pWDWoY6F2rNGPNnYVzHBt462d 6elo+qExHBWrWo0THlR4EIFFX9+UWs5W6/0vPDEfeDM4LnGJsp7N+x9X2sLaP0eqzEQk AiyDTyz65W9AG+bfqV12HepCBHUMltzqxRYF5pH4XmRi0rY38r/kbYPc1WKyt0Sk91eK iF69rMDYj9mMYPdmZOh2yhAusSzpNylOaEGAlflYhuPNrd2tyHFfX6FRi1RK87toSUrY SLqw== X-Gm-Message-State: APjAAAWslQCwZVj+Zym3PDzszSVkz+WeAnV5Ph1e+rOzKQAh3TFhhleK wdSSnQ22uY93l1Q3Jly287V+ZafJCYU= X-Google-Smtp-Source: APXvYqx6/+03L41qNW985HLKREROx9nWNjBUctF21f+InzCq0cXFtlBVFbtXpNWbajVV/m3Tsgd/vg== X-Received: by 2002:a2e:8902:: with SMTP id d2mr8380537lji.94.1559376133946; Sat, 01 Jun 2019 01:02:13 -0700 (PDT) Received: from [192.168.0.88] (east.meadow.volia.net. [93.72.151.96]) by smtp.googlemail.com with ESMTPSA id r14sm1701984lff.44.2019.06.01.01.02.11 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 01 Jun 2019 01:02:12 -0700 (PDT) Subject: Re: svn commit: r344648 - in head: . sys/kern sys/sys To: Warner Losh , Kevin Bowling Cc: "Rodney W. Grimes" , Alexey Dokuchaev , Brooks Davis , svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers , Mateusz Guzik References: <201905312217.x4VMH3YH031668@gndrsh.dnsmgr.net> From: Andriy Gapon Openpgp: preference=signencrypt Autocrypt: addr=avg@FreeBSD.org; prefer-encrypt=mutual; keydata= xsFNBFm4LIgBEADNB/3lT7f15UKeQ52xCFQx/GqHkSxEdVyLFZTmY3KyNPQGBtyvVyBfprJ7 mAeXZWfhat6cKNRAGZcL5EmewdQuUfQfBdYmKjbw3a9GFDsDNuhDA2QwFt8BmkiVMRYyvI7l N0eVzszWCUgdc3qqM6qqcgBaqsVmJluwpvwp4ZBXmch5BgDDDb1MPO8AZ2QZfIQmplkj8Y6Z AiNMknkmgaekIINSJX8IzRzKD5WwMsin70psE8dpL/iBsA2cpJGzWMObVTtCxeDKlBCNqM1i gTXta1ukdUT7JgLEFZk9ceYQQMJJtUwzWu1UHfZn0Fs29HTqawfWPSZVbulbrnu5q55R4PlQ /xURkWQUTyDpqUvb4JK371zhepXiXDwrrpnyyZABm3SFLkk2bHlheeKU6Yql4pcmSVym1AS4 dV8y0oHAfdlSCF6tpOPf2+K9nW1CFA8b/tw4oJBTtfZ1kxXOMdyZU5fiG7xb1qDgpQKgHUX8 7Rd2T1UVLVeuhYlXNw2F+a2ucY+cMoqz3LtpksUiBppJhw099gEXehcN2JbUZ2TueJdt1FdS ztnZmsHUXLxrRBtGwqnFL7GSd6snpGIKuuL305iaOGODbb9c7ne1JqBbkw1wh8ci6vvwGlzx rexzimRaBzJxlkjNfMx8WpCvYebGMydNoeEtkWldtjTNVsUAtQARAQABzR5BbmRyaXkgR2Fw b24gPGF2Z0BGcmVlQlNELm9yZz7CwZQEEwEIAD4WIQS+LEO7ngQnXA4Bjr538m7TUc1yjwUC WbgsiAIbIwUJBaOagAULCQgHAgYVCAkKCwIEFgIDAQIeAQIXgAAKCRB38m7TUc1yj+JAEACV l9AK/nOWAt/9cufV2fRj0hdOqB1aCshtSrwHk/exXsDa4/FkmegxXQGY+3GWX3deIyesbVRL rYdtdK0dqJyT1SBqXK1h3/at9rxr9GQA6KWOxTjUFURsU7ok/6SIlm8uLRPNKO+yq0GDjgaO LzN+xykuBA0FlhQAXJnpZLcVfPJdWv7sSHGedL5ln8P8rxR+XnmsA5TUaaPcbhTB+mG+iKFj GghASDSfGqLWFPBlX/fpXikBDZ1gvOr8nyMY9nXhgfXpq3B6QCRYKPy58ChrZ5weeJZ29b7/ QdEO8NFNWHjSD9meiLdWQaqo9Y7uUxN3wySc/YUZxtS0bhAd8zJdNPsJYG8sXgKjeBQMVGuT eCAJFEYJqbwWvIXMfVWop4+O4xB+z2YE3jAbG/9tB/GSnQdVSj3G8MS80iLS58frnt+RSEw/ psahrfh0dh6SFHttE049xYiC+cM8J27Aaf0i9RflyITq57NuJm+AHJoU9SQUkIF0nc6lfA+o JRiyRlHZHKoRQkIg4aiKaZSWjQYRl5Txl0IZUP1dSWMX4s3XTMurC/pnja45dge/4ESOtJ9R 8XuIWg45Oq6MeIWdjKddGhRj3OohsltKgkEU3eLKYtB6qRTQypHHUawCXz88uYt5e3w4V16H lCpSTZV/EVHnNe45FVBlvK7k7HFfDDkryM7BTQRZuCyIARAAlq0slcsVboY/+IUJdcbEiJRW be9HKVz4SUchq0z9MZPX/0dcnvz/gkyYA+OuM78dNS7Mbby5dTvOqfpLJfCuhaNYOhlE0wY+ 1T6Tf1f4c/uA3U/YiadukQ3+6TJuYGAdRZD5EqYFIkreARTVWg87N9g0fT9BEqLw9lJtEGDY EWUE7L++B8o4uu3LQFEYxcrb4K/WKmgtmFcm77s0IKDrfcX4doV92QTIpLiRxcOmCC/OCYuO jB1oaaqXQzZrCutXRK0L5XN1Y1PYjIrEzHMIXmCDlLYnpFkK+itlXwlE2ZQxkfMruCWdQXye syl2fynAe8hvp7Mms9qU2r2K9EcJiR5N1t1C2/kTKNUhcRv7Yd/vwusK7BqJbhlng5ZgRx0m WxdntU/JLEntz3QBsBsWM9Y9wf2V4tLv6/DuDBta781RsCB/UrU2zNuOEkSixlUiHxw1dccI 6CVlaWkkJBxmHX22GdDFrcjvwMNIbbyfQLuBq6IOh8nvu9vuItup7qemDG3Ms6TVwA7BD3j+ 3fGprtyW8Fd/RR2bW2+LWkMrqHffAr6Y6V3h5kd2G9Q8ZWpEJk+LG6Mk3fhZhmCnHhDu6CwN MeUvxXDVO+fqc3JjFm5OxhmfVeJKrbCEUJyM8ESWLoNHLqjywdZga4Q7P12g8DUQ1mRxYg/L HgZY3zfKOqcAEQEAAcLBfAQYAQgAJhYhBL4sQ7ueBCdcDgGOvnfybtNRzXKPBQJZuCyIAhsM BQkFo5qAAAoJEHfybtNRzXKPBVwQAKfFy9P7N3OsLDMB56A4Kf+ZT+d5cIx0Yiaf4n6w7m3i ImHHHk9FIetI4Xe54a2IXh4Bq5UkAGY0667eIs+Z1Ea6I2i27Sdo7DxGwq09Qnm/Y65ADvXs 3aBvokCcm7FsM1wky395m8xUos1681oV5oxgqeRI8/76qy0hD9WR65UW+HQgZRIcIjSel9vR XDaD2HLGPTTGr7u4v00UeTMs6qvPsa2PJagogrKY8RXdFtXvweQFz78NbXhluwix2Tb9ETPk LIpDrtzV73CaE2aqBG/KrboXT2C67BgFtnk7T7Y7iKq4/XvEdDWscz2wws91BOXuMMd4c/c4 OmGW9m3RBLufFrOag1q5yUS9QbFfyqL6dftJP3Zq/xe+mr7sbWbhPVCQFrH3r26mpmy841ym dwQnNcsbIGiBASBSKksOvIDYKa2Wy8htPmWFTEOPRpFXdGQ27awcjjnB42nngyCK5ukZDHi6 w0qK5DNQQCkiweevCIC6wc3p67jl1EMFY5+z+zdTPb3h7LeVnGqW0qBQl99vVFgzLxchKcl0 R/paSFgwqXCZhAKMuUHncJuynDOP7z5LirUeFI8qsBAJi1rXpQoLJTVcW72swZ42IdPiboqx NbTMiNOiE36GqMcTPfKylCbF45JNX4nF9ElM0E+Y8gi4cizJYBRr2FBJgay0b9Cp Message-ID: Date: Sat, 1 Jun 2019 11:02:11 +0300 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:52.0) Gecko/20100101 Thunderbird/52.7.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 64A8886809 X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.74 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.74)[-0.737,0]; REPLY(-4.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 01 Jun 2019 08:08:40 -0000 On 01/06/2019 03:46, Warner Losh wrote: > When we move to git, stuff like this just won't matter. So it's hard to get > worked up about it now... and even if we weren't heading that way, the history > preserved is so small as to say more than "meh" here. There is too little ROI to > get worked up about. Still, even a token reply would have been nice. Much better than starting to ignore *everything* that a fellow developer writes. "Yeah, looks like I screwed up. But fixing it is more work than it's worth. Sorry about that. Thanks." > On Fri, May 31, 2019, 4:56 PM Kevin Bowling > wrote: > > The vast majority of contributors don't enjoy nit-picking on these > trivialities. If the broader developer community is not rallying for > the revert and some core conspiracy doesn't care about it either, that > forms the de facto opinion of the FreeBSD community of today that this > is trivial and irrelevant. > > Yes, there is vocal absolutism on the fringes about SHALLS and MUSTS > about all sorts of things aside from modernizing FreeBSD and making it > viable on current generation hardware.  These parties might be happier > and better aligned with OpenBSD ideologically as well as > personalities. > > Regards, > Kevin > > On Fri, May 31, 2019 at 3:17 PM Rodney W. Grimes > > wrote: > > > > > I know of several people that have blocked your mail.  Maybe a moment > > > for reflection on your attitude and approach if you want to be taken > > > seriously. > > > > I would consider repository damange and abuse to be VERY serious. > > I would also consider the treatmeant I am seeing of danfe boarder > > line on contempt. > > But then I also know there are probably some that have blocked me. > > The project, sadly is spiraling around a toilet, and someone is about to > flush.... > > > > It is not what you hear, it is what you are not hearing that makes me say > these things... > > And espcially what core seams to not be willing to hear, and is literly (I > can proove this) > > paying lip service to "solicited feedback". > > > > I asked about some of my solicited feedback, and a core member said he > > could not find it in his inbox and that I needed to locate and provide > > him a pointer to it.  THAT my friends is not solicited feedback, that is > > /dev/null of feedback and just plain out right unexcusable. > > > > And note above all else the "product" of the FreeBSD project is NOT > > releases, it IS the repository, and if we get sloppy with that product > > it makes life harder for our consumers.  If you have ever tried to > > find the history of a deleted object (which is what the process being > > complained about here creaetes) it is a royal PITA. > > > > Regards, > > Rod > > > > > On Fri, May 31, 2019 at 8:50 AM Alexey Dokuchaev > wrote: > > > > > > > > On Fri, May 31, 2019 at 03:20:50PM +0000, Brooks Davis wrote: > > > > > On Fri, May 24, 2019 at 09:11:36AM +0000, Alexey Dokuchaev wrote: > > > > > > On Sun, Mar 10, 2019 at 03:11:40PM +0000, Alexey Dokuchaev wrote: > > > > > > > On Thu, Feb 28, 2019 at 07:47:51AM +0000, Alexey Dokuchaev wrote: > > > > > > > > On Wed, Feb 27, 2019 at 10:56:55PM +0000, Mateusz Guzik wrote: > > > > > > > > > New Revision: 344648 > > > > > > > > > URL: https://svnweb.freebsd.org/changeset/base/344648 > > > > > > > > > > > > > > > > > > Log: > > > > > > > > >   Rename seq to seqc to avoid namespace clashes with Linux > > > > > > > > > > > > > > > > > > ... > > > > > > > > > Added: > > > > > > > > >   head/sys/sys/seqc.h   (contents, props changed) > > > > > > > > > Deleted: > > > > > > > > >   head/sys/sys/seq.h > > > > > > > > > > > > > > > > Why it was deleted and added as new file instead of being > repocopied? > > > > > > > > > > > > > > Retransmit. > > > > > > > > > > > > Ping! > > > > > > > > > > Do you have nothing better to do? > > > > > > > > Oh, I have a lot on my plate, thanks for asking.  Now, back to the > subject: > > > > > > > > - I think that this commit was executed badly (not via repocopy) > > > > - I've been trying to contact mjg@ for several weeks, to no avail :( > > > > - All I get in return is an email from a fellow committer asking me > > > >   if I have anything better to do > > > > > > > > Sorry, I don't understand this.  I don't understand why we ignore email > > > > from our own community.  I don't understand why we do not correct or at > > > > least explain why what looks like a mistake is actually not(?).  I don't > > > > understand why I'm being ridiculed, not those who make dubious commits > > > > and fail to defend them. > > > > > > > > ./danfe > > > > _______________________________________________ > > > > 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 > " > > > > > > > > > > -- > > Rod Grimes                                                >  rgrimes@freebsd.org > -- Andriy Gapon From owner-svn-src-head@freebsd.org Sat Jun 1 14:39:14 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E0B4E15BEB9F; Sat, 1 Jun 2019 14:39:13 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 8069E6BC55; Sat, 1 Jun 2019 14:39:13 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 5B10C191CB; Sat, 1 Jun 2019 14:39:13 +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 x51EdDh2026290; Sat, 1 Jun 2019 14:39:13 GMT (envelope-from bz@FreeBSD.org) Received: (from bz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x51EdDeC026289; Sat, 1 Jun 2019 14:39:13 GMT (envelope-from bz@FreeBSD.org) Message-Id: <201906011439.x51EdDeC026289@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bz set sender to bz@FreeBSD.org using -f From: "Bjoern A. Zeeb" Date: Sat, 1 Jun 2019 14:39:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r348493 - head/sys/dev/sdhci X-SVN-Group: head X-SVN-Commit-Author: bz X-SVN-Commit-Paths: head/sys/dev/sdhci X-SVN-Commit-Revision: 348493 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 8069E6BC55 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.94 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.94)[-0.940,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 01 Jun 2019 14:39:14 -0000 Author: bz Date: Sat Jun 1 14:39:12 2019 New Revision: 348493 URL: https://svnweb.freebsd.org/changeset/base/348493 Log: Improve error/debug messages in sdhci.c When starting a command also print the opcode and flags. More consitently print flags as hex. Use slot_printf rather than printf in one case. MFC after: 6 weeks Reviewed by: marius, kibab, imp Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D19748 Modified: head/sys/dev/sdhci/sdhci.c Modified: head/sys/dev/sdhci/sdhci.c ============================================================================== --- head/sys/dev/sdhci/sdhci.c Sat Jun 1 13:22:56 2019 (r348492) +++ head/sys/dev/sdhci/sdhci.c Sat Jun 1 14:39:12 2019 (r348493) @@ -1762,7 +1762,9 @@ sdhci_start_command(struct sdhci_slot *slot, struct mm /* Set data transfer mode. */ sdhci_set_transfer_mode(slot, cmd->data); if (__predict_false(sdhci_debug > 1)) - slot_printf(slot, "Starting command!\n"); + slot_printf(slot, "Starting command opcode %#04x flags %#04x\n", + cmd->opcode, flags); + /* Start command. */ WR2(slot, SDHCI_COMMAND_FLAGS, (cmd->opcode << 8) | (flags & 0xff)); /* Start timeout callout. */ @@ -1778,7 +1780,7 @@ sdhci_finish_command(struct sdhci_slot *slot) uint8_t extra; if (__predict_false(sdhci_debug > 1)) - slot_printf(slot, "%s: called, err %d flags %d\n", + slot_printf(slot, "%s: called, err %d flags %#04x\n", __func__, slot->curcmd->error, slot->curcmd->flags); slot->cmd_done = 1; /* @@ -1819,7 +1821,7 @@ sdhci_finish_command(struct sdhci_slot *slot) slot->curcmd->resp[0] = RD4(slot, SDHCI_RESPONSE); } if (__predict_false(sdhci_debug > 1)) - printf("Resp: %02x %02x %02x %02x\n", + slot_printf(slot, "Resp: %#04x %#04x %#04x %#04x\n", slot->curcmd->resp[0], slot->curcmd->resp[1], slot->curcmd->resp[2], slot->curcmd->resp[3]); From owner-svn-src-head@freebsd.org Sat Jun 1 14:57:43 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9EEE015BF0DB; Sat, 1 Jun 2019 14:57:43 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 421216C5BC; Sat, 1 Jun 2019 14:57:43 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1811B19520; Sat, 1 Jun 2019 14:57:43 +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 x51EvgJI036753; Sat, 1 Jun 2019 14:57:42 GMT (envelope-from bz@FreeBSD.org) Received: (from bz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x51Evgc9036752; Sat, 1 Jun 2019 14:57:42 GMT (envelope-from bz@FreeBSD.org) Message-Id: <201906011457.x51Evgc9036752@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bz set sender to bz@FreeBSD.org using -f From: "Bjoern A. Zeeb" Date: Sat, 1 Jun 2019 14:57:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r348494 - head/sys/netinet X-SVN-Group: head X-SVN-Commit-Author: bz X-SVN-Commit-Paths: head/sys/netinet X-SVN-Commit-Revision: 348494 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 421216C5BC X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.98)[-0.975,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 01 Jun 2019 14:57:44 -0000 Author: bz Date: Sat Jun 1 14:57:42 2019 New Revision: 348494 URL: https://svnweb.freebsd.org/changeset/base/348494 Log: After parts of the locking fixes in r346595, syzkaller found another one in udp_output(). This one is a race condition. We do check on the laddr and lport without holding a lock in order to determine whether we want a read or a write lock (this is in the "sendto/sendmsg" cases where addr (sin) is given). Instrumenting the kernel showed that after taking the lock, we had bound to a local port from a parallel thread on the same socket. If we find that case, unlock, and retry again. Taking the write lock would not be a problem in first place (apart from killing some parallelism). However the retry is needed as later on based on similar condition checks we do acquire the pcbinfo lock and if the conditions have changed, we might find ourselves with a lock inconsistency, hence at the end of the function when trying to unlock, hitting the KASSERT. Reported by: syzbot+bdf4caa36f3ceeac198f@syzkaller.appspotmail.com Reviewed by: markj MFC after: 6 weeks Event: Waterloo Hackathon 2019 Modified: head/sys/netinet/udp_usrreq.c Modified: head/sys/netinet/udp_usrreq.c ============================================================================== --- head/sys/netinet/udp_usrreq.c Sat Jun 1 14:39:12 2019 (r348493) +++ head/sys/netinet/udp_usrreq.c Sat Jun 1 14:57:42 2019 (r348494) @@ -1156,9 +1156,23 @@ udp_output(struct inpcb *inp, struct mbuf *m, struct s src.sin_family = 0; sin = (struct sockaddr_in *)addr; +retry: if (sin == NULL || (inp->inp_laddr.s_addr == INADDR_ANY && inp->inp_lport == 0)) { INP_WLOCK(inp); + /* + * In case we lost a race and another thread bound addr/port + * on the inp we cannot keep the wlock (which still would be + * fine) as further down, based on these values we make + * decisions for the pcbinfo lock. If the locks are not in + * synch the assertions on unlock will fire, hence we go for + * one retry loop. + */ + if (sin != NULL && (inp->inp_laddr.s_addr != INADDR_ANY || + inp->inp_lport != 0)) { + INP_WUNLOCK(inp); + goto retry; + } unlock_inp = UH_WLOCKED; } else { INP_RLOCK(inp); From owner-svn-src-head@freebsd.org Sat Jun 1 15:01:48 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A916F15BF344; Sat, 1 Jun 2019 15:01:48 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from smtp.freebsd.org (smtp.freebsd.org [96.47.72.83]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49CF96C847; Sat, 1 Jun 2019 15:01:48 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from mx1.sbone.de (mx1.sbone.de [IPv6:2a01:4f8:13b:39f::9f:25]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mx1.sbone.de", Issuer "SBone.DE" (not verified)) (Authenticated sender: bz/mail) by smtp.freebsd.org (Postfix) with ESMTPSA id 0D8A31EC01; Sat, 1 Jun 2019 15:01:48 +0000 (UTC) (envelope-from bz@FreeBSD.org) 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 E9A938D4A142; Sat, 1 Jun 2019 15:01:45 +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 0100CE707D4; Sat, 1 Jun 2019 15:01:44 +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 WL1-jqwoMKas; Sat, 1 Jun 2019 15:01:43 +0000 (UTC) Received: from [192.168.2.110] (unknown [IPv6:fde9:577b:c1a9:31: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 5D934E707C2; Sat, 1 Jun 2019 15:01:43 +0000 (UTC) From: "Bjoern A. Zeeb" To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r348494 - head/sys/netinet Date: Sat, 01 Jun 2019 15:01:42 +0000 X-Mailer: MailMate (2.0BETAr6137) Message-ID: <8F8F89D8-62A1-4EEA-9457-F511AF67D893@FreeBSD.org> In-Reply-To: <201906011457.x51Evgc9036752@repo.freebsd.org> References: <201906011457.x51Evgc9036752@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain X-Rspamd-Queue-Id: 49CF96C847 X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.99 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.99)[-0.988,0]; REPLY(-4.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 01 Jun 2019 15:01:48 -0000 On 1 Jun 2019, at 14:57, Bjoern A. Zeeb wrote: > Author: bz > Date: Sat Jun 1 14:57:42 2019 > New Revision: 348494 > URL: https://svnweb.freebsd.org/changeset/base/348494 > > Log: > After parts of the locking fixes in r346595, syzkaller found > another one in udp_output(). This one is a race condition. > We do check on the laddr and lport without holding a lock in > order to determine whether we want a read or a write lock > (this is in the "sendto/sendmsg" cases where addr (sin) is given). > > Instrumenting the kernel showed that after taking the lock, we > had bound to a local port from a parallel thread on the same socket. > > If we find that case, unlock, and retry again. Taking the write > lock would not be a problem in first place (apart from killing some > parallelism). However the retry is needed as later on based on > similar condition checks we do acquire the pcbinfo lock and if the > conditions have changed, we might find ourselves with a lock > inconsistency, hence at the end of the function when trying to > unlock, hitting the KASSERT. > > Reported by: syzbot+bdf4caa36f3ceeac198f@syzkaller.appspotmail.com > Reviewed by: markj > MFC after: 6 weeks > Event: Waterloo Hackathon 2019 Differential Revision: https://reviews.freebsd.org/D20338 From owner-svn-src-head@freebsd.org Sat Jun 1 15:19:48 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 195C115BF975 for ; Sat, 1 Jun 2019 15:19:48 +0000 (UTC) (envelope-from ian@freebsd.org) Received: from outbound2m.ore.mailhop.org (outbound2m.ore.mailhop.org [54.149.155.156]) (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 7EC3A6CFBF for ; Sat, 1 Jun 2019 15:19:47 +0000 (UTC) (envelope-from ian@freebsd.org) ARC-Seal: i=1; a=rsa-sha256; t=1559402380; cv=none; d=outbound.mailhop.org; s=arc-outbound20181012; b=LLLiZNirXNeG+rD0EIYRAsjObe3iYPfKz23+H0eQWY2M7bvosJfe2EK578sxhyeveD+/p5SMUxPJl Il5ixaJyW5d+i0WbisoAwRyJKY14R2B/RXlMn3ANLq6bbg4R5iW2IZ9JpV7kQfuRFzUyzWqqtH0jvF OhMvIFgkMkK3CfbcYiOrONShOCNv6kk3MUTiTCucY32kq+BepTKGK2RkeNoek7SJuKNXMuR34WC2K4 6zxxt4qU7pVzEmS8Isn+ag0/WRi0A0ukMPUzeHgx+w3N0YGle/PZ6wFO9k7OC3ulOuhd25Mxp9Ebcv E0PgNlQ/S9rqx7F1vspVOGr9Fcey/pQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=outbound.mailhop.org; s=arc-outbound20181012; h=content-transfer-encoding:mime-version:content-type:references:in-reply-to: date:cc:to:from:subject:message-id:dkim-signature:from; bh=R+q8CXnuJX5ioOy04WqAl3v+SGdMSJp+/1hj8TW4JoQ=; b=CnwQCI/Opt2yc06w3vbM4YwLADTIwnLYBzg6lqGE3IG6F9X+7ivi3QSNt7bdioNCMxPedvAQsUC5i eH6KzqqQ8R0rxxicvHJ1x0JWAORYBg6kZrysizqlWL9+z720vMTFXx/RRFeQRVAMdwnBRnmjqhaHWp 0BllXyAnanHaZ/vqzDIAe/uYNe1cUaUtGYHeYdsEpzmCOUmI8nGgJivvblUlgmc0WCtHkrZQpRb6WX S68+Da4NDmoTXIWtYTNDcj8OkrZfzIDxnwIZT09/LblKxdFNIbl3Lo/CZxqV7jo7gJKN+azXGic5y6 78sjbWR4kJr9f1He+CxCXYj6oh4oWhg== ARC-Authentication-Results: i=1; outbound4.ore.mailhop.org; spf=softfail smtp.mailfrom=freebsd.org smtp.remote-ip=67.177.211.60; dmarc=none header.from=freebsd.org; arc=none header.oldest-pass=0; DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=outbound.mailhop.org; s=dkim-high; h=content-transfer-encoding:mime-version:content-type:references:in-reply-to: date:cc:to:from:subject:message-id:from; bh=R+q8CXnuJX5ioOy04WqAl3v+SGdMSJp+/1hj8TW4JoQ=; b=Ag7wEb/ePcebznDvWdKlac5HBlKKQc66WDsJhPynG0ln3dL9g1+dtuOVE9tMBbdhgtVQ/hf+5yBAJ IHefcl23ZmLidO8jSQIfKJQM6eHZ3J3mr8MDhbxTLqZY0mW7oD4cWVL8nJgqAQE0yllKCHQO0Oqi+a XZ7xPe3H+9wvX76UEredOQsRfRu++M9/FBpAi+7ToY+v+/msOXplJ1mfBDfCEU3gD6BnzRt2lekuOu VmqN3GAv+oS7h9X3lQSncvCeF8lAyJ+bYNuxt0O8ZNxq8Y5xtSR8DfkAUYLM7MqsEgrBWZJJmIuDNq qhVamUzqR6uuGCFxlXcLCTYsROkQenw== X-MHO-RoutePath: aGlwcGll X-MHO-User: ab4f98fc-8480-11e9-b399-9d2c53d3dedb X-Report-Abuse-To: https://support.duocircle.com/support/solutions/articles/5000540958-duocircle-standard-smtp-abuse-information X-Originating-IP: 67.177.211.60 X-Mail-Handler: DuoCircle Outbound SMTP Received: from ilsoft.org (unknown [67.177.211.60]) by outbound4.ore.mailhop.org (Halon) with ESMTPSA id ab4f98fc-8480-11e9-b399-9d2c53d3dedb; Sat, 01 Jun 2019 15:19:38 +0000 (UTC) Received: from rev (rev [172.22.42.240]) by ilsoft.org (8.15.2/8.15.2) with ESMTP id x51FJbmk047919; Sat, 1 Jun 2019 09:19:37 -0600 (MDT) (envelope-from ian@freebsd.org) Message-ID: Subject: Re: svn commit: r344648 - in head: . sys/kern sys/sys From: Ian Lepore To: Andriy Gapon Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers Date: Sat, 01 Jun 2019 09:19:37 -0600 In-Reply-To: References: <201905312217.x4VMH3YH031668@gndrsh.dnsmgr.net> Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.28.5 FreeBSD GNOME Team Mime-Version: 1.0 Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: 7EC3A6CFBF X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-7.00 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-1.00)[-0.995,0]; REPLY(-4.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 01 Jun 2019 15:19:48 -0000 On Sat, 2019-06-01 at 11:02 +0300, Andriy Gapon wrote: > On 01/06/2019 03:46, Warner Losh wrote: > > When we move to git, stuff like this just won't matter. So it's > > hard to get > > worked up about it now... and even if we weren't heading that way, > > the history > > preserved is so small as to say more than "meh" here. There is too > > little ROI to > > get worked up about. > > Still, even a token reply would have been nice. Much better than > starting to > ignore *everything* that a fellow developer writes. > "Yeah, looks like I screwed up. But fixing it is more work than it's > worth. > Sorry about that. Thanks." > The point is, a few people in the project have proven themselves to be noise generators with annoying whinging and nagging about tiny insigificant issues. That earns them a mail rule that simply discards all incoming mail from them. So, unsurprisingly: no reply. There are 3 project memembers I've written such rules for, although two of those rules are currently disabled (but I didn't delete them because I have a feeling I'm going to use them again some day). -- Ian > > On Fri, May 31, 2019, 4:56 PM Kevin Bowling < > > kevin.bowling@kev009.com > > > wrote: > > > > The vast majority of contributors don't enjoy nit-picking on > > these > > trivialities. If the broader developer community is not > > rallying for > > the revert and some core conspiracy doesn't care about it > > either, that > > forms the de facto opinion of the FreeBSD community of today > > that this > > is trivial and irrelevant. > > > > Yes, there is vocal absolutism on the fringes about SHALLS and > > MUSTS > > about all sorts of things aside from modernizing FreeBSD and > > making it > > viable on current generation hardware. These parties might be > > happier > > and better aligned with OpenBSD ideologically as well as > > personalities. > > > > Regards, > > Kevin > > > > On Fri, May 31, 2019 at 3:17 PM Rodney W. Grimes > > > > > wrote: > > > > > > > I know of several people that have blocked your mail. > > Maybe a moment > > > > for reflection on your attitude and approach if you want to > > be taken > > > > seriously. > > > > > > I would consider repository damange and abuse to be VERY > > serious. > > > I would also consider the treatmeant I am seeing of danfe > > boarder > > > line on contempt. > > > But then I also know there are probably some that have > > blocked me. > > > The project, sadly is spiraling around a toilet, and someone > > is about to > > flush.... > > > > > > It is not what you hear, it is what you are not hearing that > > makes me say > > these things... > > > And espcially what core seams to not be willing to hear, and > > is literly (I > > can proove this) > > > paying lip service to "solicited feedback". > > > > > > I asked about some of my solicited feedback, and a core > > member said he > > > could not find it in his inbox and that I needed to locate > > and provide > > > him a pointer to it. THAT my friends is not solicited > > feedback, that is > > > /dev/null of feedback and just plain out right unexcusable. > > > > > > And note above all else the "product" of the FreeBSD project > > is NOT > > > releases, it IS the repository, and if we get sloppy with > > that product > > > it makes life harder for our consumers. If you have ever > > tried to > > > find the history of a deleted object (which is what the > > process being > > > complained about here creaetes) it is a royal PITA. > > > > > > Regards, > > > Rod > > > > > > > On Fri, May 31, 2019 at 8:50 AM Alexey Dokuchaev < > > danfe@freebsd.org > > > wrote: > > > > > > > > > > On Fri, May 31, 2019 at 03:20:50PM +0000, Brooks Davis > > wrote: > > > > > > On Fri, May 24, 2019 at 09:11:36AM +0000, Alexey > > Dokuchaev wrote: > > > > > > > On Sun, Mar 10, 2019 at 03:11:40PM +0000, Alexey > > Dokuchaev wrote: > > > > > > > > On Thu, Feb 28, 2019 at 07:47:51AM +0000, Alexey > > Dokuchaev wrote: > > > > > > > > > On Wed, Feb 27, 2019 at 10:56:55PM +0000, Mateusz > > Guzik wrote: > > > > > > > > > > New Revision: 344648 > > > > > > > > > > URL: > > https://svnweb.freebsd.org/changeset/base/344648 > > > > > > > > > > > > > > > > > > > > Log: > > > > > > > > > > Rename seq to seqc to avoid namespace clashes > > with Linux > > > > > > > > > > > > > > > > > > > > ... > > > > > > > > > > Added: > > > > > > > > > > head/sys/sys/seqc.h (contents, props > > changed) > > > > > > > > > > Deleted: > > > > > > > > > > head/sys/sys/seq.h > > > > > > > > > > > > > > > > > > Why it was deleted and added as new file instead > > of being > > repocopied? > > > > > > > > > > > > > > > > Retransmit. > > > > > > > > > > > > > > Ping! > > > > > > > > > > > > Do you have nothing better to do? > > > > > > > > > > Oh, I have a lot on my plate, thanks for asking. Now, > > back to the > > subject: > > > > > > > > > > - I think that this commit was executed badly (not via > > repocopy) > > > > > - I've been trying to contact mjg@ for several weeks, to > > no avail :( > > > > > - All I get in return is an email from a fellow committer > > asking me > > > > > if I have anything better to do > > > > > > > > > > Sorry, I don't understand this. I don't understand why > > we ignore email > > > > > from our own community. I don't understand why we do not > > correct or at > > > > > least explain why what looks like a mistake is actually > > not(?). I don't > > > > > understand why I'm being ridiculed, not those who make > > dubious commits > > > > > and fail to defend them. > > > > > > > > > > ./danfe > > > > > _______________________________________________ > > > > > 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 > > " > > > > > > > > > > > > > > -- > > > Rod Grimes > > rgrimes@freebsd.org > > > > From owner-svn-src-head@freebsd.org Sat Jun 1 15:37:45 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 43BBD15BFE5F; Sat, 1 Jun 2019 15:37:45 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id DE3196D711; Sat, 1 Jun 2019 15:37:44 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B6FC319BE2; Sat, 1 Jun 2019 15:37:44 +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 x51FbidL057584; Sat, 1 Jun 2019 15:37:44 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x51FbixC057583; Sat, 1 Jun 2019 15:37:44 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201906011537.x51FbixC057583@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Sat, 1 Jun 2019 15:37:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r348495 - head/sys/dev/nvme X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head/sys/dev/nvme X-SVN-Commit-Revision: 348495 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: DE3196D711 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.98 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.98)[-0.976,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 01 Jun 2019 15:37:45 -0000 Author: imp Date: Sat Jun 1 15:37:44 2019 New Revision: 348495 URL: https://svnweb.freebsd.org/changeset/base/348495 Log: Since a fatal trap can happen at aribtrary times, don't panic when the completions are not in a consistent state. Cope with the different places the normal I/O completion polling thread can be interrupted and then re-entered during a kernel panic + dump. Reviewed by: jhb and markj (both prior versions) Differential Revision: https://reviews.freebsd.org/D20478 Modified: head/sys/dev/nvme/nvme_qpair.c Modified: head/sys/dev/nvme/nvme_qpair.c ============================================================================== --- head/sys/dev/nvme/nvme_qpair.c Sat Jun 1 14:57:42 2019 (r348494) +++ head/sys/dev/nvme/nvme_qpair.c Sat Jun 1 15:37:44 2019 (r348495) @@ -31,6 +31,8 @@ __FBSDID("$FreeBSD$"); #include #include +#include +#include #include @@ -308,7 +310,7 @@ get_status_string(uint16_t sct, uint16_t sc) } static void -nvme_qpair_print_completion(struct nvme_qpair *qpair, +nvme_qpair_print_completion(struct nvme_qpair *qpair, struct nvme_completion *cpl) { uint16_t sct, sc; @@ -479,18 +481,51 @@ nvme_qpair_process_completions(struct nvme_qpair *qpai struct nvme_tracker *tr; struct nvme_completion cpl; int done = 0; + bool in_panic = dumping || SCHEDULER_STOPPED(); qpair->num_intr_handler_calls++; + /* + * qpair is not enabled, likely because a controller reset is is in + * progress. Ignore the interrupt - any I/O that was associated with + * this interrupt will get retried when the reset is complete. + */ if (!qpair->is_enabled) - /* - * qpair is not enabled, likely because a controller reset is - * is in progress. Ignore the interrupt - any I/O that was - * associated with this interrupt will get retried when the - * reset is complete. - */ return (false); + /* + * A panic can stop the CPU this routine is running on at any point. If + * we're called during a panic, complete the sq_head wrap protocol for + * the case where we are interrupted just after the increment at 1 + * below, but before we can reset cq_head to zero at 2. Also cope with + * the case where we do the zero at 2, but may or may not have done the + * phase adjustment at step 3. The panic machinery flushes all pending + * memory writes, so we can make these strong ordering assumptions + * that would otherwise be unwise if we were racing in real time. + */ + if (__predict_false(in_panic)) { + if (qpair->cq_head == qpair->num_entries) { + /* + * Here we know that we need to zero cq_head and then negate + * the phase, which hasn't been assigned if cq_head isn't + * zero due to the atomic_store_rel. + */ + qpair->cq_head = 0; + qpair->phase = !qpair->phase; + } else if (qpair->cq_head == 0) { + /* + * In this case, we know that the assignment at 2 + * happened below, but we don't know if it 3 happened or + * not. To do this, we look at the last completion + * entry and set the phase to the opposite phase + * that it has. This gets us back in sync + */ + cpl = qpair->cpl[qpair->num_entries - 1]; + nvme_completion_swapbytes(&cpl); + qpair->phase = !NVME_STATUS_GET_P(cpl.status); + } + } + bus_dmamap_sync(qpair->dma_tag, qpair->queuemem_map, BUS_DMASYNC_POSTREAD | BUS_DMASYNC_POSTWRITE); while (1) { @@ -508,17 +543,35 @@ nvme_qpair_process_completions(struct nvme_qpair *qpai nvme_qpair_complete_tracker(qpair, tr, &cpl, ERROR_PRINT_ALL); qpair->sq_head = cpl.sqhd; done++; - } else { - nvme_printf(qpair->ctrlr, + } else if (!in_panic) { + /* + * A missing tracker is normally an error. However, a + * panic can stop the CPU this routine is running on + * after completing an I/O but before updating + * qpair->cq_head at 1 below. Later, we re-enter this + * routine to poll I/O associated with the kernel + * dump. We find that the tr has been set to null before + * calling the completion routine. If it hasn't + * completed (or it triggers a panic), then '1' below + * won't have updated cq_head. Rather than panic again, + * ignore this condition because it's not unexpected. + */ + nvme_printf(qpair->ctrlr, "cpl does not map to outstanding cmd\n"); /* nvme_dump_completion expects device endianess */ nvme_dump_completion(&qpair->cpl[qpair->cq_head]); - KASSERT(0, ("received completion for unknown cmd\n")); + KASSERT(0, ("received completion for unknown cmd")); } - if (++qpair->cq_head == qpair->num_entries) { - qpair->cq_head = 0; - qpair->phase = !qpair->phase; + /* + * There's a number of races with the following (see above) when + * the system panics. We compensate for each one of them by + * using the atomic store to force strong ordering (at least when + * viewed in the aftermath of a panic). + */ + if (++qpair->cq_head == qpair->num_entries) { /* 1 */ + atomic_store_rel_int(&qpair->cq_head, 0); /* 2 */ + qpair->phase = !qpair->phase; /* 3 */ } nvme_mmio_write_4(qpair->ctrlr, doorbell[qpair->id].cq_hdbl, From owner-svn-src-head@freebsd.org Sat Jun 1 16:04:22 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E392A15C059A; Sat, 1 Jun 2019 16:04:21 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 84D676E383; Sat, 1 Jun 2019 16:04:21 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 542361A10A; Sat, 1 Jun 2019 16:04:21 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x51G4Lnr073186; Sat, 1 Jun 2019 16:04:21 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x51G4KFU073183; Sat, 1 Jun 2019 16:04:20 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201906011604.x51G4KFU073183@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Sat, 1 Jun 2019 16:04:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r348496 - head/share/man/man4 X-SVN-Group: head X-SVN-Commit-Author: mav X-SVN-Commit-Paths: head/share/man/man4 X-SVN-Commit-Revision: 348496 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 84D676E383 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.98)[-0.975,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 01 Jun 2019 16:04:22 -0000 Author: mav Date: Sat Jun 1 16:04:20 2019 New Revision: 348496 URL: https://svnweb.freebsd.org/changeset/base/348496 Log: Document max_chains bump to 16384 at r330049. MFC after: 1 week Modified: head/share/man/man4/mpr.4 head/share/man/man4/mps.4 Modified: head/share/man/man4/mpr.4 ============================================================================== --- head/share/man/man4/mpr.4 Sat Jun 1 15:37:44 2019 (r348495) +++ head/share/man/man4/mpr.4 Sat Jun 1 16:04:20 2019 (r348496) @@ -38,7 +38,7 @@ .\" $Id$ .\" $FreeBSD$ .\" -.Dd May 25, 2017 +.Dd June 1, 2019 .Dt MPR 4 .Os .Sh NAME @@ -149,7 +149,7 @@ set this tunable in dev.mpr.X.max_chains=NNNN .Ed .Pp -The default max_chains value is 2048. +The default max_chains value is 16384. .Pp The current number of free chain frames is stored in the dev.mpr.X.chain_free Modified: head/share/man/man4/mps.4 ============================================================================== --- head/share/man/man4/mps.4 Sat Jun 1 15:37:44 2019 (r348495) +++ head/share/man/man4/mps.4 Sat Jun 1 16:04:20 2019 (r348496) @@ -38,7 +38,7 @@ .\" $Id: //depot/SpectraBSD/head/share/man/man4/mps.4#6 $ .\" $FreeBSD$ .\" -.Dd May 25, 2017 +.Dd June 1, 2019 .Dt MPS 4 .Os .Sh NAME @@ -143,7 +143,7 @@ set this tunable in dev.mps.X.max_chains=NNNN .Ed .Pp -The default max_chains value is 2048. +The default max_chains value is 16384. .Pp The current number of free chain frames is stored in the dev.mps.X.chain_free From owner-svn-src-head@freebsd.org Sat Jun 1 17:13:40 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 773E615C197B; Sat, 1 Jun 2019 17:13:40 +0000 (UTC) (envelope-from unkadoug@gmail.com) Received: from mail-ot1-x32e.google.com (mail-ot1-x32e.google.com [IPv6:2607:f8b0:4864:20::32e]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id E9E7F6FF78; Sat, 1 Jun 2019 17:13:39 +0000 (UTC) (envelope-from unkadoug@gmail.com) Received: by mail-ot1-x32e.google.com with SMTP id n14so12356004otk.2; Sat, 01 Jun 2019 10:13:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:subject:to:references:message-id:date:user-agent:mime-version :in-reply-to:content-transfer-encoding:content-language; bh=v++MiW0Ou+BINczohUWsWOzODPYUMNsAprVPzHHFYyA=; b=aGJ76mLycpnqshd/b5nrEm5g4B44lYEmHdIIoRlW3UgGAQuzccyHYpvnjwPhl+TP4V 6OE/g23S72j6NpMmgy5BhzPW7SSRkN14kxptdEVXdh8lRew7Ol65dgyTKhZn6faXqsXi qDrENpsIdHaG4Y3yKVmLL3NozcnvqBmC16goCYUEejoynghhuDAP6fNkEAS/gysBAU8U DZrLZ67fvDXLmvQDzYRQMyPBrv6QvkkGWYB/1VkmvpAuDO/j9xgzY7/dPmpbJj3Zh6YV kWphyk8XV6FhVQzYYtB+MFvpl3BdhgxgZfD35Gq/3Ytnpagcn7iGMo30C/7IaKRflCee KU3A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:subject:to:references:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding :content-language; bh=v++MiW0Ou+BINczohUWsWOzODPYUMNsAprVPzHHFYyA=; b=FTjyYltntNS849ky22ZFBPZYyOndjzVQLlMw8F89FkKeseZqn7hRpSevFBD8CqyCvY 7y8LEE61gSnAfbzYkbdKqwjD5K73hXZQoY/ds4V5rRQ3qmRp+HgD93jZUqvNWn6ajFPZ KPuMW9INTpV8Gv2CYSZXpup560BdueEmHZK+qw3jMK36ZGF+01rKJbgWnnYK6uwDVgXo kXCt38yHFn1UI/5G1Xnl3h2sKCgTS8m9isyDMqwBTIy4fMXclRblgF7drPzlLS5rFzS6 uTv77bftLDvn1lShI+uxGWOZ/G4sl9Kvw0B6P6ZHI3AAngvW+OBAS0AxngQGIxBaaduW t4/A== X-Gm-Message-State: APjAAAWAvxSfx61Rugk9u+CX/uf4CyQP7xalodp7mj/7/jlKLdNlKKvJ KXzY8nDyz/5zf2Qo1/YsXo/m/uNZ X-Google-Smtp-Source: APXvYqz4Ap7CWMxLNbOZfCUd4V31br9RD4horyrw3uTY4qlyvl5zRX32ESQx3UR0uMjAGW6n0s93EQ== X-Received: by 2002:a05:6830:148d:: with SMTP id s13mr6272224otq.186.1559409218848; Sat, 01 Jun 2019 10:13:38 -0700 (PDT) Received: from 108-254-203-202.lightspeed.hstntx.sbcglobal.net (108-254-203-202.lightspeed.hstntx.sbcglobal.net. [108.254.203.202]) by smtp.gmail.com with ESMTPSA id i8sm3541374oib.12.2019.06.01.10.13.37 (version=TLS1_3 cipher=AEAD-AES128-GCM-SHA256 bits=128/128); Sat, 01 Jun 2019 10:13:38 -0700 (PDT) From: Doug Moore X-Google-Original-From: Doug Moore Subject: Re: svn commit: r348484 - head/sys/vm To: koobs@FreeBSD.org, src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201905312102.x4VL2gvw071809@repo.freebsd.org> Message-ID: Date: Sat, 1 Jun 2019 12:13:36 -0500 User-Agent: Mozilla/5.0 (X11; FreeBSD i386; rv:60.0) Gecko/20100101 Thunderbird/60.2.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Content-Language: en-US X-Rspamd-Queue-Id: E9E7F6FF78 X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.97 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.97)[-0.965,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; REPLY(-4.00)[] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 01 Jun 2019 17:13:40 -0000 On 5/31/19 10:05 PM, Kubilay Kocak wrote: > On 1/06/2019 7:02 am, Doug Moore wrote: >> Author: dougm >> Date: Fri May 31 21:02:42 2019 >> New Revision: 348484 >> URL: https://svnweb.freebsd.org/changeset/base/348484 >> > Can this be an MFC candidate? If one of my mentors wants it to be, and then tells me what to do to make it happen, then yes it can.  I'll wait to see if they have anything to say about it. Doug Moore From owner-svn-src-head@freebsd.org Sat Jun 1 17:55:32 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0810E15C2471; Sat, 1 Jun 2019 17:55:32 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id EFAB770FEC; Sat, 1 Jun 2019 17:55:30 +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 x51HtNHk062130 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NO); Sat, 1 Jun 2019 20:55:26 +0300 (EEST) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua x51HtNHk062130 Received: (from kostik@localhost) by tom.home (8.15.2/8.15.2/Submit) id x51HtN8a062128; Sat, 1 Jun 2019 20:55:23 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Sat, 1 Jun 2019 20:55:22 +0300 From: Konstantin Belousov To: Doug Moore Cc: koobs@FreeBSD.org, src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r348484 - head/sys/vm Message-ID: <20190601175522.GC75280@kib.kiev.ua> References: <201905312102.x4VL2gvw071809@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: User-Agent: Mutt/1.12.0 (2019-05-25) X-Spam-Status: No, score=-1.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FORGED_GMAIL_RCVD,FREEMAIL_FROM, NML_ADSP_CUSTOM_MED autolearn=no autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on tom.home X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 01 Jun 2019 17:55:32 -0000 On Sat, Jun 01, 2019 at 12:13:36PM -0500, Doug Moore wrote: > On 5/31/19 10:05 PM, Kubilay Kocak wrote: > > > On 1/06/2019 7:02 am, Doug Moore wrote: > >> Author: dougm > >> Date: Fri May 31 21:02:42 2019 > >> New Revision: 348484 > >> URL: https://svnweb.freebsd.org/changeset/base/348484 > >> > > Can this be an MFC candidate? > > If one of my mentors wants it to be, and then tells me what to do to > make it happen, then yes it can.  I'll wait to see if they have anything > to say about it. I think that all you work definitely should be merged to 12, after a reasonable wide public testing in HEAD. Merges for 11 should be only performed when there is both no non-trivial conflict and we are confident enough that the code around the changed place is same in 11. Otherwise, for vm_map.c, it is better to not merge. This is IMO, and its scope is only vm/vm_map.c. From owner-svn-src-head@freebsd.org Sat Jun 1 18:19:17 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 378D015C294A; Sat, 1 Jun 2019 18:19:17 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id C628471921; Sat, 1 Jun 2019 18:19:16 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 9BFC91B6F3; Sat, 1 Jun 2019 18:19:16 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x51IJGri041478; Sat, 1 Jun 2019 18:19:16 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x51IJGie041477; Sat, 1 Jun 2019 18:19:16 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201906011819.x51IJGie041477@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Sat, 1 Jun 2019 18:19:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r348497 - head/sys/mips/cavium/usb X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: head/sys/mips/cavium/usb X-SVN-Commit-Revision: 348497 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: C628471921 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.96)[-0.964,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 01 Jun 2019 18:19:17 -0000 Author: emaste Date: Sat Jun 1 18:19:16 2019 New Revision: 348497 URL: https://svnweb.freebsd.org/changeset/base/348497 Log: octusb: fix detach loop over USB ports MFC after: 2 weeks Sponsored by: The FreeBSD Foundation Modified: head/sys/mips/cavium/usb/octusb_octeon.c Modified: head/sys/mips/cavium/usb/octusb_octeon.c ============================================================================== --- head/sys/mips/cavium/usb/octusb_octeon.c Sat Jun 1 16:04:20 2019 (r348496) +++ head/sys/mips/cavium/usb/octusb_octeon.c Sat Jun 1 18:19:16 2019 (r348497) @@ -179,12 +179,12 @@ octusb_octeon_detach(device_t dev) if (nports > OCTUSB_MAX_PORTS) panic("octusb: too many USB ports %d", nports); for (i = 0; i < nports; i++) { - if (sc->sc_dci.sc_irq_res[0] && sc->sc_dci.sc_intr_hdl[0]) { + if (sc->sc_dci.sc_irq_res[i] && sc->sc_dci.sc_intr_hdl[i]) { err = bus_teardown_intr(dev, sc->sc_dci.sc_irq_res[i], sc->sc_dci.sc_intr_hdl[i]); sc->sc_dci.sc_intr_hdl[i] = NULL; } - if (sc->sc_dci.sc_irq_res) { + if (sc->sc_dci.sc_irq_res[i]) { bus_release_resource(dev, SYS_RES_IRQ, 0, sc->sc_dci.sc_irq_res[i]); sc->sc_dci.sc_irq_res[i] = NULL; From owner-svn-src-head@freebsd.org Sat Jun 1 18:26:08 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7AF4B15C2B22; Sat, 1 Jun 2019 18:26:08 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id F051C71D48; Sat, 1 Jun 2019 18:26:07 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C476F1B891; Sat, 1 Jun 2019 18:26:07 +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 x51IQ723046809; Sat, 1 Jun 2019 18:26:07 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x51IQ7BR046808; Sat, 1 Jun 2019 18:26:07 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201906011826.x51IQ7BR046808@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Sat, 1 Jun 2019 18:26:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r348498 - head/lib/atf/libatf-c/tests X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: head/lib/atf/libatf-c/tests X-SVN-Commit-Revision: 348498 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: F051C71D48 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.96)[-0.964,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 01 Jun 2019 18:26:08 -0000 Author: emaste Date: Sat Jun 1 18:26:07 2019 New Revision: 348498 URL: https://svnweb.freebsd.org/changeset/base/348498 Log: libatf: remove workaround not required after atf >= 0.18 update lib/atf/libatf-c/tests/Makefile added the -Wno-duplicate-decl-specifier due to an issue with an old version of ATF. ATF has long since been updated to a version with the fix so the workaround is no longer necessary. Found during review for PR 236889. PR: 236889 MFC after: 2 weeks Sponsored by: The FreeBSD Foundation Modified: head/lib/atf/libatf-c/tests/Makefile Modified: head/lib/atf/libatf-c/tests/Makefile ============================================================================== --- head/lib/atf/libatf-c/tests/Makefile Sat Jun 1 18:19:16 2019 (r348497) +++ head/lib/atf/libatf-c/tests/Makefile Sat Jun 1 18:26:07 2019 (r348498) @@ -13,11 +13,6 @@ ATF= ${SRCTOP}/contrib/atf CFLAGS+= -DATF_INCLUDEDIR='"${INCLUDEDIR}"' CFLAGS+= -I${ATF} -# macros_test.c contains a double 'const const' which will be gone with -# the import of atf-0.18. -# TODO(jmmv): Remove this workaround once we do that update. -CFLAGS.clang+= -Wno-duplicate-decl-specifier - ${PACKAGE}FILES+= macros_h_test.c ${PACKAGE}FILES+= unused_test.c From owner-svn-src-head@freebsd.org Sat Jun 1 19:47:16 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 376F915C433C; Sat, 1 Jun 2019 19:47:16 +0000 (UTC) (envelope-from bcran@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id CDA6C748A8; Sat, 1 Jun 2019 19:47:15 +0000 (UTC) (envelope-from bcran@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id AAB601C61E; Sat, 1 Jun 2019 19:47:15 +0000 (UTC) (envelope-from bcran@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x51JlF1h089471; Sat, 1 Jun 2019 19:47:15 GMT (envelope-from bcran@FreeBSD.org) Received: (from bcran@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x51JlFQr089470; Sat, 1 Jun 2019 19:47:15 GMT (envelope-from bcran@FreeBSD.org) Message-Id: <201906011947.x51JlFQr089470@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bcran set sender to bcran@FreeBSD.org using -f From: Rebecca Cran Date: Sat, 1 Jun 2019 19:47:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r348499 - head/stand/common X-SVN-Group: head X-SVN-Commit-Author: bcran X-SVN-Commit-Paths: head/stand/common X-SVN-Commit-Revision: 348499 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: CDA6C748A8 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.96)[-0.962,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 01 Jun 2019 19:47:16 -0000 Author: bcran Date: Sat Jun 1 19:47:15 2019 New Revision: 348499 URL: https://svnweb.freebsd.org/changeset/base/348499 Log: Fix comment parsing in interp_simple.c loader.rc has comment lines without a trailing space, which get interpreted as commands. Avoid this by only matching against the backslash character. Reviewed by: imp, tsoome Differential Revision: https://reviews.freebsd.org/D20491 Modified: head/stand/common/interp_simple.c Modified: head/stand/common/interp_simple.c ============================================================================== --- head/stand/common/interp_simple.c Sat Jun 1 18:26:07 2019 (r348498) +++ head/stand/common/interp_simple.c Sat Jun 1 19:47:15 2019 (r348499) @@ -114,7 +114,7 @@ interp_include(const char *filename) line++; flags = 0; /* Discard comments */ - if (strncmp(input+strspn(input, " "), "\\ ", 2) == 0) + if (strncmp(input+strspn(input, " "), "\\", 1) == 0) continue; cp = input; /* Echo? */ From owner-svn-src-head@freebsd.org Sat Jun 1 20:08:11 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 43A3C15C4949; Sat, 1 Jun 2019 20:08:11 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id DD6A47511F; Sat, 1 Jun 2019 20:08:10 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B87751C97E; Sat, 1 Jun 2019 20:08:10 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x51K8ANL099542; Sat, 1 Jun 2019 20:08:10 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x51K8Aep099541; Sat, 1 Jun 2019 20:08:10 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201906012008.x51K8Aep099541@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Sat, 1 Jun 2019 20:08:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r348500 - head/lib/msun/tests X-SVN-Group: head X-SVN-Commit-Author: dim X-SVN-Commit-Paths: head/lib/msun/tests X-SVN-Commit-Revision: 348500 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: DD6A47511F X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.98 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.98)[-0.983,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 01 Jun 2019 20:08:11 -0000 Author: dim Date: Sat Jun 1 20:08:10 2019 New Revision: 348500 URL: https://svnweb.freebsd.org/changeset/base/348500 Log: Partially revert r271349, which disabled the msun cexp test #4 on i386. Ensure the expected result is stored first in a volatile variable with the desired type. This makes all the tests succeed. Slightly changed from the original pull request, but functionally the same. Obtained from: https://github.com/freebsd/freebsd/pull/401 Submitted by: Moritz Buhl PR: 191676 MFC after: 3 days Modified: head/lib/msun/tests/cexp_test.c Modified: head/lib/msun/tests/cexp_test.c ============================================================================== --- head/lib/msun/tests/cexp_test.c Sat Jun 1 19:47:15 2019 (r348499) +++ head/lib/msun/tests/cexp_test.c Sat Jun 1 20:08:10 2019 (r348500) @@ -59,13 +59,21 @@ __FBSDID("$FreeBSD$"); * XXX The volatile here is to avoid gcc's bogus constant folding and work * around the lack of support for the FENV_ACCESS pragma. */ -#define test(func, z, result, exceptmask, excepts, checksign) do { \ +#define test_t(type, func, z, result, exceptmask, excepts, checksign) \ +do { \ volatile long double complex _d = z; \ + volatile type complex _r = result; \ assert(feclearexcept(FE_ALL_EXCEPT) == 0); \ - assert(cfpequal_cs((func)(_d), (result), (checksign))); \ + assert(cfpequal_cs((func)(_d), (_r), (checksign))); \ assert(((void)(func), fetestexcept(exceptmask) == (excepts))); \ } while (0) +#define test(func, z, result, exceptmask, excepts, checksign) \ + test_t(double, func, z, result, exceptmask, excepts, checksign) + +#define test_f(func, z, result, exceptmask, excepts, checksign) \ + test_t(float, func, z, result, exceptmask, excepts, checksign) + /* Test within a given tolerance. */ #define test_tol(func, z, result, tol) do { \ volatile long double complex _d = z; \ @@ -76,7 +84,7 @@ __FBSDID("$FreeBSD$"); /* Test all the functions that compute cexp(x). */ #define testall(x, result, exceptmask, excepts, checksign) do { \ test(cexp, x, result, exceptmask, excepts, checksign); \ - test(cexpf, x, result, exceptmask, excepts, checksign); \ + test_f(cexpf, x, result, exceptmask, excepts, checksign); \ } while (0) /* @@ -198,10 +206,10 @@ test_reals(void) test(cexp, CMPLXL(finites[i], -0.0), CMPLXL(exp(finites[i]), -0.0), FE_INVALID | FE_DIVBYZERO, 0, 1); - test(cexpf, CMPLXL(finites[i], 0.0), + test_f(cexpf, CMPLXL(finites[i], 0.0), CMPLXL(expf(finites[i]), 0.0), FE_INVALID | FE_DIVBYZERO, 0, 1); - test(cexpf, CMPLXL(finites[i], -0.0), + test_f(cexpf, CMPLXL(finites[i], -0.0), CMPLXL(expf(finites[i]), -0.0), FE_INVALID | FE_DIVBYZERO, 0, 1); } @@ -220,10 +228,10 @@ test_imaginaries(void) test(cexp, CMPLXL(-0.0, finites[i]), CMPLXL(cos(finites[i]), sin(finites[i])), ALL_STD_EXCEPT & ~FE_INEXACT, 0, 1); - test(cexpf, CMPLXL(0.0, finites[i]), + test_f(cexpf, CMPLXL(0.0, finites[i]), CMPLXL(cosf(finites[i]), sinf(finites[i])), ALL_STD_EXCEPT & ~FE_INEXACT, 0, 1); - test(cexpf, CMPLXL(-0.0, finites[i]), + test_f(cexpf, CMPLXL(-0.0, finites[i]), CMPLXL(cosf(finites[i]), sinf(finites[i])), ALL_STD_EXCEPT & ~FE_INEXACT, 0, 1); } @@ -302,12 +310,8 @@ main(void) test_inf(); printf("ok 3 - cexp inf\n"); -#if defined(__i386__) - printf("not ok 4 - cexp reals # TODO: PR # 191676 fails assertion on i386\n"); -#else test_reals(); printf("ok 4 - cexp reals\n"); -#endif test_imaginaries(); printf("ok 5 - cexp imaginaries\n");