svn commit: r302158 - in projects/vnet: . cddl/lib/libavl cddl/lib/libctf cddl/lib/libnvpair cddl/lib/libumem cddl/lib/libuutil etc/defaults lib/libusb sys/cddl/contrib/opensolaris/uts/common/fs/zf...
Bjoern A. Zeeb
bz at FreeBSD.org
Thu Jun 23 21:50:57 UTC 2016
Author: bz
Date: Thu Jun 23 21:50:52 2016
New Revision: 302158
URL: https://svnweb.freebsd.org/changeset/base/302158
Log:
MfH @r302157
merged the initial pf/pflog/pfsync changes
Sponsored by: The FreeBSD Foundation
Modified:
projects/vnet/UPDATING
projects/vnet/cddl/lib/libavl/Makefile
projects/vnet/cddl/lib/libctf/Makefile
projects/vnet/cddl/lib/libnvpair/Makefile
projects/vnet/cddl/lib/libumem/Makefile
projects/vnet/cddl/lib/libuutil/Makefile
projects/vnet/etc/defaults/rc.conf
projects/vnet/lib/libusb/Makefile
projects/vnet/lib/libusb/libusb.3
projects/vnet/lib/libusb/libusb.h
projects/vnet/lib/libusb/libusb10.c
projects/vnet/lib/libusb/libusb10.h
projects/vnet/lib/libusb/libusb10_io.c
projects/vnet/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c
projects/vnet/sys/dev/mlx5/mlx5_core/mlx5_vport.c
projects/vnet/sys/geom/geom_disk.c
projects/vnet/sys/geom/geom_disk.h
projects/vnet/sys/kern/uipc_shm.c
projects/vnet/sys/net/if_var.h
projects/vnet/sys/net/pfvar.h
projects/vnet/sys/netinet/in_pcb.h
projects/vnet/sys/netinet/sctp_usrreq.c
projects/vnet/sys/netinet/sctputil.c
projects/vnet/sys/netinet/tcp_subr.c
projects/vnet/sys/netinet6/sctp6_usrreq.c
projects/vnet/sys/netpfil/pf/pf.c
projects/vnet/sys/netpfil/pf/pf_if.c
projects/vnet/sys/sys/param.h
projects/vnet/sys/sys/socketvar.h
projects/vnet/sys/vm/vm_page.c
projects/vnet/sys/vm/vm_page.h
projects/vnet/sys/x86/acpica/acpi_wakeup.c
projects/vnet/tools/tools/makeroot/makeroot.sh
projects/vnet/usr.sbin/bsdinstall/partedit/partedit_x86.c
Directory Properties:
projects/vnet/ (props changed)
projects/vnet/cddl/ (props changed)
projects/vnet/sys/cddl/contrib/opensolaris/ (props changed)
Modified: projects/vnet/UPDATING
==============================================================================
--- projects/vnet/UPDATING Thu Jun 23 21:42:43 2016 (r302157)
+++ projects/vnet/UPDATING Thu Jun 23 21:50:52 2016 (r302158)
@@ -31,6 +31,14 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 11
disable the most expensive debugging functionality run
"ln -s 'abort:false,junk:false' /etc/malloc.conf".)
+20160622:
+ The libc stub for the pipe(2) system call has been replaced with
+ a wrapper which calls the pipe2(2) system call and the pipe(2) is now
+ only implemented by the kernels which include "options
+ COMPAT_FREEBSD10" in their config file (this is the default).
+ Users should ensure that this option is enabled in their kernel
+ or upgrade userspace to r302092 before upgrading their kernel.
+
20160527:
CAM will now strip leading spaces from SCSI disks' serial numbers.
This will effect users who create UFS filesystems on SCSI disks using
Modified: projects/vnet/cddl/lib/libavl/Makefile
==============================================================================
--- projects/vnet/cddl/lib/libavl/Makefile Thu Jun 23 21:42:43 2016 (r302157)
+++ projects/vnet/cddl/lib/libavl/Makefile Thu Jun 23 21:50:52 2016 (r302158)
@@ -4,7 +4,7 @@
LIB= avl
SRCS= avl.c
-WARNS?= 0
+WARNS?= 3
CFLAGS+= -I${.CURDIR}/../../../sys/cddl/compat/opensolaris
CFLAGS+= -I${.CURDIR}/../../../sys/cddl/contrib/opensolaris/uts/common
Modified: projects/vnet/cddl/lib/libctf/Makefile
==============================================================================
--- projects/vnet/cddl/lib/libctf/Makefile Thu Jun 23 21:42:43 2016 (r302157)
+++ projects/vnet/cddl/lib/libctf/Makefile Thu Jun 23 21:50:52 2016 (r302158)
@@ -18,7 +18,7 @@ SRCS= ctf_create.c \
ctf_util.c
MAN= ctf.5
-WARNS?= 0
+WARNS?= 2
CFLAGS+= -DCTF_OLD_VERSIONS
CFLAGS+= -I${.CURDIR}/../../../sys/cddl/compat/opensolaris \
Modified: projects/vnet/cddl/lib/libnvpair/Makefile
==============================================================================
--- projects/vnet/cddl/lib/libnvpair/Makefile Thu Jun 23 21:42:43 2016 (r302157)
+++ projects/vnet/cddl/lib/libnvpair/Makefile Thu Jun 23 21:50:52 2016 (r302158)
@@ -12,7 +12,7 @@ SRCS= libnvpair.c \
opensolaris_nvpair.c \
opensolaris_nvpair_alloc_fixed.c
-WARNS?= 0
+WARNS?= 1
CFLAGS+= -I${.CURDIR}/../../../cddl/compat/opensolaris/include
CFLAGS+= -I${.CURDIR}/../../../cddl/contrib/opensolaris/lib/libzpool/common
CFLAGS+= -I${.CURDIR}/../../../sys/cddl/compat/opensolaris
Modified: projects/vnet/cddl/lib/libumem/Makefile
==============================================================================
--- projects/vnet/cddl/lib/libumem/Makefile Thu Jun 23 21:42:43 2016 (r302157)
+++ projects/vnet/cddl/lib/libumem/Makefile Thu Jun 23 21:50:52 2016 (r302158)
@@ -4,7 +4,7 @@
LIB= umem
SRCS= umem.c
-WARNS?= 0
+WARNS?= 3
CFLAGS+= -I${.CURDIR}/../../../cddl/compat/opensolaris/lib/libumem
.include <bsd.lib.mk>
Modified: projects/vnet/cddl/lib/libuutil/Makefile
==============================================================================
--- projects/vnet/cddl/lib/libuutil/Makefile Thu Jun 23 21:42:43 2016 (r302157)
+++ projects/vnet/cddl/lib/libuutil/Makefile Thu Jun 23 21:50:52 2016 (r302158)
@@ -15,7 +15,7 @@ SRCS= avl.c \
uu_pname.c \
uu_strtoint.c
-WARNS?= 0
+WARNS?= 1
CFLAGS+= -DNATIVE_BUILD
CFLAGS+= -I${.CURDIR}/../../../cddl/contrib/opensolaris/lib/libuutil/common
CFLAGS+= -I${.CURDIR}/../../../sys/cddl/compat/opensolaris
Modified: projects/vnet/etc/defaults/rc.conf
==============================================================================
--- projects/vnet/etc/defaults/rc.conf Thu Jun 23 21:42:43 2016 (r302157)
+++ projects/vnet/etc/defaults/rc.conf Thu Jun 23 21:50:52 2016 (r302158)
@@ -741,3 +741,9 @@ if [ -z "${source_rc_confs_defined}" ];
done
}
fi
+
+# Allow vendors to override FreeBSD defaults in /etc/default/rc.conf
+# without the need to carefully manage /etc/rc.conf.
+if [ -r /etc/defaults/vendor.conf ]; then
+ . /etc/defaults/vendor.conf
+fi
Modified: projects/vnet/lib/libusb/Makefile
==============================================================================
--- projects/vnet/lib/libusb/Makefile Thu Jun 23 21:42:43 2016 (r302157)
+++ projects/vnet/lib/libusb/Makefile Thu Jun 23 21:50:52 2016 (r302158)
@@ -120,8 +120,12 @@ MLINKS += libusb.3 libusb_get_ss_usb_dev
MLINKS += libusb.3 libusb_free_ss_usb_device_capability_descriptor.3
MLINKS += libusb.3 libusb_get_container_id_descriptor.3
MLINKS += libusb.3 libusb_free_container_id_descriptor.3
+MLINKS += libusb.3 libusb_alloc_streams.3
+MLINKS += libusb.3 libusb_free_streams.3
MLINKS += libusb.3 libusb_alloc_transfer.3
MLINKS += libusb.3 libusb_free_transfer.3
+MLINKS += libusb.3 libusb_transfer_set_stream_id.3
+MLINKS += libusb.3 libusb_transfer_get_stream_id.3
MLINKS += libusb.3 libusb_submit_transfer.3
MLINKS += libusb.3 libusb_cancel_transfer.3
MLINKS += libusb.3 libusb_control_transfer.3
Modified: projects/vnet/lib/libusb/libusb.3
==============================================================================
--- projects/vnet/lib/libusb/libusb.3 Thu Jun 23 21:42:43 2016 (r302157)
+++ projects/vnet/lib/libusb/libusb.3 Thu Jun 23 21:50:52 2016 (r302158)
@@ -26,7 +26,7 @@
.\"
.\" $FreeBSD$
.\"
-.Dd June 22, 2016
+.Dd June 23, 2016
.Dt LIBUSB 3
.Os
.Sh NAME
@@ -521,6 +521,29 @@ if the transfer timed out, LIBUSB_ERROR_
supported, LIBUSB_ERROR_OVERFLOW if the device offered more data,
LIBUSB_ERROR_NO_DEVICE if the device has been disconnected and
a LIBUSB_ERROR code on other failure.
+.Sh USB STREAMS SUPPORT
+.Ft int
+.Fn libusb_alloc_streams "libusb_device_handle *dev" "uint32_t num_streams" "unsigned char *endpoints" "int num_endpoints"
+This function verifies that the given number of streams using the
+given number of endpoints is allowed and allocates the resources
+needed to use so-called USB streams.
+Currently only a single stream per endpoint is supported to simplify
+the internals of LibUSB.
+This function returns 0 on success or a LIBUSB_ERROR code on failure.
+.Pp
+.Ft int
+.Fn libusb_free_streams "libusb_device_handle *dev" "unsigned char *endpoints" "int num_endpoints"
+This function release resources needed for streams usage.
+Returns 0 on success or a LIBUSB_ERROR code on failure.
+.Pp
+.Ft void
+.Fn libusb_transfer_set_stream_id "struct libusb_transfer *transfer" "uint32_t stream_id"
+This function sets the stream ID for the given USB transfer.
+.Pp
+.Ft uint32_t
+.Fn libusb_transfer_get_stream_id "struct libusb_transfer *transfer"
+This function returns the stream ID for the given USB transfer.
+If no stream ID is used a value of zero is returned.
.Sh USB EVENTS
.Ft int
.Fn libusb_try_lock_events "libusb_context *ctx"
Modified: projects/vnet/lib/libusb/libusb.h
==============================================================================
--- projects/vnet/lib/libusb/libusb.h Thu Jun 23 21:42:43 2016 (r302157)
+++ projects/vnet/lib/libusb/libusb.h Thu Jun 23 21:50:52 2016 (r302158)
@@ -561,6 +561,13 @@ typedef int (*libusb_hotplug_callback_fn
int libusb_hotplug_register_callback(libusb_context *ctx, libusb_hotplug_event events, libusb_hotplug_flag flags, int vendor_id, int product_id, int dev_class, libusb_hotplug_callback_fn cb_fn, void *user_data, libusb_hotplug_callback_handle *handle);
void libusb_hotplug_deregister_callback(libusb_context *ctx, libusb_hotplug_callback_handle handle);
+/* Streams support */
+
+int libusb_alloc_streams(libusb_device_handle *dev, uint32_t num_streams, unsigned char *endpoints, int num_endpoints);
+int libusb_free_streams(libusb_device_handle *dev, unsigned char *endpoints, int num_endpoints);
+void libusb_transfer_set_stream_id(struct libusb_transfer *transfer, uint32_t stream_id);
+uint32_t libusb_transfer_get_stream_id(struct libusb_transfer *transfer);
+
#if 0
{ /* indent fix */
#endif
Modified: projects/vnet/lib/libusb/libusb10.c
==============================================================================
--- projects/vnet/lib/libusb/libusb10.c Thu Jun 23 21:42:43 2016 (r302157)
+++ projects/vnet/lib/libusb/libusb10.c Thu Jun 23 21:50:52 2016 (r302158)
@@ -1403,7 +1403,8 @@ found:
maxframe = libusb10_get_maxframe(pdev, uxfer);
/* make sure the transfer is opened */
- err = libusb20_tr_open(pxfer0, buffsize, maxframe, endpoint);
+ err = libusb20_tr_open_stream(pxfer0, buffsize, maxframe,
+ endpoint, sxfer->stream_id);
if (err && (err != LIBUSB20_ERROR_BUSY)) {
goto failure;
}
Modified: projects/vnet/lib/libusb/libusb10.h
==============================================================================
--- projects/vnet/lib/libusb/libusb10.h Thu Jun 23 21:42:43 2016 (r302157)
+++ projects/vnet/lib/libusb/libusb10.h Thu Jun 23 21:50:52 2016 (r302158)
@@ -69,6 +69,7 @@ struct libusb_super_transfer {
uint8_t *curr_data;
uint32_t rem_len;
uint32_t last_len;
+ uint32_t stream_id;
uint8_t state;
#define LIBUSB_SUPER_XFER_ST_NONE 0
#define LIBUSB_SUPER_XFER_ST_PEND 1
Modified: projects/vnet/lib/libusb/libusb10_io.c
==============================================================================
--- projects/vnet/lib/libusb/libusb10_io.c Thu Jun 23 21:42:43 2016 (r302157)
+++ projects/vnet/lib/libusb/libusb10_io.c Thu Jun 23 21:50:52 2016 (r302158)
@@ -767,3 +767,48 @@ libusb_fill_iso_transfer(struct libusb_t
transfer->callback = callback;
}
+int
+libusb_alloc_streams(libusb_device_handle *dev, uint32_t num_streams,
+ unsigned char *endpoints, int num_endpoints)
+{
+ if (num_streams > 1)
+ return (LIBUSB_ERROR_INVALID_PARAM);
+ return (0);
+}
+
+int
+libusb_free_streams(libusb_device_handle *dev, unsigned char *endpoints, int num_endpoints)
+{
+
+ return (0);
+}
+
+void
+libusb_transfer_set_stream_id(struct libusb_transfer *transfer, uint32_t stream_id)
+{
+ struct libusb_super_transfer *sxfer;
+
+ if (transfer == NULL)
+ return;
+
+ sxfer = (struct libusb_super_transfer *)(
+ ((uint8_t *)transfer) - sizeof(*sxfer));
+
+ /* set stream ID */
+ sxfer->stream_id = stream_id;
+}
+
+uint32_t
+libusb_transfer_get_stream_id(struct libusb_transfer *transfer)
+{
+ struct libusb_super_transfer *sxfer;
+
+ if (transfer == NULL)
+ return (0);
+
+ sxfer = (struct libusb_super_transfer *)(
+ ((uint8_t *)transfer) - sizeof(*sxfer));
+
+ /* get stream ID */
+ return (sxfer->stream_id);
+}
Modified: projects/vnet/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c
==============================================================================
--- projects/vnet/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c Thu Jun 23 21:42:43 2016 (r302157)
+++ projects/vnet/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c Thu Jun 23 21:50:52 2016 (r302158)
@@ -1430,6 +1430,7 @@ static int
getzfsvfs(const char *dsname, zfsvfs_t **zfvp)
{
objset_t *os;
+ vfs_t *vfsp;
int error;
error = dmu_objset_hold(dsname, FTAG, &os);
@@ -1443,19 +1444,21 @@ getzfsvfs(const char *dsname, zfsvfs_t *
mutex_enter(&os->os_user_ptr_lock);
*zfvp = dmu_objset_get_user(os);
if (*zfvp) {
-#ifdef illumos
- VFS_HOLD((*zfvp)->z_vfs);
-#else
- if (vfs_busy((*zfvp)->z_vfs, 0) != 0) {
- *zfvp = NULL;
- error = SET_ERROR(ESRCH);
- }
-#endif
+ vfsp = (*zfvp)->z_vfs;
+ vfs_ref(vfsp);
} else {
error = SET_ERROR(ESRCH);
}
mutex_exit(&os->os_user_ptr_lock);
dmu_objset_rele(os, FTAG);
+ if (error == 0) {
+ error = vfs_busy(vfsp, 0);
+ vfs_rel(vfsp);
+ if (error != 0) {
+ *zfvp = NULL;
+ error = SET_ERROR(ESRCH);
+ }
+ }
return (error);
}
Modified: projects/vnet/sys/dev/mlx5/mlx5_core/mlx5_vport.c
==============================================================================
--- projects/vnet/sys/dev/mlx5/mlx5_core/mlx5_vport.c Thu Jun 23 21:42:43 2016 (r302157)
+++ projects/vnet/sys/dev/mlx5/mlx5_core/mlx5_vport.c Thu Jun 23 21:50:52 2016 (r302158)
@@ -71,7 +71,7 @@ static int mlx5_query_nic_vport_context(
int mlx5_vport_alloc_q_counter(struct mlx5_core_dev *mdev, int *counter_set_id)
{
u32 in[MLX5_ST_SZ_DW(alloc_q_counter_in)];
- u32 out[MLX5_ST_SZ_DW(alloc_q_counter_in)];
+ u32 out[MLX5_ST_SZ_DW(alloc_q_counter_out)];
int err;
memset(in, 0, sizeof(in));
Modified: projects/vnet/sys/geom/geom_disk.c
==============================================================================
--- projects/vnet/sys/geom/geom_disk.c Thu Jun 23 21:42:43 2016 (r302157)
+++ projects/vnet/sys/geom/geom_disk.c Thu Jun 23 21:50:52 2016 (r302158)
@@ -670,7 +670,7 @@ g_disk_create(void *arg, int flag)
g_topology_assert();
dp = arg;
- mtx_lock(&dp->d_mtx);
+ mtx_pool_lock(mtxpool_sleep, dp);
dp->d_init_level = DISK_INIT_START;
/*
@@ -678,12 +678,12 @@ g_disk_create(void *arg, int flag)
* call the user's callback to tell him we've cleaned things up.
*/
if (dp->d_goneflag != 0) {
- mtx_unlock(&dp->d_mtx);
+ mtx_pool_unlock(mtxpool_sleep, dp);
if (dp->d_gone != NULL)
dp->d_gone(dp);
return;
}
- mtx_unlock(&dp->d_mtx);
+ mtx_pool_unlock(mtxpool_sleep, dp);
sc = g_malloc(sizeof(*sc), M_WAITOK | M_ZERO);
mtx_init(&sc->start_mtx, "g_disk_start", NULL, MTX_DEF);
@@ -721,7 +721,7 @@ g_disk_create(void *arg, int flag)
dp->d_geom = gp;
g_error_provider(pp, 0);
- mtx_lock(&dp->d_mtx);
+ mtx_pool_lock(mtxpool_sleep, dp);
dp->d_init_level = DISK_INIT_DONE;
/*
@@ -729,11 +729,11 @@ g_disk_create(void *arg, int flag)
* process for it.
*/
if (dp->d_goneflag != 0) {
- mtx_unlock(&dp->d_mtx);
+ mtx_pool_unlock(mtxpool_sleep, dp);
g_wither_provider(pp, ENXIO);
return;
}
- mtx_unlock(&dp->d_mtx);
+ mtx_pool_unlock(mtxpool_sleep, dp);
}
@@ -786,8 +786,6 @@ g_disk_destroy(void *ptr, int flag)
g_wither_geom(gp, ENXIO);
}
- mtx_destroy(&dp->d_mtx);
-
g_free(dp);
}
@@ -852,9 +850,6 @@ disk_create(struct disk *dp, int version
DEVSTAT_TYPE_DIRECT, DEVSTAT_PRIORITY_MAX);
dp->d_geom = NULL;
- snprintf(dp->d_mtx_name, sizeof(dp->d_mtx_name), "%s%ddlk",
- dp->d_name, dp->d_unit);
- mtx_init(&dp->d_mtx, dp->d_mtx_name, NULL, MTX_DEF);
dp->d_init_level = DISK_INIT_NONE;
g_disk_ident_adjust(dp->d_ident, sizeof(dp->d_ident));
@@ -878,7 +873,7 @@ disk_gone(struct disk *dp)
struct g_geom *gp;
struct g_provider *pp;
- mtx_lock(&dp->d_mtx);
+ mtx_pool_lock(mtxpool_sleep, dp);
dp->d_goneflag = 1;
/*
@@ -897,10 +892,10 @@ disk_gone(struct disk *dp)
* has not been fully setup in any case.
*/
if (dp->d_init_level < DISK_INIT_DONE) {
- mtx_unlock(&dp->d_mtx);
+ mtx_pool_unlock(mtxpool_sleep, dp);
return;
}
- mtx_unlock(&dp->d_mtx);
+ mtx_pool_unlock(mtxpool_sleep, dp);
gp = dp->d_geom;
if (gp != NULL) {
Modified: projects/vnet/sys/geom/geom_disk.h
==============================================================================
--- projects/vnet/sys/geom/geom_disk.h Thu Jun 23 21:42:43 2016 (r302157)
+++ projects/vnet/sys/geom/geom_disk.h Thu Jun 23 21:50:52 2016 (r302158)
@@ -72,8 +72,6 @@ struct disk {
struct devstat *d_devstat;
int d_goneflag;
int d_destroyed;
- struct mtx d_mtx;
- char d_mtx_name[24];
disk_init_level d_init_level;
/* Shared fields */
Modified: projects/vnet/sys/kern/uipc_shm.c
==============================================================================
--- projects/vnet/sys/kern/uipc_shm.c Thu Jun 23 21:42:43 2016 (r302157)
+++ projects/vnet/sys/kern/uipc_shm.c Thu Jun 23 21:50:52 2016 (r302158)
@@ -295,14 +295,14 @@ shm_read(struct file *fp, struct uio *ui
int error;
shmfd = fp->f_data;
- foffset_lock_uio(fp, uio, flags);
- rl_cookie = rangelock_rlock(&shmfd->shm_rl, uio->uio_offset,
- uio->uio_offset + uio->uio_resid, &shmfd->shm_mtx);
#ifdef MAC
error = mac_posixshm_check_read(active_cred, fp->f_cred, shmfd);
if (error)
return (error);
#endif
+ foffset_lock_uio(fp, uio, flags);
+ rl_cookie = rangelock_rlock(&shmfd->shm_rl, uio->uio_offset,
+ uio->uio_offset + uio->uio_resid, &shmfd->shm_mtx);
error = uiomove_object(shmfd->shm_object, shmfd->shm_size, uio);
rangelock_unlock(&shmfd->shm_rl, rl_cookie, &shmfd->shm_mtx);
foffset_unlock_uio(fp, uio, flags);
Modified: projects/vnet/sys/net/if_var.h
==============================================================================
--- projects/vnet/sys/net/if_var.h Thu Jun 23 21:42:43 2016 (r302157)
+++ projects/vnet/sys/net/if_var.h Thu Jun 23 21:50:52 2016 (r302158)
@@ -311,6 +311,8 @@ struct ifnet {
* that structure can be enhanced without changing the kernel
* binary interface.
*/
+ void *if_pspare[4]; /* packet pacing / general use */
+ int if_ispare[4]; /* packet pacing / general use */
};
/* for compatibility with other BSDs */
Modified: projects/vnet/sys/net/pfvar.h
==============================================================================
--- projects/vnet/sys/net/pfvar.h Thu Jun 23 21:42:43 2016 (r302157)
+++ projects/vnet/sys/net/pfvar.h Thu Jun 23 21:50:52 2016 (r302158)
@@ -835,7 +835,6 @@ typedef int pflog_packet_t(struct pfi_ki
struct pf_ruleset *, struct pf_pdesc *, int);
extern pflog_packet_t *pflog_packet_ptr;
-#define V_pf_end_threads VNET(pf_end_threads)
#endif /* _KERNEL */
#define PFSYNC_FLAG_SRCNODE 0x04
Modified: projects/vnet/sys/netinet/in_pcb.h
==============================================================================
--- projects/vnet/sys/netinet/in_pcb.h Thu Jun 23 21:42:43 2016 (r302157)
+++ projects/vnet/sys/netinet/in_pcb.h Thu Jun 23 21:50:52 2016 (r302158)
@@ -202,10 +202,10 @@ struct inpcb {
u_char inp_ip_minttl; /* (i) minimum TTL or drop */
uint32_t inp_flowid; /* (x) flow id / queue id */
u_int inp_refcount; /* (i) refcount */
- void *inp_pspare[5]; /* (x) route caching / general use */
+ void *inp_pspare[5]; /* (x) packet pacing / general use */
uint32_t inp_flowtype; /* (x) M_HASHTYPE value */
uint32_t inp_rss_listen_bucket; /* (x) overridden RSS listen bucket */
- u_int inp_ispare[4]; /* (x) route caching / user cookie /
+ u_int inp_ispare[4]; /* (x) packet pacing / user cookie /
* general use */
/* Local and foreign ports, local and foreign addr. */
Modified: projects/vnet/sys/netinet/sctp_usrreq.c
==============================================================================
--- projects/vnet/sys/netinet/sctp_usrreq.c Thu Jun 23 21:42:43 2016 (r302157)
+++ projects/vnet/sys/netinet/sctp_usrreq.c Thu Jun 23 21:50:52 2016 (r302158)
@@ -291,8 +291,7 @@ sctp_ctlinput(int cmd, struct sockaddr *
SCTP_DEFAULT_VRFID);
if ((stcb != NULL) &&
(net != NULL) &&
- (inp != NULL) &&
- (inp->sctp_socket != NULL)) {
+ (inp != NULL)) {
/* Check the verification tag */
if (ntohl(sh->v_tag) != 0) {
/*
Modified: projects/vnet/sys/netinet/sctputil.c
==============================================================================
--- projects/vnet/sys/netinet/sctputil.c Thu Jun 23 21:42:43 2016 (r302157)
+++ projects/vnet/sys/netinet/sctputil.c Thu Jun 23 21:50:52 2016 (r302158)
@@ -5274,8 +5274,14 @@ restart_nosblocks:
}
}
}
- if ((so->so_rcv.sb_cc <= held_length) && block_allowed) {
- /* we need to wait for data */
+ if (so->so_rcv.sb_cc <= held_length) {
+ if (so->so_error) {
+ error = so->so_error;
+ if ((in_flags & MSG_PEEK) == 0) {
+ so->so_error = 0;
+ }
+ goto out;
+ }
if ((so->so_rcv.sb_cc == 0) &&
((inp->sctp_flags & SCTP_PCB_FLAGS_TCPTYPE) ||
(inp->sctp_flags & SCTP_PCB_FLAGS_IN_TCPPOOL))) {
@@ -5306,51 +5312,18 @@ restart_nosblocks:
goto out;
}
}
- error = sbwait(&so->so_rcv);
- if (error) {
- goto out;
- }
- held_length = 0;
- goto restart_nosblocks;
- } else if (so->so_rcv.sb_cc == 0) {
- if (so->so_error) {
- error = so->so_error;
- if ((in_flags & MSG_PEEK) == 0)
- so->so_error = 0;
- } else {
- if ((inp->sctp_flags & SCTP_PCB_FLAGS_TCPTYPE) ||
- (inp->sctp_flags & SCTP_PCB_FLAGS_IN_TCPPOOL)) {
- if ((inp->sctp_flags & SCTP_PCB_FLAGS_CONNECTED) == 0) {
- /*
- * For active open side clear flags
- * for re-use passive open is
- * blocked by connect.
- */
- if (inp->sctp_flags & SCTP_PCB_FLAGS_WAS_ABORTED) {
- /*
- * You were aborted, passive
- * side always hits here
- */
- SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTPUTIL, ECONNRESET);
- error = ECONNRESET;
- }
- so->so_state &= ~(SS_ISCONNECTING |
- SS_ISDISCONNECTING |
- SS_ISCONFIRMING |
- SS_ISCONNECTED);
- if (error == 0) {
- if ((inp->sctp_flags & SCTP_PCB_FLAGS_WAS_CONNECTED) == 0) {
- SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTPUTIL, ENOTCONN);
- error = ENOTCONN;
- }
- }
- goto out;
- }
+ if (block_allowed) {
+ error = sbwait(&so->so_rcv);
+ if (error) {
+ goto out;
}
+ held_length = 0;
+ goto restart_nosblocks;
+ } else {
SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTPUTIL, EWOULDBLOCK);
error = EWOULDBLOCK;
+ goto out;
}
- goto out;
}
if (hold_sblock == 1) {
SOCKBUF_UNLOCK(&so->so_rcv);
@@ -6965,8 +6938,7 @@ sctp_recv_icmp_tunneled_packet(int cmd,
SCTP_DEFAULT_VRFID);
if ((stcb != NULL) &&
(net != NULL) &&
- (inp != NULL) &&
- (inp->sctp_socket != NULL)) {
+ (inp != NULL)) {
/* Check the UDP port numbers */
if ((udp->uh_dport != net->port) ||
(udp->uh_sport != htons(SCTP_BASE_SYSCTL(sctp_udp_tunneling_port)))) {
@@ -7092,8 +7064,7 @@ sctp_recv_icmp6_tunneled_packet(int cmd,
&inp, &net, 1, SCTP_DEFAULT_VRFID);
if ((stcb != NULL) &&
(net != NULL) &&
- (inp != NULL) &&
- (inp->sctp_socket != NULL)) {
+ (inp != NULL)) {
/* Check the UDP port numbers */
if ((udp.uh_dport != net->port) ||
(udp.uh_sport != htons(SCTP_BASE_SYSCTL(sctp_udp_tunneling_port)))) {
Modified: projects/vnet/sys/netinet/tcp_subr.c
==============================================================================
--- projects/vnet/sys/netinet/tcp_subr.c Thu Jun 23 21:42:43 2016 (r302157)
+++ projects/vnet/sys/netinet/tcp_subr.c Thu Jun 23 21:50:52 2016 (r302158)
@@ -738,12 +738,14 @@ tcp_destroy(void *unused __unused)
* up, which means, we should be past the tcp_discardcb() calls.
* Sleep to let all tcpcb timers really disappear and cleanup.
*/
- do {
- pause("tcpdes", hz/10);
+ for (;;) {
INP_LIST_RLOCK(&V_tcbinfo);
n = V_tcbinfo.ipi_count;
INP_LIST_RUNLOCK(&V_tcbinfo);
- } while (n != 0);
+ if (n == 0)
+ break;
+ pause("tcpdes", hz / 10);
+ }
tcp_hc_destroy();
syncache_destroy();
tcp_tw_destroy();
Modified: projects/vnet/sys/netinet6/sctp6_usrreq.c
==============================================================================
--- projects/vnet/sys/netinet6/sctp6_usrreq.c Thu Jun 23 21:42:43 2016 (r302157)
+++ projects/vnet/sys/netinet6/sctp6_usrreq.c Thu Jun 23 21:50:52 2016 (r302158)
@@ -341,8 +341,7 @@ sctp6_ctlinput(int cmd, struct sockaddr
&inp, &net, 1, SCTP_DEFAULT_VRFID);
if ((stcb != NULL) &&
(net != NULL) &&
- (inp != NULL) &&
- (inp->sctp_socket != NULL)) {
+ (inp != NULL)) {
/* Check the verification tag */
if (ntohl(sh.v_tag) != 0) {
/*
Modified: projects/vnet/sys/netpfil/pf/pf.c
==============================================================================
--- projects/vnet/sys/netpfil/pf/pf.c Thu Jun 23 21:42:43 2016 (r302157)
+++ projects/vnet/sys/netpfil/pf/pf.c Thu Jun 23 21:50:52 2016 (r302158)
@@ -1436,6 +1436,7 @@ pf_purge_thread(void *unused __unused)
CURVNET_SET(vnet_iter);
if (pf_end_threads) {
+ pf_end_threads++;
wakeup(pf_purge_thread);
kproc_exit(0);
}
Modified: projects/vnet/sys/netpfil/pf/pf_if.c
==============================================================================
--- projects/vnet/sys/netpfil/pf/pf_if.c Thu Jun 23 21:42:43 2016 (r302157)
+++ projects/vnet/sys/netpfil/pf/pf_if.c Thu Jun 23 21:50:52 2016 (r302158)
@@ -802,7 +802,7 @@ pfi_attach_ifnet_event(void *arg __unuse
CURVNET_SET(ifp->if_vnet);
if (V_pf_vnet_active == 0) {
- /* Avoid teardown race in the least expensie way. */
+ /* Avoid teardown race in the least expensive way. */
CURVNET_RESTORE();
return;
}
@@ -825,7 +825,7 @@ pfi_detach_ifnet_event(void *arg __unuse
CURVNET_SET(ifp->if_vnet);
if (V_pf_vnet_active == 0) {
- /* Avoid teardown race in the least expensie way. */
+ /* Avoid teardown race in the least expensive way. */
CURVNET_RESTORE();
return;
}
@@ -848,7 +848,7 @@ pfi_attach_group_event(void *arg , struc
CURVNET_SET((struct vnet *)arg);
if (V_pf_vnet_active == 0) {
- /* Avoid teardown race in the least expensie way. */
+ /* Avoid teardown race in the least expensive way. */
CURVNET_RESTORE();
return;
}
@@ -863,7 +863,7 @@ pfi_change_group_event(void *arg, char *
CURVNET_SET((struct vnet *)arg);
if (V_pf_vnet_active == 0) {
- /* Avoid teardown race in the least expensie way. */
+ /* Avoid teardown race in the least expensive way. */
CURVNET_RESTORE();
return;
}
@@ -887,7 +887,7 @@ pfi_detach_group_event(void *arg, struct
CURVNET_SET((struct vnet *)arg);
if (V_pf_vnet_active == 0) {
- /* Avoid teardown race in the least expensie way. */
+ /* Avoid teardown race in the least expensive way. */
CURVNET_RESTORE();
return;
}
@@ -908,7 +908,7 @@ pfi_ifaddr_event(void *arg __unused, str
CURVNET_SET(ifp->if_vnet);
if (V_pf_vnet_active == 0) {
- /* Avoid teardown race in the least expensie way. */
+ /* Avoid teardown race in the least expensive way. */
CURVNET_RESTORE();
return;
}
Modified: projects/vnet/sys/sys/param.h
==============================================================================
--- projects/vnet/sys/sys/param.h Thu Jun 23 21:42:43 2016 (r302157)
+++ projects/vnet/sys/sys/param.h Thu Jun 23 21:50:52 2016 (r302158)
@@ -58,7 +58,7 @@
* in the range 5 to 9.
*/
#undef __FreeBSD_version
-#define __FreeBSD_version 1100118 /* Master, propagated to newvers */
+#define __FreeBSD_version 1100120 /* Master, propagated to newvers */
/*
* __FreeBSD_kernel__ indicates that this system uses the kernel of FreeBSD,
Modified: projects/vnet/sys/sys/socketvar.h
==============================================================================
--- projects/vnet/sys/sys/socketvar.h Thu Jun 23 21:42:43 2016 (r302157)
+++ projects/vnet/sys/sys/socketvar.h Thu Jun 23 21:50:52 2016 (r302158)
@@ -126,6 +126,9 @@ struct socket {
*/
int so_fibnum; /* routing domain for this socket */
uint32_t so_user_cookie;
+
+ void *so_pspare[2]; /* packet pacing / general use */
+ int so_ispare[2]; /* packet pacing / general use */
};
/*
Modified: projects/vnet/sys/vm/vm_page.c
==============================================================================
--- projects/vnet/sys/vm/vm_page.c Thu Jun 23 21:42:43 2016 (r302157)
+++ projects/vnet/sys/vm/vm_page.c Thu Jun 23 21:50:52 2016 (r302158)
@@ -760,17 +760,36 @@ vm_page_trysbusy(vm_page_t m)
}
static void
+vm_page_xunbusy_locked(vm_page_t m)
+{
+
+ vm_page_assert_xbusied(m);
+ vm_page_assert_locked(m);
+
+ atomic_store_rel_int(&m->busy_lock, VPB_UNBUSIED);
+ /* There is a waiter, do wakeup() instead of vm_page_flash(). */
+ wakeup(m);
+}
+
+static void
vm_page_xunbusy_maybelocked(vm_page_t m)
{
bool lockacq;
vm_page_assert_xbusied(m);
+ /*
+ * Fast path for unbusy. If it succeeds, we know that there
+ * are no waiters, so we do not need a wakeup.
+ */
+ if (atomic_cmpset_rel_int(&m->busy_lock, VPB_SINGLE_EXCLUSIVER,
+ VPB_UNBUSIED))
+ return;
+
lockacq = !mtx_owned(vm_page_lockptr(m));
if (lockacq)
vm_page_lock(m);
- vm_page_flash(m);
- atomic_store_rel_int(&m->busy_lock, VPB_UNBUSIED);
+ vm_page_xunbusy_locked(m);
if (lockacq)
vm_page_unlock(m);
}
@@ -788,8 +807,7 @@ vm_page_xunbusy_hard(vm_page_t m)
vm_page_assert_xbusied(m);
vm_page_lock(m);
- atomic_store_rel_int(&m->busy_lock, VPB_UNBUSIED);
- wakeup(m);
+ vm_page_xunbusy_locked(m);
vm_page_unlock(m);
}
Modified: projects/vnet/sys/vm/vm_page.h
==============================================================================
--- projects/vnet/sys/vm/vm_page.h Thu Jun 23 21:42:43 2016 (r302157)
+++ projects/vnet/sys/vm/vm_page.h Thu Jun 23 21:50:52 2016 (r302158)
@@ -552,6 +552,7 @@ void vm_page_lock_assert_KBI(vm_page_t m
(m)); \
} while (0)
+/* Note: page m's lock must not be owned by the caller. */
#define vm_page_xunbusy(m) do { \
if (!atomic_cmpset_rel_int(&(m)->busy_lock, \
VPB_SINGLE_EXCLUSIVER, VPB_UNBUSIED)) \
Modified: projects/vnet/sys/x86/acpica/acpi_wakeup.c
==============================================================================
--- projects/vnet/sys/x86/acpica/acpi_wakeup.c Thu Jun 23 21:42:43 2016 (r302157)
+++ projects/vnet/sys/x86/acpica/acpi_wakeup.c Thu Jun 23 21:50:52 2016 (r302158)
@@ -322,7 +322,7 @@ acpi_alloc_wakeup_handler(void)
* page-aligned.
*/
wakeaddr = contigmalloc((ACPI_PAGETABLES + 1) * PAGE_SIZE, M_DEVBUF,
- M_WAITOK, 0x500, 0xa0000, PAGE_SIZE, 0ul);
+ M_NOWAIT, 0x500, 0xa0000, PAGE_SIZE, 0ul);
if (wakeaddr == NULL) {
printf("%s: can't alloc wake memory\n", __func__);
return (NULL);
Modified: projects/vnet/tools/tools/makeroot/makeroot.sh
==============================================================================
--- projects/vnet/tools/tools/makeroot/makeroot.sh Thu Jun 23 21:42:43 2016 (r302157)
+++ projects/vnet/tools/tools/makeroot/makeroot.sh Thu Jun 23 21:50:52 2016 (r302158)
@@ -238,5 +238,9 @@ if [ -n "${SIZE}" ]; then
SIZEFLAG="-s ${SIZE}"
fi
+# Zero out subsecond component of time= keywords as they are currently not
+# supported by makefs
+sed -i '' -E 's/(time=[0-9]*)\.[0-9]*/\1.0/' ${manifest}
+
cd ${BSDROOT}; makefs ${DUPFLAG} -N ${DBDIR} ${SIZEFLAG} ${BFLAG} \
-t ffs ${LABELFLAG} -f 256 ${IMGFILE} ${manifest}
Modified: projects/vnet/usr.sbin/bsdinstall/partedit/partedit_x86.c
==============================================================================
--- projects/vnet/usr.sbin/bsdinstall/partedit/partedit_x86.c Thu Jun 23 21:42:43 2016 (r302157)
+++ projects/vnet/usr.sbin/bsdinstall/partedit/partedit_x86.c Thu Jun 23 21:50:52 2016 (r302158)
@@ -99,7 +99,7 @@ bootpart_size(const char *scheme)
if (strcmp(x86_bootmethod(), "BIOS") == 0)
return (512*1024);
else
- return (800*1024);
+ return (200*1024*1024);
return (0);
}
More information about the svn-src-projects
mailing list