mirror of
https://github.com/freebsd/freebsd-src.git
synced 2026-10-28 19:34:43 +01:00
Compare commits
22
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
afca0a0215 | ||
|
|
89a22c105d | ||
|
|
015fffc8b2 | ||
|
|
2d417323eb | ||
|
|
45d97b32db | ||
|
|
b5fbaaf760 | ||
|
|
86e188bc8c | ||
|
|
fa06ac302b | ||
|
|
0f25293703 | ||
|
|
441e391a02 | ||
|
|
0b2ec6e696 | ||
|
|
55f826f990 | ||
|
|
211396c70a | ||
|
|
6d32747831 | ||
|
|
9839cf7f7a | ||
|
|
772dc9fb9c | ||
|
|
13abc0eebb | ||
|
|
e031b6cdd7 | ||
|
|
a97901cccc | ||
|
|
d6964ababb | ||
|
|
a9fc8bc819 | ||
|
|
683e74bedf |
No files matched your search
@@ -16,6 +16,9 @@ from older versions of FreeBSD, try WITHOUT_CLANG to bootstrap to the tip of
|
||||
stable/10, and then rebuild without this option. The bootstrap process from
|
||||
older version of current is a bit fragile.
|
||||
|
||||
20171003:
|
||||
10.4-RELEASE.
|
||||
|
||||
20170824:
|
||||
Since the switch to GPT disk labels, fsck for UFS/FFS has been
|
||||
unable to automatically find alternate superblocks. As of r322860,
|
||||
|
||||
@@ -62,5 +62,5 @@ static const struct {
|
||||
.descsz = sizeof(int32_t),
|
||||
.type = ABI_NOTETYPE,
|
||||
.name = NOTE_FREEBSD_VENDOR,
|
||||
.desc = __FreeBSD_version
|
||||
.desc = 1004000
|
||||
};
|
||||
@@ -291,7 +291,7 @@ fetch_resolve(const char *addr, int port, int af)
|
||||
goto syserr;
|
||||
service = sbuf;
|
||||
} else if (*sep != '\0') {
|
||||
service = sep;
|
||||
service = sep + 1;
|
||||
} else {
|
||||
service = NULL;
|
||||
}
|
||||
|
||||
+6
-3
@@ -192,8 +192,11 @@ disc1: packagesystem
|
||||
# Install system
|
||||
mkdir -p ${.TARGET}
|
||||
cd ${WORLDDIR} && ${IMAKE} installkernel installworld distribution \
|
||||
DESTDIR=${.OBJDIR}/${.TARGET} WITHOUT_RESCUE=1 WITHOUT_KERNEL_SYMBOLS=1 \
|
||||
WITHOUT_PROFILE=1 WITHOUT_SENDMAIL=1 WITHOUT_ATF=1 WITHOUT_LIB32=1
|
||||
DESTDIR=${.OBJDIR}/${.TARGET} WITHOUT_AMD=1 WITHOUT_AT=1 \
|
||||
WITHOUT_INSTALLLIB=1 WITHOUT_LIB32=1 WITHOUT_MAIL=1 \
|
||||
WITHOUT_NCP=1 WITHOUT_TOOLCHAIN=1 WITHOUT_PROFILE=1 \
|
||||
WITHOUT_RESCUE=1 WITHOUT_DICT=1 \
|
||||
WITHOUT_KERNEL_SYMBOLS=1
|
||||
# Copy distfiles
|
||||
mkdir -p ${.TARGET}/usr/freebsd-dist
|
||||
cp *.txz MANIFEST ${.TARGET}/usr/freebsd-dist
|
||||
@@ -217,7 +220,7 @@ bootonly: packagesystem
|
||||
WITHOUT_GAMES=1 WITHOUT_GROFF=1 \
|
||||
WITHOUT_INSTALLLIB=1 WITHOUT_LIB32=1 WITHOUT_MAIL=1 \
|
||||
WITHOUT_NCP=1 WITHOUT_TOOLCHAIN=1 WITHOUT_PROFILE=1 \
|
||||
WITHOUT_INSTALLIB=1 WITHOUT_RESCUE=1 WITHOUT_DICT=1 \
|
||||
WITHOUT_RESCUE=1 WITHOUT_DICT=1 \
|
||||
WITHOUT_KERNEL_SYMBOLS=1
|
||||
# Copy manifest only (no distfiles) to get checksums
|
||||
mkdir -p ${.TARGET}/usr/freebsd-dist
|
||||
|
||||
@@ -3,9 +3,10 @@
|
||||
RELN_ROOT?= ${.CURDIR}/..
|
||||
|
||||
SUBDIR = relnotes
|
||||
SUBDIR+= hardware
|
||||
SUBDIR+= readme
|
||||
SUBDIR+= errata
|
||||
SUBDIR+= hardware
|
||||
SUBDIR+= installation
|
||||
SUBDIR+= readme
|
||||
|
||||
COMPAT_SYMLINK = en
|
||||
|
||||
|
||||
@@ -0,0 +1,19 @@
|
||||
# $FreeBSD$
|
||||
|
||||
RELN_ROOT?= ${.CURDIR}/../..
|
||||
.ifdef NO_LANGCODE_IN_DESTDIR
|
||||
DESTDIR?= ${DOCDIR}/installation
|
||||
.else
|
||||
DESTDIR?= ${DOCDIR}/en_US.ISO8859-1/installation
|
||||
.endif
|
||||
|
||||
DOC?= article
|
||||
FORMATS?= html
|
||||
INSTALL_COMPRESSED?= gz
|
||||
INSTALL_ONLY_COMPRESSED?=
|
||||
|
||||
# SGML content
|
||||
SRCS+= article.xml
|
||||
|
||||
.include "${RELN_ROOT}/share/mk/doc.relnotes.mk"
|
||||
.include "${DOC_PREFIX}/share/mk/doc.project.mk"
|
||||
@@ -0,0 +1,122 @@
|
||||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!DOCTYPE article PUBLIC "-//FreeBSD//DTD DocBook XML V5.0-Based Extension//EN"
|
||||
"http://www.FreeBSD.org/XML/share/xml/freebsd50.dtd" [
|
||||
<!ENTITY % release PUBLIC "-//FreeBSD//ENTITIES Release Specification//EN"
|
||||
"http://www.FreeBSD.org/release/XML/share/xml/release.ent">
|
||||
%release;
|
||||
<!ENTITY local.rel "10.4">
|
||||
]>
|
||||
|
||||
<article xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" version="5.0"
|
||||
xml:id="top">
|
||||
<info><title>&os; &release.current; Installation Instructions</title>
|
||||
|
||||
<author><orgname>The &os; Project</orgname></author>
|
||||
|
||||
<pubdate>$FreeBSD$</pubdate>
|
||||
|
||||
<copyright>
|
||||
<year>2017</year>
|
||||
<holder role="mailto:[email protected]">The &os; Documentation Project</holder>
|
||||
</copyright>
|
||||
|
||||
<legalnotice xml:id="trademarks" role="trademarks">
|
||||
&tm-attrib.freebsd;
|
||||
&tm-attrib.intel;
|
||||
&tm-attrib.sparc;
|
||||
&tm-attrib.general;
|
||||
</legalnotice>
|
||||
|
||||
<abstract>
|
||||
<para>This article gives some brief instructions on installing
|
||||
&os; &release.current; and upgrading the systems running earlier
|
||||
releases.</para>
|
||||
</abstract>
|
||||
</info>
|
||||
|
||||
<sect1 xml:id="install">
|
||||
<title>Installing &os;</title>
|
||||
|
||||
<para>The <uri
|
||||
xlink:href="&url.books.handbook;/bsdinstall.html">Installing
|
||||
&os;</uri>
|
||||
chapter of the <uri
|
||||
xlink:href="&url.books.handbook;/">&os;
|
||||
Handbook</uri> provides more in-depth information about the
|
||||
installation program itself, including a guided walk-through with
|
||||
screenshots.</para>
|
||||
</sect1>
|
||||
|
||||
<sect1 xml:id="upgrade">
|
||||
<title>Upgrading &os;</title>
|
||||
|
||||
<para>If you are upgrading from a previous release of &os;, please
|
||||
read <uri
|
||||
xlink:href="http://www.FreeBSD.org/releases/&local.rel;R/relnotes.html#upgrade">upgrading
|
||||
section in the Release Notes</uri> for notable
|
||||
incompatibilities carefully.</para>
|
||||
|
||||
<sect2 xml:id="upgrade-source">
|
||||
<title>Upgrading from Source</title>
|
||||
|
||||
<para>The procedure for doing a source code based update is
|
||||
described in
|
||||
<uri xlink:href="&url.books.handbook;/synching.html"></uri> and
|
||||
<uri xlink:href="&url.books.handbook;/makeworld.html"></uri>.</para>
|
||||
|
||||
<para>For SVN use the <filename>releng/&local.rel;</filename> branch
|
||||
which will be where any upcoming Security Advisories or Errata
|
||||
Notices will be applied.</para>
|
||||
</sect2>
|
||||
|
||||
<sect2 xml:id="upgrade-binary">
|
||||
<title>Upgrading Using <quote>&os; Update</quote></title>
|
||||
|
||||
<para>The &man.freebsd-update.8; utility supports binary
|
||||
upgrades of &arch.i386; and &arch.amd64; systems running
|
||||
earlier FreeBSD releases. Systems running
|
||||
<literal>10.3-RELEASE</literal>,
|
||||
<literal>10.4-RC[12]</literal> can upgrade as follows:</para>
|
||||
|
||||
<screen>&prompt.root; freebsd-update fetch
|
||||
&prompt.root; freebsd-update install</screen>
|
||||
|
||||
<para>Now the &man.freebsd-update.8; utility can fetch bits
|
||||
belonging to &release.current;. During this process
|
||||
&man.freebsd-update.8; will ask for help in merging
|
||||
configuration files.</para>
|
||||
|
||||
<screen>&prompt.root; freebsd-update upgrade -r &local.rel;-RELEASE</screen>
|
||||
|
||||
<screen>&prompt.root; freebsd-update install</screen>
|
||||
|
||||
<para>The system must now be rebooted with the newly installed
|
||||
kernel before the non-kernel components are updated.</para>
|
||||
|
||||
<screen>&prompt.root; shutdown -r now</screen>
|
||||
|
||||
<para>After rebooting, &man.freebsd-update.8; needs to be run
|
||||
again to install the new userland components:</para>
|
||||
|
||||
<screen>&prompt.root; freebsd-update install</screen>
|
||||
|
||||
<para>At this point, users of systems being upgraded from &os;
|
||||
10.3-RELEASE or earlier will be prompted by
|
||||
&man.freebsd-update.8; to rebuild all third-party applications
|
||||
(e.g., ports installed from the ports tree) due to updates in
|
||||
system libraries.</para>
|
||||
|
||||
<para>After updating installed third-party applications (and
|
||||
again, only if &man.freebsd-update.8; printed a message
|
||||
indicating that this was necessary), run
|
||||
&man.freebsd-update.8; again so that it can delete the old (no
|
||||
longer used) system libraries:</para>
|
||||
|
||||
<screen>&prompt.root; freebsd-update install</screen>
|
||||
|
||||
<para>Finally, reboot into &release.current;</para>
|
||||
|
||||
<screen>&prompt.root; shutdown -r now</screen>
|
||||
</sect2>
|
||||
</sect1>
|
||||
</article>
|
||||
@@ -352,8 +352,9 @@
|
||||
other copies are kept updated on the Internet and should be
|
||||
consulted as the <quote>current errata</quote> for this
|
||||
release. These other copies of the errata are located at
|
||||
<uri
|
||||
xlink:href="&url.base;/releases/">&url.base;/releases/</uri>
|
||||
the <uri
|
||||
xlink:href="&url.base;/releases/">&os; &release.current;
|
||||
page</uri>
|
||||
(as well as any sites which keep up-to-date mirrors of this
|
||||
location).</para>
|
||||
</note>
|
||||
|
||||
@@ -198,6 +198,14 @@
|
||||
added, providing command-line access to features and debugging
|
||||
facilities of &man.cxgbe.4; devices.</para>
|
||||
|
||||
<para revision="318430">The &man.ifconfig.8; utility has been
|
||||
updated to show <acronym>MAC</acronym> addresses
|
||||
persistently stored by network drivers. This provides
|
||||
a mechanism through which the original <acronym>MAC</acronym>
|
||||
address can be retrieved if, for example, an interface is
|
||||
added to a &man.lagg.4; and the <literal>MAC</literal> is
|
||||
overridden in &man.rc.conf.5;.</para>
|
||||
|
||||
<para revision="320646">The &man.rcp.1;, &man.rlogin.1;,
|
||||
&man.rsh.1;, &man.rlogind.8;, and &man.rshd.8; utilities have
|
||||
been marked as deprecated, and planned for removal in
|
||||
@@ -233,6 +241,11 @@
|
||||
compliant with RFC5424. For more details, see the description
|
||||
for the <literal>T</literal> flag in
|
||||
&man.newsyslog.conf.5;.</para>
|
||||
|
||||
<para revision="323333">The &man.pw.8; utility has been updated
|
||||
to support empty secondary groups being passed with the
|
||||
<literal>-G</literal> flag, ensuring the target user does not
|
||||
have any secondary group memberships.</para>
|
||||
</sect2>
|
||||
|
||||
<sect2 xml:id="userland-contrib">
|
||||
@@ -275,26 +288,16 @@
|
||||
<sect2 xml:id="userland-installer">
|
||||
<title>Installation and Configuration Tools</title>
|
||||
|
||||
<para revision="313433">The &man.bsdinstall.8; utility has been
|
||||
updated to ensure newly-created partitions are properly
|
||||
aligned at 4096 byte boundaries.</para>
|
||||
|
||||
<para revision="321202" contrib="sponsor" sponsor="&ff;">The
|
||||
default <acronym>EFI</acronym> partition created by
|
||||
&man.bsdinstall.8; has been increased from 800KB to
|
||||
200MB.</para>
|
||||
</sect2>
|
||||
|
||||
<sect2 xml:id="userland-rc">
|
||||
<title><filename class="directory">/etc/rc.d</filename>
|
||||
Scripts</title>
|
||||
|
||||
<para> </para>
|
||||
</sect2>
|
||||
|
||||
<sect2 xml:id="userland-periodic">
|
||||
<title><filename class="directory">/etc/periodic</filename>
|
||||
Scripts</title>
|
||||
|
||||
<para> </para>
|
||||
</sect2>
|
||||
|
||||
<sect2 xml:id="userland-libraries">
|
||||
<title>Runtime Libraries and API</title>
|
||||
|
||||
@@ -366,12 +369,6 @@
|
||||
<literal>flush_queue</literal> handling.</para>
|
||||
</sect2>
|
||||
|
||||
<sect2 xml:id="kernel-config">
|
||||
<title>Kernel Configuration</title>
|
||||
|
||||
<para> </para>
|
||||
</sect2>
|
||||
|
||||
<sect2 xml:id="kernel-sysctl">
|
||||
<title>System Tuning and Controls</title>
|
||||
|
||||
@@ -458,12 +455,6 @@
|
||||
as hardware changes and updates that do not otherwise fit in
|
||||
other sections of this document.</para>
|
||||
|
||||
<sect2 xml:id="hardware-support">
|
||||
<title>Hardware Support</title>
|
||||
|
||||
<para> </para>
|
||||
</sect2>
|
||||
|
||||
<sect2 xml:id="hardware-virtualization">
|
||||
<title>Virtualization Support</title>
|
||||
|
||||
@@ -478,12 +469,6 @@
|
||||
devices to be marked for passthrough or host use at
|
||||
runtime.</para>
|
||||
</sect2>
|
||||
|
||||
<sect2 xml:id="hardware-arm">
|
||||
<title>ARM Support</title>
|
||||
|
||||
<para> </para>
|
||||
</sect2>
|
||||
</sect1>
|
||||
|
||||
<sect1 xml:id="storage">
|
||||
@@ -492,12 +477,6 @@
|
||||
<para>This section covers changes and additions to file systems
|
||||
and other storage subsystems, both local and networked.</para>
|
||||
|
||||
<sect2 xml:id="storage-general">
|
||||
<title>General Storage</title>
|
||||
|
||||
<para> </para>
|
||||
</sect2>
|
||||
|
||||
<sect2 xml:id="storage-net">
|
||||
<title>Networked Storage</title>
|
||||
|
||||
@@ -514,37 +493,6 @@
|
||||
<literal>commit</literal> through the
|
||||
<literal>DS</literal>.</para>
|
||||
</sect2>
|
||||
|
||||
<sect2 xml:id="storage-zfs">
|
||||
<title>ZFS</title>
|
||||
|
||||
<para></para>
|
||||
</sect2>
|
||||
|
||||
<sect2 xml:id="storage-geom">
|
||||
<title>&man.geom.4;</title>
|
||||
|
||||
<para> </para>
|
||||
</sect2>
|
||||
</sect1>
|
||||
|
||||
<sect1 xml:id="boot">
|
||||
<title>Boot Loader Changes</title>
|
||||
|
||||
<para>This section covers the boot loader, boot menu, and other
|
||||
boot-related changes.</para>
|
||||
|
||||
<sect2 xml:id="boot-loader">
|
||||
<title>Boot Loader Changes</title>
|
||||
|
||||
<para> </para>
|
||||
</sect2>
|
||||
|
||||
<sect2 xml:id="boot-menu">
|
||||
<title>Boot Menu Changes</title>
|
||||
|
||||
<para> </para>
|
||||
</sect2>
|
||||
</sect1>
|
||||
|
||||
<sect1 xml:id="network">
|
||||
@@ -592,48 +540,11 @@
|
||||
Collection, package infrastructure, and package maintenance and
|
||||
installation tools.</para>
|
||||
|
||||
<sect2 xml:id="ports-infrastructure">
|
||||
<title>Infrastructure Changes</title>
|
||||
|
||||
<para> </para>
|
||||
</sect2>
|
||||
|
||||
<sect2 xml:id="ports-packages ">
|
||||
<title>Packaging Changes</title>
|
||||
|
||||
<para> </para>
|
||||
</sect2>
|
||||
</sect1>
|
||||
|
||||
<sect1 xml:id="doc">
|
||||
<title>Documentation</title>
|
||||
|
||||
<para>This section covers changes to the &os; Documentation
|
||||
Project sources and toolchain.</para>
|
||||
|
||||
<sect2 xml:id="doc-sources">
|
||||
<title>Documentation Source Changes</title>
|
||||
|
||||
<para> </para>
|
||||
</sect2>
|
||||
|
||||
<sect2 xml:id="doc-toolchain">
|
||||
<title>Documentation Toolchain Changes</title>
|
||||
|
||||
<para> </para>
|
||||
</sect2>
|
||||
</sect1>
|
||||
|
||||
<sect1 xml:id="releng">
|
||||
<title>Release Engineering and Integration</title>
|
||||
|
||||
<para>This section convers changes that are specific to the
|
||||
&os; Release Engineering processes.</para>
|
||||
|
||||
<sect2 xml:id="releng-changes">
|
||||
<title>Integration Changes</title>
|
||||
|
||||
<para> </para>
|
||||
<para>The &man.pkg.8; utility has been updated to version
|
||||
1.10.1.</para>
|
||||
</sect2>
|
||||
</sect1>
|
||||
</article>
|
||||
@@ -6,7 +6,7 @@
|
||||
|
||||
<!-- Version of the OS we're describing. This needs to be updated
|
||||
with each new release. -->
|
||||
<!ENTITY release.current "10.3-STABLE">
|
||||
<!ENTITY release.current "10.4-RELEASE">
|
||||
|
||||
<!-- The previous version used for comparison in the "What's New"
|
||||
section. For -CURRENT, we might point back to the last
|
||||
@@ -16,16 +16,16 @@
|
||||
<!-- The previous stable release, useful for pointing user's at the
|
||||
release they SHOULD be running if they don't want the bleeding
|
||||
edge. -->
|
||||
<!ENTITY release.prev.stable "10.2-RELEASE">
|
||||
<!ENTITY release.prev.stable "10.3-RELEASE">
|
||||
|
||||
<!-- The next version to be released, usually used for snapshots. -->
|
||||
<!ENTITY release.next "10.3-RELEASE">
|
||||
<!ENTITY release.next "10.4-STABLE">
|
||||
|
||||
<!-- The name of this branch. -->
|
||||
<!ENTITY release.branch "10.3-STABLE">
|
||||
<!ENTITY release.branch "10.4-STABLE">
|
||||
|
||||
<!-- The URL for obtaining this version of FreeBSD. -->
|
||||
<!ENTITY release.url "https://www.FreeBSD.org/snapshots/">
|
||||
<!ENTITY release.url "https://www.FreeBSD.org/releases/">
|
||||
|
||||
<!-- The URL for Security Advisories and Errata Notices. -->
|
||||
<!ENTITY security.url "https://www.FreeBSD.org/security/advisories">
|
||||
@@ -38,9 +38,9 @@
|
||||
<!-- WARNING: Do not forget to also change the release type in
|
||||
doc.relnotes.mk when updating this -->
|
||||
<!ENTITY release.type "snapshot">
|
||||
<!ENTITY % release.type.current "INCLUDE">
|
||||
<!ENTITY % release.type.current "IGNORE">
|
||||
<!ENTITY % release.type.snapshot "IGNORE">
|
||||
<!ENTITY % release.type.release "IGNORE">
|
||||
<!ENTITY % release.type.release "INCLUDE">
|
||||
|
||||
<![%release.type.current;[
|
||||
<!ENTITY release '&release.current;'>
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
# $FreeBSD$
|
||||
release: {
|
||||
url: "pkg+http://pkg.FreeBSD.org/${ABI}/quarterly",
|
||||
url: "pkg+http://pkg.FreeBSD.org/${ABI}/release_4",
|
||||
mirror_type: "srv",
|
||||
signature_type: "fingerprints",
|
||||
fingerprints: "/usr/share/keys/pkg",
|
||||
|
||||
@@ -116,6 +116,15 @@ vm_install_base() {
|
||||
installworld installkernel distribution || \
|
||||
err "\n\nCannot install the base system to ${DESTDIR}."
|
||||
|
||||
# Bootstrap etcupdate(8) and mergemaster(8) databases.
|
||||
mkdir -p ${DESTDIR}/var/db/etcupdate
|
||||
etcupdate extract -B \
|
||||
-M "TARGET=${TARGET} TARGET_ARCH=${TARGET_ARCH}" \
|
||||
-s ${WORLDDIR} -d ${DESTDIR}/var/db/etcupdate
|
||||
sh ${WORLDDIR}/release/scripts/mm-mtree.sh -m ${WORLDDIR} \
|
||||
-F "TARGET=${TARGET} TARGET_ARCH=${TARGET_ARCH}" \
|
||||
-D ${DESTDIR}
|
||||
|
||||
echo '# Custom /etc/fstab for FreeBSD VM images' \
|
||||
> ${DESTDIR}/etc/fstab
|
||||
echo '/dev/gpt/rootfs / ufs rw 1 1' \
|
||||
|
||||
+12
-6
@@ -183,13 +183,17 @@ It may contain either
|
||||
or
|
||||
.Dv MTX_SPIN
|
||||
but not both.
|
||||
See below for additional initialization options.
|
||||
It is not permissible to pass the same
|
||||
.Fa mutex
|
||||
to
|
||||
If the kernel has been compiled with
|
||||
.Cd "option INVARIANTS" ,
|
||||
.Fn mtx_init
|
||||
multiple times without intervening calls to
|
||||
.Fn mtx_destroy .
|
||||
will assert that the
|
||||
.Fa mutex
|
||||
has not been initialized multiple times without intervening calls to
|
||||
.Fn mtx_destroy
|
||||
unless the
|
||||
.Dv MTX_NEW
|
||||
option is specified.
|
||||
See below for additional initialization options.
|
||||
.Pp
|
||||
The
|
||||
.Fn mtx_lock
|
||||
@@ -473,6 +477,8 @@ to ignore this lock.
|
||||
Witness should not log messages about duplicate locks being acquired.
|
||||
.It Dv MTX_NOPROFILE
|
||||
Do not profile this lock.
|
||||
.It Dv MTX_NEW
|
||||
Do not check for double-init.
|
||||
.El
|
||||
.Ss Lock and Unlock Flags
|
||||
The flags passed to the
|
||||
|
||||
+10
-1
@@ -26,7 +26,7 @@
|
||||
.\" $FreeBSD$
|
||||
.\"
|
||||
.\" Based on rwlock.9 man page
|
||||
.Dd June 25, 2013
|
||||
.Dd December 13, 2014
|
||||
.Dt RMLOCK 9
|
||||
.Os
|
||||
.Sh NAME
|
||||
@@ -156,6 +156,15 @@ Allow threads to recursively acquire shared locks for
|
||||
.Fa rm .
|
||||
.It Dv RM_SLEEPABLE
|
||||
Create a sleepable read-mostly lock.
|
||||
.It Dv RM_NEW
|
||||
If the kernel has been compiled with
|
||||
.Cd "option INVARIANTS" ,
|
||||
.Fn rm_init_flags
|
||||
will assert that the
|
||||
.Fa rm
|
||||
has not been initialized multiple times without intervening calls to
|
||||
.Fn rm_destroy
|
||||
unless this option is specified.
|
||||
.El
|
||||
.It Fn rm_rlock "struct rmlock *rm" "struct rm_priotracker* tracker"
|
||||
Lock
|
||||
|
||||
+10
-1
@@ -24,7 +24,7 @@
|
||||
.\"
|
||||
.\" $FreeBSD$
|
||||
.\"
|
||||
.Dd June 20, 2013
|
||||
.Dd December 13, 2014
|
||||
.Dt RWLOCK 9
|
||||
.Os
|
||||
.Sh NAME
|
||||
@@ -154,6 +154,15 @@ Do not log any operations for this lock via
|
||||
.It Dv RW_RECURSE
|
||||
Allow threads to recursively acquire exclusive locks for
|
||||
.Fa rw .
|
||||
.It Dv RW_NEW
|
||||
If the kernel has been compiled with
|
||||
.Cd "option INVARIANTS" ,
|
||||
.Fn rw_init_flags
|
||||
will assert that the
|
||||
.Fa rw
|
||||
has not been initialized multiple times without intervening calls to
|
||||
.Fn rw_destroy
|
||||
unless this option is specified.
|
||||
.El
|
||||
.It Fn rw_rlock "struct rwlock *rw"
|
||||
Lock
|
||||
|
||||
@@ -142,6 +142,15 @@ Allow threads to recursively acquire exclusive locks for
|
||||
.It Dv SX_QUIET
|
||||
Do not log any operations for this lock via
|
||||
.Xr ktr 4 .
|
||||
.It Dv SX_NEW
|
||||
If the kernel has been compiled with
|
||||
.Cd "options INVARIANTS" ,
|
||||
.Fn sx_init
|
||||
will assert that the
|
||||
.Fa sx
|
||||
has not been initialized multiple times without intervening calls to
|
||||
.Fn sx_destroy
|
||||
unless this option is specified.
|
||||
.El
|
||||
.Pp
|
||||
Shared/exclusive locks are destroyed with
|
||||
|
||||
+1
-1
@@ -32,7 +32,7 @@
|
||||
|
||||
TYPE="FreeBSD"
|
||||
REVISION="10.4"
|
||||
BRANCH="BETA4"
|
||||
BRANCH="RELEASE"
|
||||
if [ "X${BRANCH_OVERRIDE}" != "X" ]; then
|
||||
BRANCH=${BRANCH_OVERRIDE}
|
||||
fi
|
||||
|
||||
+100
-27
@@ -39,16 +39,34 @@ __FBSDID("$FreeBSD$");
|
||||
#include <sys/rwlock.h>
|
||||
#include <sys/bus.h>
|
||||
#include <sys/uio.h>
|
||||
#include <sys/smp.h>
|
||||
#include <crypto/aesni/aesni.h>
|
||||
#include <cryptodev_if.h>
|
||||
|
||||
static struct mtx_padalign *ctx_mtx;
|
||||
static struct fpu_kern_ctx **ctx_fpu;
|
||||
|
||||
struct aesni_softc {
|
||||
int dieing;
|
||||
int32_t cid;
|
||||
uint32_t sid;
|
||||
TAILQ_HEAD(aesni_sessions_head, aesni_session) sessions;
|
||||
struct rwlock lock;
|
||||
};
|
||||
|
||||
#define AQUIRE_CTX(i, ctx) \
|
||||
do { \
|
||||
(i) = PCPU_GET(cpuid); \
|
||||
mtx_lock(&ctx_mtx[(i)]); \
|
||||
(ctx) = ctx_fpu[(i)]; \
|
||||
} while (0)
|
||||
#define RELEASE_CTX(i, ctx) \
|
||||
do { \
|
||||
mtx_unlock(&ctx_mtx[(i)]); \
|
||||
(i) = -1; \
|
||||
(ctx) = NULL; \
|
||||
} while (0)
|
||||
|
||||
static int aesni_newsession(device_t, uint32_t *sidp, struct cryptoini *cri);
|
||||
static int aesni_freesession(device_t, uint64_t tid);
|
||||
static void aesni_freesession_locked(struct aesni_softc *sc,
|
||||
@@ -88,14 +106,36 @@ aesni_probe(device_t dev)
|
||||
return (0);
|
||||
}
|
||||
|
||||
static void
|
||||
aensi_cleanctx(void)
|
||||
{
|
||||
int i;
|
||||
|
||||
/* XXX - no way to return driverid */
|
||||
CPU_FOREACH(i) {
|
||||
if (ctx_fpu[i] != NULL) {
|
||||
mtx_destroy(&ctx_mtx[i]);
|
||||
fpu_kern_free_ctx(ctx_fpu[i]);
|
||||
}
|
||||
ctx_fpu[i] = NULL;
|
||||
}
|
||||
free(ctx_mtx, M_AESNI);
|
||||
ctx_mtx = NULL;
|
||||
free(ctx_fpu, M_AESNI);
|
||||
ctx_fpu = NULL;
|
||||
}
|
||||
|
||||
static int
|
||||
aesni_attach(device_t dev)
|
||||
{
|
||||
struct aesni_softc *sc;
|
||||
int i;
|
||||
|
||||
sc = device_get_softc(dev);
|
||||
sc->dieing = 0;
|
||||
TAILQ_INIT(&sc->sessions);
|
||||
sc->sid = 1;
|
||||
|
||||
sc->cid = crypto_get_driverid(dev, CRYPTOCAP_F_HARDWARE |
|
||||
CRYPTOCAP_F_SYNC);
|
||||
if (sc->cid < 0) {
|
||||
@@ -103,6 +143,16 @@ aesni_attach(device_t dev)
|
||||
return (ENOMEM);
|
||||
}
|
||||
|
||||
ctx_mtx = malloc(sizeof *ctx_mtx * (mp_maxid + 1), M_AESNI,
|
||||
M_WAITOK|M_ZERO);
|
||||
ctx_fpu = malloc(sizeof *ctx_fpu * (mp_maxid + 1), M_AESNI,
|
||||
M_WAITOK|M_ZERO);
|
||||
|
||||
CPU_FOREACH(i) {
|
||||
ctx_fpu[i] = fpu_kern_alloc_ctx(0);
|
||||
mtx_init(&ctx_mtx[i], "anifpumtx", NULL, MTX_DEF|MTX_NEW);
|
||||
}
|
||||
|
||||
rw_init(&sc->lock, "aesni_lock");
|
||||
crypto_register(sc->cid, CRYPTO_AES_CBC, 0, 0);
|
||||
crypto_register(sc->cid, CRYPTO_AES_XTS, 0, 0);
|
||||
@@ -116,6 +166,7 @@ aesni_detach(device_t dev)
|
||||
struct aesni_session *ses;
|
||||
|
||||
sc = device_get_softc(dev);
|
||||
|
||||
rw_wlock(&sc->lock);
|
||||
TAILQ_FOREACH(ses, &sc->sessions, next) {
|
||||
if (ses->used) {
|
||||
@@ -125,14 +176,18 @@ aesni_detach(device_t dev)
|
||||
return (EBUSY);
|
||||
}
|
||||
}
|
||||
sc->dieing = 1;
|
||||
while ((ses = TAILQ_FIRST(&sc->sessions)) != NULL) {
|
||||
TAILQ_REMOVE(&sc->sessions, ses, next);
|
||||
fpu_kern_free_ctx(ses->fpu_ctx);
|
||||
free(ses, M_AESNI);
|
||||
}
|
||||
rw_wunlock(&sc->lock);
|
||||
rw_destroy(&sc->lock);
|
||||
crypto_unregister_all(sc->cid);
|
||||
|
||||
rw_destroy(&sc->lock);
|
||||
|
||||
aensi_cleanctx();
|
||||
|
||||
return (0);
|
||||
}
|
||||
|
||||
@@ -148,6 +203,9 @@ aesni_newsession(device_t dev, uint32_t *sidp, struct cryptoini *cri)
|
||||
return (EINVAL);
|
||||
|
||||
sc = device_get_softc(dev);
|
||||
if (sc->dieing)
|
||||
return (EINVAL);
|
||||
|
||||
ses = NULL;
|
||||
encini = NULL;
|
||||
for (; cri != NULL; cri = cri->cri_next) {
|
||||
@@ -166,6 +224,10 @@ aesni_newsession(device_t dev, uint32_t *sidp, struct cryptoini *cri)
|
||||
return (EINVAL);
|
||||
|
||||
rw_wlock(&sc->lock);
|
||||
if (sc->dieing) {
|
||||
rw_wunlock(&sc->lock);
|
||||
return (EINVAL);
|
||||
}
|
||||
/*
|
||||
* Free sessions goes first, so if first session is used, we need to
|
||||
* allocate one.
|
||||
@@ -177,13 +239,6 @@ aesni_newsession(device_t dev, uint32_t *sidp, struct cryptoini *cri)
|
||||
rw_wunlock(&sc->lock);
|
||||
return (ENOMEM);
|
||||
}
|
||||
ses->fpu_ctx = fpu_kern_alloc_ctx(FPU_KERN_NORMAL |
|
||||
FPU_KERN_NOWAIT);
|
||||
if (ses->fpu_ctx == NULL) {
|
||||
free(ses, M_AESNI);
|
||||
rw_wunlock(&sc->lock);
|
||||
return (ENOMEM);
|
||||
}
|
||||
ses->id = sc->sid++;
|
||||
} else {
|
||||
TAILQ_REMOVE(&sc->sessions, ses, next);
|
||||
@@ -208,15 +263,14 @@ aesni_newsession(device_t dev, uint32_t *sidp, struct cryptoini *cri)
|
||||
static void
|
||||
aesni_freesession_locked(struct aesni_softc *sc, struct aesni_session *ses)
|
||||
{
|
||||
struct fpu_kern_ctx *ctx;
|
||||
uint32_t sid;
|
||||
|
||||
rw_assert(&sc->lock, RA_WLOCKED);
|
||||
|
||||
sid = ses->id;
|
||||
TAILQ_REMOVE(&sc->sessions, ses, next);
|
||||
ctx = ses->fpu_ctx;
|
||||
bzero(ses, sizeof(*ses));
|
||||
ses->id = sid;
|
||||
ses->fpu_ctx = ctx;
|
||||
TAILQ_INSERT_HEAD(&sc->sessions, ses, next);
|
||||
}
|
||||
|
||||
@@ -362,17 +416,27 @@ MODULE_DEPEND(aesni, crypto, 1, 1, 1);
|
||||
static int
|
||||
aesni_cipher_setup(struct aesni_session *ses, struct cryptoini *encini)
|
||||
{
|
||||
struct thread *td;
|
||||
struct fpu_kern_ctx *ctx;
|
||||
int error;
|
||||
int kt, ctxidx;
|
||||
|
||||
kt = is_fpu_kern_thread(0);
|
||||
if (!kt) {
|
||||
AQUIRE_CTX(ctxidx, ctx);
|
||||
error = fpu_kern_enter(curthread, ctx,
|
||||
FPU_KERN_NORMAL | FPU_KERN_KTHR);
|
||||
if (error != 0)
|
||||
goto out;
|
||||
}
|
||||
|
||||
td = curthread;
|
||||
error = fpu_kern_enter(td, ses->fpu_ctx, FPU_KERN_NORMAL |
|
||||
FPU_KERN_KTHR);
|
||||
if (error != 0)
|
||||
return (error);
|
||||
error = aesni_cipher_setup_common(ses, encini->cri_key,
|
||||
encini->cri_klen);
|
||||
fpu_kern_leave(td, ses->fpu_ctx);
|
||||
|
||||
if (!kt) {
|
||||
fpu_kern_leave(curthread, ctx);
|
||||
out:
|
||||
RELEASE_CTX(ctxidx, ctx);
|
||||
}
|
||||
return (error);
|
||||
}
|
||||
|
||||
@@ -380,19 +444,24 @@ static int
|
||||
aesni_cipher_process(struct aesni_session *ses, struct cryptodesc *enccrd,
|
||||
struct cryptop *crp)
|
||||
{
|
||||
struct thread *td;
|
||||
struct fpu_kern_ctx *ctx;
|
||||
uint8_t *buf;
|
||||
int error, allocated;
|
||||
int kt, ctxidx;
|
||||
|
||||
buf = aesni_cipher_alloc(enccrd, crp, &allocated);
|
||||
if (buf == NULL)
|
||||
return (ENOMEM);
|
||||
|
||||
td = curthread;
|
||||
error = fpu_kern_enter(td, ses->fpu_ctx, FPU_KERN_NORMAL |
|
||||
FPU_KERN_KTHR);
|
||||
if (error != 0)
|
||||
goto out1;
|
||||
error = 0;
|
||||
kt = is_fpu_kern_thread(0);
|
||||
if (!kt) {
|
||||
AQUIRE_CTX(ctxidx, ctx);
|
||||
error = fpu_kern_enter(curthread, ctx,
|
||||
FPU_KERN_NORMAL|FPU_KERN_KTHR);
|
||||
if (error != 0)
|
||||
goto out2;
|
||||
}
|
||||
|
||||
if ((enccrd->crd_flags & CRD_F_KEY_EXPLICIT) != 0) {
|
||||
error = aesni_cipher_setup_common(ses, enccrd->crd_key,
|
||||
@@ -438,8 +507,12 @@ aesni_cipher_process(struct aesni_session *ses, struct cryptodesc *enccrd,
|
||||
enccrd->crd_skip + enccrd->crd_len - AES_BLOCK_LEN,
|
||||
AES_BLOCK_LEN, ses->iv);
|
||||
out:
|
||||
fpu_kern_leave(td, ses->fpu_ctx);
|
||||
out1:
|
||||
if (!kt) {
|
||||
fpu_kern_leave(curthread, ctx);
|
||||
out2:
|
||||
RELEASE_CTX(ctxidx, ctx);
|
||||
}
|
||||
|
||||
if (allocated) {
|
||||
bzero(buf, enccrd->crd_len);
|
||||
free(buf, M_AESNI);
|
||||
|
||||
@@ -65,7 +65,6 @@ struct aesni_session {
|
||||
int used;
|
||||
uint32_t id;
|
||||
TAILQ_ENTRY(aesni_session) next;
|
||||
struct fpu_kern_ctx *fpu_ctx;
|
||||
};
|
||||
|
||||
/*
|
||||
|
||||
@@ -338,7 +338,7 @@ SYSCTL_INT(_hw_ix, OID_AUTO, rxd, CTLFLAG_RDTUN, &ixgbe_rxd, 0,
|
||||
*/
|
||||
static int allow_unsupported_sfp = FALSE;
|
||||
TUNABLE_INT("hw.ix.unsupported_sfp", &allow_unsupported_sfp);
|
||||
SYSCTL_INT(_hw_ix, OID_AUTO, allow_unsupported_sfp, CTLFLAG_RDTUN,
|
||||
SYSCTL_INT(_hw_ix, OID_AUTO, unsupported_sfp, CTLFLAG_RDTUN,
|
||||
&allow_unsupported_sfp, 0,
|
||||
"Allow unsupported SFP modules...use at your own risk");
|
||||
|
||||
|
||||
@@ -316,6 +316,8 @@ ixgbe_netmap_txsync(struct netmap_kring *kring, int flags)
|
||||
}
|
||||
}
|
||||
|
||||
nm_txsync_finalize(kring);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -343,7 +345,7 @@ ixgbe_netmap_rxsync(struct netmap_kring *kring, int flags)
|
||||
u_int nic_i; /* index into the NIC ring */
|
||||
u_int n;
|
||||
u_int const lim = kring->nkr_num_slots - 1;
|
||||
u_int const head = kring->rhead;
|
||||
u_int const head = nm_rxsync_prologue(kring);
|
||||
int force_update = (flags & NAF_FORCE_READ) || kring->nr_kflags & NKR_PENDINTR;
|
||||
|
||||
/* device-specific */
|
||||
@@ -450,6 +452,9 @@ ixgbe_netmap_rxsync(struct netmap_kring *kring, int flags)
|
||||
IXGBE_WRITE_REG(&adapter->hw, rxr->tail, nic_i);
|
||||
}
|
||||
|
||||
/* tell userspace that there might be new packets */
|
||||
nm_rxsync_finalize(kring);
|
||||
|
||||
return 0;
|
||||
|
||||
ring_reset:
|
||||
|
||||
@@ -60,7 +60,7 @@
|
||||
/*
|
||||
* $FreeBSD$
|
||||
*
|
||||
* netmap support for: ixgbe
|
||||
* netmap support for: ixv
|
||||
*
|
||||
* This file is meant to be a reference on how to implement
|
||||
* netmap support for a network driver.
|
||||
@@ -83,63 +83,17 @@
|
||||
/*
|
||||
* device-specific sysctl variables:
|
||||
*
|
||||
* ixv_crcstrip: 0: keep CRC in rx frames (default), 1: strip it.
|
||||
* During regular operations the CRC is stripped, but on some
|
||||
* hardware reception of frames not multiple of 64 is slower,
|
||||
* so using crcstrip=0 helps in benchmarks.
|
||||
*
|
||||
* ixv_rx_miss, ixv_rx_miss_bufs:
|
||||
* count packets that might be missed due to lost interrupts.
|
||||
*/
|
||||
SYSCTL_DECL(_dev_netmap);
|
||||
static int ixv_rx_miss, ixv_rx_miss_bufs;
|
||||
int ixv_crcstrip;
|
||||
SYSCTL_INT(_dev_netmap, OID_AUTO, ixv_crcstrip,
|
||||
CTLFLAG_RW, &ixv_crcstrip, 0, "strip CRC on rx frames");
|
||||
SYSCTL_INT(_dev_netmap, OID_AUTO, ixv_rx_miss,
|
||||
CTLFLAG_RW, &ixv_rx_miss, 0, "potentially missed rx intr");
|
||||
SYSCTL_INT(_dev_netmap, OID_AUTO, ixv_rx_miss_bufs,
|
||||
CTLFLAG_RW, &ixv_rx_miss_bufs, 0, "potentially missed rx intr bufs");
|
||||
|
||||
|
||||
static void
|
||||
set_crcstrip(struct ixgbe_hw *hw, int onoff)
|
||||
{
|
||||
/* crc stripping is set in two places:
|
||||
* IXGBE_HLREG0 (modified on init_locked and hw reset)
|
||||
* IXGBE_RDRXCTL (set by the original driver in
|
||||
* ixgbe_setup_hw_rsc() called in init_locked.
|
||||
* We disable the setting when netmap is compiled in).
|
||||
* We update the values here, but also in ixgbe.c because
|
||||
* init_locked sometimes is called outside our control.
|
||||
*/
|
||||
uint32_t hl, rxc;
|
||||
|
||||
hl = IXGBE_READ_REG(hw, IXGBE_HLREG0);
|
||||
rxc = IXGBE_READ_REG(hw, IXGBE_RDRXCTL);
|
||||
if (netmap_verbose)
|
||||
D("%s read HLREG 0x%x rxc 0x%x",
|
||||
onoff ? "enter" : "exit", hl, rxc);
|
||||
/* hw requirements ... */
|
||||
rxc &= ~IXGBE_RDRXCTL_RSCFRSTSIZE;
|
||||
rxc |= IXGBE_RDRXCTL_RSCACKC;
|
||||
if (onoff && !ixv_crcstrip) {
|
||||
/* keep the crc. Fast rx */
|
||||
hl &= ~IXGBE_HLREG0_RXCRCSTRP;
|
||||
rxc &= ~IXGBE_RDRXCTL_CRCSTRIP;
|
||||
} else {
|
||||
/* reset default mode */
|
||||
hl |= IXGBE_HLREG0_RXCRCSTRP;
|
||||
rxc |= IXGBE_RDRXCTL_CRCSTRIP;
|
||||
}
|
||||
if (netmap_verbose)
|
||||
D("%s write HLREG 0x%x rxc 0x%x",
|
||||
onoff ? "enter" : "exit", hl, rxc);
|
||||
IXGBE_WRITE_REG(hw, IXGBE_HLREG0, hl);
|
||||
IXGBE_WRITE_REG(hw, IXGBE_RDRXCTL, rxc);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Register/unregister. We are already under netmap lock.
|
||||
* Only called on the first register or the last unregister.
|
||||
@@ -153,7 +107,6 @@ ixv_netmap_reg(struct netmap_adapter *na, int onoff)
|
||||
IXGBE_CORE_LOCK(adapter);
|
||||
adapter->stop_locked(adapter);
|
||||
|
||||
set_crcstrip(&adapter->hw, onoff);
|
||||
/* enable or disable flags and callbacks in na and ifp */
|
||||
if (onoff) {
|
||||
nm_set_native_flags(na);
|
||||
@@ -161,7 +114,6 @@ ixv_netmap_reg(struct netmap_adapter *na, int onoff)
|
||||
nm_clear_native_flags(na);
|
||||
}
|
||||
adapter->init_locked(adapter); /* also enables intr */
|
||||
set_crcstrip(&adapter->hw, onoff); // XXX why twice ?
|
||||
IXGBE_CORE_UNLOCK(adapter);
|
||||
return (ifp->if_drv_flags & IFF_DRV_RUNNING ? 0 : 1);
|
||||
}
|
||||
@@ -338,7 +290,7 @@ ixv_netmap_txsync(struct netmap_kring *kring, int flags)
|
||||
* REPORT_STATUS in a few slots so TDH is the only
|
||||
* good way.
|
||||
*/
|
||||
nic_i = IXGBE_READ_REG(&adapter->hw, IXGBE_TDH(kring->ring_id));
|
||||
nic_i = IXGBE_READ_REG(&adapter->hw, IXGBE_VFTDH(kring->ring_id));
|
||||
if (nic_i >= kring->nkr_num_slots) { /* XXX can it happen ? */
|
||||
D("TDH wrap %d", nic_i);
|
||||
nic_i -= kring->nkr_num_slots;
|
||||
@@ -350,6 +302,8 @@ ixv_netmap_txsync(struct netmap_kring *kring, int flags)
|
||||
}
|
||||
}
|
||||
|
||||
nm_txsync_finalize(kring);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -377,7 +331,7 @@ ixv_netmap_rxsync(struct netmap_kring *kring, int flags)
|
||||
u_int nic_i; /* index into the NIC ring */
|
||||
u_int n;
|
||||
u_int const lim = kring->nkr_num_slots - 1;
|
||||
u_int const head = kring->rhead;
|
||||
u_int const head = nm_rxsync_prologue(kring);
|
||||
int force_update = (flags & NAF_FORCE_READ) || kring->nr_kflags & NKR_PENDINTR;
|
||||
|
||||
/* device-specific */
|
||||
@@ -407,7 +361,7 @@ ixv_netmap_rxsync(struct netmap_kring *kring, int flags)
|
||||
* rxr->next_to_check is set to 0 on a ring reinit
|
||||
*/
|
||||
if (netmap_no_pendintr || force_update) {
|
||||
int crclen = (ixv_crcstrip) ? 0 : 4;
|
||||
int crclen = 0;
|
||||
uint16_t slot_flags = kring->nkr_slot_flags;
|
||||
|
||||
nic_i = rxr->next_to_check; // or also k2n(kring->nr_hwtail)
|
||||
@@ -484,6 +438,9 @@ ixv_netmap_rxsync(struct netmap_kring *kring, int flags)
|
||||
IXGBE_WRITE_REG(&adapter->hw, rxr->tail, nic_i);
|
||||
}
|
||||
|
||||
/* tell userspace that there might be new packets */
|
||||
nm_rxsync_finalize(kring);
|
||||
|
||||
return 0;
|
||||
|
||||
ring_reset:
|
||||
|
||||
@@ -42,12 +42,10 @@
|
||||
#include <sys/selinfo.h>
|
||||
#include <dev/netmap/netmap_kern.h>
|
||||
|
||||
extern int ixv_crcstrip;
|
||||
|
||||
/*
|
||||
* ixgbe_netmap.c contains functions for netmap
|
||||
* ixv_netmap.c contains functions for netmap
|
||||
* support that extend the standard driver. See additional
|
||||
* comments in ixgbe_netmap.c.
|
||||
* comments in ixv_netmap.c.
|
||||
*/
|
||||
void ixv_netmap_attach(struct adapter *adapter);
|
||||
|
||||
|
||||
@@ -979,7 +979,7 @@ _mtx_init(volatile uintptr_t *c, const char *name, const char *type, int opts)
|
||||
m = mtxlock2mtx(c);
|
||||
|
||||
MPASS((opts & ~(MTX_SPIN | MTX_QUIET | MTX_RECURSE |
|
||||
MTX_NOWITNESS | MTX_DUPOK | MTX_NOPROFILE)) == 0);
|
||||
MTX_NOWITNESS | MTX_DUPOK | MTX_NOPROFILE | MTX_NEW)) == 0);
|
||||
ASSERT_ATOMIC_LOAD_PTR(m->mtx_lock,
|
||||
("%s: mtx_lock not aligned for %s: %p", __func__, name,
|
||||
&m->mtx_lock));
|
||||
@@ -1005,6 +1005,8 @@ _mtx_init(volatile uintptr_t *c, const char *name, const char *type, int opts)
|
||||
flags |= LO_DUPOK;
|
||||
if (opts & MTX_NOPROFILE)
|
||||
flags |= LO_NOPROFILE;
|
||||
if (opts & MTX_NEW)
|
||||
flags |= LO_NEW;
|
||||
|
||||
/* Initialize mutex. */
|
||||
lock_init(&m->lock_object, class, name, type, flags);
|
||||
|
||||
@@ -278,22 +278,28 @@ void
|
||||
rm_init_flags(struct rmlock *rm, const char *name, int opts)
|
||||
{
|
||||
struct lock_class *lc;
|
||||
int liflags;
|
||||
int liflags, xflags;
|
||||
|
||||
liflags = 0;
|
||||
if (!(opts & RM_NOWITNESS))
|
||||
liflags |= LO_WITNESS;
|
||||
if (opts & RM_RECURSE)
|
||||
liflags |= LO_RECURSABLE;
|
||||
if (opts & RM_NEW)
|
||||
liflags |= LO_NEW;
|
||||
rm->rm_writecpus = all_cpus;
|
||||
LIST_INIT(&rm->rm_activeReaders);
|
||||
if (opts & RM_SLEEPABLE) {
|
||||
liflags |= LO_SLEEPABLE;
|
||||
lc = &lock_class_rm_sleepable;
|
||||
sx_init_flags(&rm->rm_lock_sx, "rmlock_sx", SX_NOWITNESS);
|
||||
xflags = (opts & RM_NEW ? SX_NEW : 0);
|
||||
sx_init_flags(&rm->rm_lock_sx, "rmlock_sx",
|
||||
xflags | SX_NOWITNESS);
|
||||
} else {
|
||||
lc = &lock_class_rm;
|
||||
mtx_init(&rm->rm_lock_mtx, name, "rmlock_mtx", MTX_NOWITNESS);
|
||||
xflags = (opts & RM_NEW ? MTX_NEW : 0);
|
||||
mtx_init(&rm->rm_lock_mtx, name, "rmlock_mtx",
|
||||
xflags | MTX_NOWITNESS);
|
||||
}
|
||||
lock_init(&rm->lock_object, lc, name, NULL, liflags);
|
||||
}
|
||||
|
||||
@@ -216,7 +216,7 @@ _rw_init_flags(volatile uintptr_t *c, const char *name, int opts)
|
||||
rw = rwlock2rw(c);
|
||||
|
||||
MPASS((opts & ~(RW_DUPOK | RW_NOPROFILE | RW_NOWITNESS | RW_QUIET |
|
||||
RW_RECURSE)) == 0);
|
||||
RW_RECURSE | RW_NEW)) == 0);
|
||||
ASSERT_ATOMIC_LOAD_PTR(rw->rw_lock,
|
||||
("%s: rw_lock not aligned for %s: %p", __func__, name,
|
||||
&rw->rw_lock));
|
||||
@@ -232,6 +232,8 @@ _rw_init_flags(volatile uintptr_t *c, const char *name, int opts)
|
||||
flags |= LO_RECURSABLE;
|
||||
if (opts & RW_QUIET)
|
||||
flags |= LO_QUIET;
|
||||
if (opts & RW_NEW)
|
||||
flags |= LO_NEW;
|
||||
|
||||
lock_init(&rw->lock_object, &lock_class_rw, name, NULL, flags);
|
||||
rw->rw_lock = RW_UNLOCKED;
|
||||
|
||||
+3
-1
@@ -240,7 +240,7 @@ sx_init_flags(struct sx *sx, const char *description, int opts)
|
||||
int flags;
|
||||
|
||||
MPASS((opts & ~(SX_QUIET | SX_RECURSE | SX_NOWITNESS | SX_DUPOK |
|
||||
SX_NOPROFILE | SX_NOADAPTIVE)) == 0);
|
||||
SX_NOPROFILE | SX_NOADAPTIVE | SX_NEW)) == 0);
|
||||
ASSERT_ATOMIC_LOAD_PTR(sx->sx_lock,
|
||||
("%s: sx_lock not aligned for %s: %p", __func__, description,
|
||||
&sx->sx_lock));
|
||||
@@ -256,6 +256,8 @@ sx_init_flags(struct sx *sx, const char *description, int opts)
|
||||
flags |= LO_RECURSABLE;
|
||||
if (opts & SX_QUIET)
|
||||
flags |= LO_QUIET;
|
||||
if (opts & SX_NEW)
|
||||
flags |= LO_NEW;
|
||||
|
||||
flags |= opts & SX_NOADAPTIVE;
|
||||
lock_init(&sx->lock_object, &lock_class_sx, description, NULL, flags);
|
||||
|
||||
@@ -76,8 +76,8 @@ lock_init(struct lock_object *lock, struct lock_class *class, const char *name,
|
||||
int i;
|
||||
|
||||
/* Check for double-init and zero object. */
|
||||
KASSERT(!lock_initalized(lock), ("lock \"%s\" %p already initialized",
|
||||
name, lock));
|
||||
KASSERT(flags & LO_NEW || !lock_initalized(lock),
|
||||
("lock \"%s\" %p already initialized", name, lock));
|
||||
|
||||
/* Look up lock class to find its index. */
|
||||
for (i = 0; i < LOCK_CLASS_MAX; i++)
|
||||
|
||||
@@ -83,6 +83,7 @@ struct lock_class {
|
||||
#define LO_IS_VNODE 0x00800000 /* Tell WITNESS about a VNODE lock */
|
||||
#define LO_CLASSMASK 0x0f000000 /* Class index bitmask. */
|
||||
#define LO_NOPROFILE 0x10000000 /* Don't profile this lock */
|
||||
#define LO_NEW 0x20000000 /* Don't check for double-init */
|
||||
|
||||
/*
|
||||
* Lock classes are statically assigned an index into the gobal lock_classes
|
||||
|
||||
@@ -52,6 +52,7 @@
|
||||
#define MTX_RECURSE 0x00000004 /* Option: lock allowed to recurse */
|
||||
#define MTX_NOWITNESS 0x00000008 /* Don't do any witness checking. */
|
||||
#define MTX_NOPROFILE 0x00000020 /* Don't profile this lock */
|
||||
#define MTX_NEW 0x00000040 /* Don't check for double-init */
|
||||
|
||||
/*
|
||||
* Option flags passed to certain lock/unlock routines, through the use
|
||||
|
||||
+1
-1
@@ -58,7 +58,7 @@
|
||||
* in the range 5 to 9.
|
||||
*/
|
||||
#undef __FreeBSD_version
|
||||
#define __FreeBSD_version 1003516 /* Master, propagated to newvers */
|
||||
#define __FreeBSD_version 1004000 /* Master, propagated to newvers */
|
||||
|
||||
/*
|
||||
* __FreeBSD_kernel__ indicates that this system uses the kernel of FreeBSD,
|
||||
|
||||
@@ -45,6 +45,7 @@
|
||||
#define RM_NOWITNESS 0x00000001
|
||||
#define RM_RECURSE 0x00000002
|
||||
#define RM_SLEEPABLE 0x00000004
|
||||
#define RM_NEW 0x00000008
|
||||
|
||||
void rm_init(struct rmlock *rm, const char *name);
|
||||
void rm_init_flags(struct rmlock *rm, const char *name, int opts);
|
||||
|
||||
@@ -254,6 +254,7 @@ struct rw_args_flags {
|
||||
#define RW_NOWITNESS 0x04
|
||||
#define RW_QUIET 0x08
|
||||
#define RW_RECURSE 0x10
|
||||
#define RW_NEW 0x20
|
||||
|
||||
/*
|
||||
* The INVARIANTS-enabled rw_assert() functionality.
|
||||
|
||||
@@ -289,6 +289,7 @@ __sx_sunlock(struct sx *sx, const char *file, int line)
|
||||
#define SX_QUIET 0x08
|
||||
#define SX_NOADAPTIVE 0x10
|
||||
#define SX_RECURSE 0x20
|
||||
#define SX_NEW 0x40
|
||||
|
||||
/*
|
||||
* Options passed to sx_*lock_hard().
|
||||
|
||||
Reference in new issue
Block a user