svn commit: r304268 - head/lib/libc/gen
Author: kevlo Date: Wed Aug 17 07:25:50 2016 New Revision: 304268 URL: https://svnweb.freebsd.org/changeset/base/304268 Log: - Add the 'restrict' type qualifier to match function prototype. - Use .Lb libc rather than libpthread. Reviewed by: delphij Modified: head/lib/libc/gen/sem_timedwait.3 Modified: head/lib/libc/gen/sem_timedwait.3 == --- head/lib/libc/gen/sem_timedwait.3 Wed Aug 17 07:25:21 2016 (r304267) +++ head/lib/libc/gen/sem_timedwait.3 Wed Aug 17 07:25:50 2016 (r304268) @@ -34,18 +34,18 @@ .\" .\" $FreeBSD$ .\" -.Dd March 3, 2008 +.Dd August 17, 2016 .Dt SEM_TIMEDWAIT 3 .Os .Sh NAME .Nm sem_timedwait .Nd "lock a semaphore" .Sh LIBRARY -.Lb libpthread +.Lb libc .Sh SYNOPSIS .In semaphore.h .Ft int -.Fn sem_timedwait "sem_t *sem" "const struct timespec *abs_timeout" +.Fn sem_timedwait "sem_t * restrict sem" "const struct timespec * restrict abs_timeout" .Sh DESCRIPTION The .Fn sem_timedwait ___ 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-unsubscr...@freebsd.org"
Re: svn commit: r304180 - head/sys/ufs/ffs
On Tue, Aug 16, 2016 at 11:53:55PM +0200, Jilles Tjoelker wrote: > Hmm, some people interpret POSIX differently than I do, but I think it > is clear that XBD 3.384 Synchronized I/O Data Integrity Completion > requires the indirect blocks to be written (because "all file system > information required to retrieve the data is successfully transferred"). > The Linux man page matches this interpretation except that an fsync of > the parent directory may be required. > > If the whole file is being considered, then any change to indirect > blocks is needed to access some data (because the file was extended, a > hole was filled or snapshotted data was overwritten). For other > overwrites, there is no change to indirect blocks and no conflict with > fdatasync's performance objectives. Note that the same argument is applicable to the inode block: the di_db and di_ib pointers to the direct blocks and to root indirect blocks are required to retrieve the written data. ... > Ideally, a changed i_size would also cause the inode to be written, but > I don't know how to determine that (there is no i_flag for it). Always > writing the inode would defeat the point of fdatasync. Which was my reasoning behind omitting the indirect block flushing. There is no practical difference between inode block and indirect blocks for metadata consistency. Note that the affected case is only the async mounts (not sync mounts, not any variants of softdeps). I can restore indirect block flushing and wait for them for DATA_ONLY sync, but then I should also add ffs_update() call. ___ 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-unsubscr...@freebsd.org"
svn commit: r304270 - head/sys/dev/hyperv/utilities
Author: sephe Date: Wed Aug 17 08:26:08 2016 New Revision: 304270 URL: https://svnweb.freebsd.org/changeset/base/304270 Log: hyperv/util: Don't reference hn_softc in KVP hn_softc is private data struct. MFC after:1 week Sponsored by: Microsoft Differential Revision:https://reviews.freebsd.org/D7519 Modified: head/sys/dev/hyperv/utilities/hv_kvp.c Modified: head/sys/dev/hyperv/utilities/hv_kvp.c == --- head/sys/dev/hyperv/utilities/hv_kvp.c Wed Aug 17 07:30:23 2016 (r304269) +++ head/sys/dev/hyperv/utilities/hv_kvp.c Wed Aug 17 08:26:08 2016 (r304270) @@ -54,17 +54,13 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include #include -#include -#include -#include - #include -#include #include #include "hv_util.h" @@ -333,13 +329,11 @@ hv_kvp_convert_utf16_ipinfo_to_utf8(stru for (devcnt = devcnt - 1; devcnt >= 0; devcnt--) { /* XXX access other driver's softc? are you kidding? */ device_t dev = devs[devcnt]; - struct hn_softc *sc = device_get_softc(dev); struct vmbus_channel *chan; char buf[HYPERV_GUID_STRLEN]; /* * Trying to find GUID of Network Device -* TODO: need vmbus interface. */ chan = vmbus_get_channel(dev); hyperv_guid2str(vmbus_chan_guid_inst(chan), @@ -348,7 +342,7 @@ hv_kvp_convert_utf16_ipinfo_to_utf8(stru if (strncmp(buf, (char *)umsg->body.kvp_ip_val.adapter_id, HYPERV_GUID_STRLEN - 1) == 0) { strlcpy((char *)umsg->body.kvp_ip_val.adapter_id, - sc->hn_ifp->if_xname, MAX_ADAPTER_ID_SIZE); + device_get_nameunit(dev), MAX_ADAPTER_ID_SIZE); break; } } ___ 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-unsubscr...@freebsd.org"
svn commit: r304271 - head/sys/boot/efi/boot1
Author: manu Date: Wed Aug 17 08:29:30 2016 New Revision: 304271 URL: https://svnweb.freebsd.org/changeset/base/304271 Log: Correctly print and cast u_int64_t and off_t. Reported by: ed, imp MFC after:1 week Modified: head/sys/boot/efi/boot1/ufs_module.c head/sys/boot/efi/boot1/zfs_module.c Modified: head/sys/boot/efi/boot1/ufs_module.c == --- head/sys/boot/efi/boot1/ufs_module.cWed Aug 17 08:26:08 2016 (r304270) +++ head/sys/boot/efi/boot1/ufs_module.cWed Aug 17 08:29:30 2016 (r304271) @@ -56,9 +56,9 @@ dskread(void *buf, u_int64_t lba, int nb devinfo->dev->Media->MediaId, lba, size, buf); if (status != EFI_SUCCESS) { - DPRINTF("dskread: failed dev: %p, id: %u, lba: %zu, size: %d, " + DPRINTF("dskread: failed dev: %p, id: %u, lba: %ju, size: %d, " "status: %lu\n", devinfo->dev, - devinfo->dev->Media->MediaId, lba, size, + devinfo->dev->Media->MediaId, (uintmax_t)lba, size, EFI_ERROR_CODE(status)); return (-1); } Modified: head/sys/boot/efi/boot1/zfs_module.c == --- head/sys/boot/efi/boot1/zfs_module.cWed Aug 17 08:26:08 2016 (r304270) +++ head/sys/boot/efi/boot1/zfs_module.cWed Aug 17 08:29:30 2016 (r304271) @@ -54,9 +54,9 @@ vdev_read(vdev_t *vdev, void *priv, off_ devinfo->dev->Media->MediaId, lba, bytes, buf); if (status != EFI_SUCCESS) { DPRINTF("vdev_read: failed dev: %p, id: %u, lba: %jd, size: %zu," -" status: %lu\n", devinfo->dev, -devinfo->dev->Media->MediaId, lba, bytes, -EFI_ERROR_CODE(status)); + " status: %lu\n", devinfo->dev, + devinfo->dev->Media->MediaId, (intmax_t)lba, bytes, + EFI_ERROR_CODE(status)); return (-1); } ___ 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-unsubscr...@freebsd.org"
Re: svn commit: r304221 - head/sys/boot/efi/boot1
On Tue, 16 Aug 2016 12:16:30 -0600 Warner Losh wrote: > On Tue, Aug 16, 2016 at 8:57 AM, Ed Schouten wrote: > > Hi Emmanuel, > > > > 2016-08-16 16:23 GMT+02:00 Emmanuel Vadot : > >> Author: manu > >> Date: Tue Aug 16 14:23:35 2016 > >> New Revision: 304221 > >> URL: https://svnweb.freebsd.org/changeset/base/304221 > >> > >> Log: > >> Use %ju modifier for u_int64_t and %jd modifier for off_t. > >> off_t is long long on arm32 and long on amd64 > > > > I think both of these should be solved differently: > > > > - For uint64_t, you can use 's PRIu64 in the formatting > > string. In kernel space, I suspect you need to use something like > > . > > cast it to intmax_t and use %jd. We've shunned PRIu64 in the tree. > It's existing practice, but I'm sure bruce will voice mild distaste. > > > - For off_t, it's all right to print it with %jd, but then be sure to > > also add a cast to the argument itself. It may not necessarily be > > equal to an intmax_t. > > The cast is important. > > Warner Thanks to all of you, I didn't know about PRI* (but I guess this was a good thing to not know about them). -- Emmanuel Vadot ___ 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-unsubscr...@freebsd.org"
svn commit: r304273 - head/sys/dev/hyperv/utilities
Author: sephe Date: Wed Aug 17 08:38:49 2016 New Revision: 304273 URL: https://svnweb.freebsd.org/changeset/base/304273 Log: hyperv/util: Factor out helper for IC device_probe DEVMETHOD MFC after:1 week Sponsored by: Microsoft Differential Revision:https://reviews.freebsd.org/D7530 Modified: head/sys/dev/hyperv/utilities/hv_heartbeat.c head/sys/dev/hyperv/utilities/hv_kvp.c head/sys/dev/hyperv/utilities/hv_shutdown.c head/sys/dev/hyperv/utilities/hv_timesync.c head/sys/dev/hyperv/utilities/hv_util.c head/sys/dev/hyperv/utilities/hv_util.h Modified: head/sys/dev/hyperv/utilities/hv_heartbeat.c == --- head/sys/dev/hyperv/utilities/hv_heartbeat.cWed Aug 17 08:37:40 2016(r304272) +++ head/sys/dev/hyperv/utilities/hv_heartbeat.cWed Aug 17 08:38:49 2016(r304273) @@ -41,10 +41,15 @@ #include "hv_util.h" #include "vmbus_if.h" -/* Heartbeat Service */ -static const struct hyperv_guid service_guid = { .hv_guid = - {0x39, 0x4f, 0x16, 0x57, 0x15, 0x91, 0x78, 0x4e, - 0xab, 0x55, 0x38, 0x2f, 0x3b, 0xd5, 0x42, 0x2d} }; +static const struct vmbus_ic_desc vmbus_heartbeat_descs[] = { + { + .ic_guid = { .hv_guid = { + 0x39, 0x4f, 0x16, 0x57, 0x15, 0x91, 0x78, 0x4e, + 0xab, 0x55, 0x38, 0x2f, 0x3b, 0xd5, 0x42, 0x2d} }, + .ic_desc = "Hyper-V Heartbeat" + }, + VMBUS_IC_DESC_END +}; /** * Process heartbeat message @@ -96,14 +101,8 @@ hv_heartbeat_cb(struct vmbus_channel *ch static int hv_heartbeat_probe(device_t dev) { - if (resource_disabled("hvheartbeat", 0)) - return ENXIO; - if (VMBUS_PROBE_GUID(device_get_parent(dev), dev, &service_guid) == 0) { - device_set_desc(dev, "Hyper-V Heartbeat Service"); - return BUS_PROBE_DEFAULT; - } - return ENXIO; + return (vmbus_ic_probe(dev, vmbus_heartbeat_descs)); } static int Modified: head/sys/dev/hyperv/utilities/hv_kvp.c == --- head/sys/dev/hyperv/utilities/hv_kvp.c Wed Aug 17 08:37:40 2016 (r304272) +++ head/sys/dev/hyperv/utilities/hv_kvp.c Wed Aug 17 08:38:49 2016 (r304273) @@ -87,9 +87,15 @@ static int hv_kvp_log = 0; log(LOG_INFO, "hv_kvp: " __VA_ARGS__); \ } while (0) -static const struct hyperv_guid service_guid = { .hv_guid = - {0xe7, 0xf4, 0xa0, 0xa9, 0x45, 0x5a, 0x96, 0x4d, - 0xb8, 0x27, 0x8a, 0x84, 0x1e, 0x8c, 0x3, 0xe6} }; +static const struct vmbus_ic_desc vmbus_kvp_descs[] = { + { + .ic_guid = { .hv_guid = { + 0xe7, 0xf4, 0xa0, 0xa9, 0x45, 0x5a, 0x96, 0x4d, + 0xb8, 0x27, 0x8a, 0x84, 0x1e, 0x8c, 0x3, 0xe6 } }, + .ic_desc = "Hyper-V KVP" + }, + VMBUS_IC_DESC_END +}; /* character device prototypes */ static d_open_thv_kvp_dev_open; @@ -867,14 +873,8 @@ hv_kvp_dev_daemon_poll(struct cdev *dev, static int hv_kvp_probe(device_t dev) { - if (resource_disabled("hvkvp", 0)) - return ENXIO; - if (VMBUS_PROBE_GUID(device_get_parent(dev), dev, &service_guid) == 0) { - device_set_desc(dev, "Hyper-V KVP Service"); - return BUS_PROBE_DEFAULT; - } - return ENXIO; + return (vmbus_ic_probe(dev, vmbus_kvp_descs)); } static int Modified: head/sys/dev/hyperv/utilities/hv_shutdown.c == --- head/sys/dev/hyperv/utilities/hv_shutdown.c Wed Aug 17 08:37:40 2016 (r304272) +++ head/sys/dev/hyperv/utilities/hv_shutdown.c Wed Aug 17 08:38:49 2016 (r304273) @@ -46,9 +46,15 @@ #include "hv_util.h" #include "vmbus_if.h" -static const struct hyperv_guid service_guid = { .hv_guid = - {0x31, 0x60, 0x0B, 0X0E, 0x13, 0x52, 0x34, 0x49, - 0x81, 0x8B, 0x38, 0XD9, 0x0C, 0xED, 0x39, 0xDB} }; +static const struct vmbus_ic_desc vmbus_shutdown_descs[] = { + { + .ic_guid = { .hv_guid = { + 0x31, 0x60, 0x0b, 0x0e, 0x13, 0x52, 0x34, 0x49, + 0x81, 0x8b, 0x38, 0xd9, 0x0c, 0xed, 0x39, 0xdb } }, + .ic_desc = "Hyper-V Shutdown" + }, + VMBUS_IC_DESC_END +}; /** * Shutdown @@ -118,14 +124,8 @@ hv_shutdown_cb(struct vmbus_channel *cha static int hv_shutdown_probe(device_t dev) { - if (resource_disabled("hvshutdown", 0)) - return ENXIO; - if (VMBUS_PROBE_GUID(device_get_parent(dev), dev, &service_guid) == 0) { - device_set_desc(dev, "Hyper-V Shutdown Service"); - return BUS_PROBE_DEFAULT; - } - return ENXIO; + return (vmbus_ic_probe(dev, vmbus_shutdown_descs)); } static int Modified: head/sys/dev/hyperv/utilit
svn commit: r304279 - head/sys/dev/acpica
Author: kib Date: Wed Aug 17 09:20:04 2016 New Revision: 304279 URL: https://svnweb.freebsd.org/changeset/base/304279 Log: By default, allow all to read the HPET registers pages. At the same time, by, by default disallow writes to the mmaped HPET pages. Intent is to allow userspace to use HPET as fast (i.e. no-syscall) timecounter for gettimeofday(2). Unfortunately, the permission model does not make it possible to safely unhide /dev/hpet in the jails even if default mode is set to 0444, because untrusted jailed root may change device permissions to writeable. Sponsored by: The FreeBSD Foundation MFC after:3 weeks Modified: head/sys/dev/acpica/acpi_hpet.c Modified: head/sys/dev/acpica/acpi_hpet.c == --- head/sys/dev/acpica/acpi_hpet.c Wed Aug 17 09:12:02 2016 (r304278) +++ head/sys/dev/acpica/acpi_hpet.c Wed Aug 17 09:20:04 2016 (r304279) @@ -762,14 +762,14 @@ hpet_attach(device_t dev) mda.mda_devsw = &hpet_cdevsw; mda.mda_uid = UID_ROOT; mda.mda_gid = GID_WHEEL; - mda.mda_mode = 0600; + mda.mda_mode = 0644; mda.mda_si_drv1 = sc; error = make_dev_s(&mda, &sc->pdev, "hpet%d", device_get_unit(dev)); if (error == 0) { sc->mmap_allow = 1; TUNABLE_INT_FETCH("hw.acpi.hpet.mmap_allow", &sc->mmap_allow); - sc->mmap_allow_write = 1; + sc->mmap_allow_write = 0; TUNABLE_INT_FETCH("hw.acpi.hpet.mmap_allow_write", &sc->mmap_allow_write); SYSCTL_ADD_INT(device_get_sysctl_ctx(dev), ___ 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-unsubscr...@freebsd.org"
svn commit: r304285 - in head: lib/libc lib/libc/aarch64/sys lib/libc/amd64/sys lib/libc/arm/sys lib/libc/i386/sys lib/libc/sys lib/libc/x86 lib/libc/x86/sys sys/arm/arm sys/arm/include sys/arm64/a...
Author: kib Date: Wed Aug 17 09:52:09 2016 New Revision: 304285 URL: https://svnweb.freebsd.org/changeset/base/304285 Log: Implement userspace gettimeofday(2) with HPET timecounter. Right now, userspace (fast) gettimeofday(2) on x86 only works for RDTSC. For older machines, like Core2, where RDTSC is not C2/C3 invariant, and which fall to HPET hardware, this means that the call has both the penalty of the syscall and of the uncached hw behind the QPI or PCIe connection to the sought bridge. Nothing can me done against the access latency, but the syscall overhead can be removed. System already provides mappable /dev/hpetX devices, which gives straight access to the HPET registers page. Add yet another algorithm to the x86 'vdso' timehands. Libc is updated to handle both RDTSC and HPET. For HPET, the index of the hpet device to mmap is passed from kernel to userspace, index might be changed and libc invalidates its mapping as needed. Remove cpu_fill_vdso_timehands() KPI, instead require that timecounters which can be used from userspace, to provide tc_fill_vdso_timehands{,32}() methods. Merge i386 and amd64 libc//sys/__vdso_gettc.c into one source file in the new libc/x86/sys location. __vdso_gettc() internal interface is changed to move timecounter algorithm detection into the MD code. Measurements show that RDTSC even with the syscall overhead is faster than userspace HPET access. But still, userspace HPET is three-four times faster than syscall HPET on several Core2 and SandyBridge machines. Tested by:Howard Su Sponsored by: The FreeBSD Foundation MFC after:1 month Differential revision:https://reviews.freebsd.org/D7473 Added: head/lib/libc/x86/ head/lib/libc/x86/sys/ head/lib/libc/x86/sys/Makefile.inc (contents, props changed) head/lib/libc/x86/sys/__vdso_gettc.c - copied, changed from r304281, head/lib/libc/i386/sys/__vdso_gettc.c Deleted: head/lib/libc/amd64/sys/__vdso_gettc.c head/lib/libc/i386/sys/__vdso_gettc.c Modified: head/lib/libc/Makefile head/lib/libc/aarch64/sys/__vdso_gettc.c head/lib/libc/amd64/sys/Makefile.inc head/lib/libc/arm/sys/__vdso_gettc.c head/lib/libc/i386/sys/Makefile.inc head/lib/libc/sys/__vdso_gettimeofday.c head/lib/libc/sys/trivial-vdso_tc.c head/sys/arm/arm/generic_timer.c head/sys/arm/arm/machdep.c head/sys/arm/include/md_var.h head/sys/arm/include/vdso.h head/sys/arm64/arm64/machdep.c head/sys/arm64/include/md_var.h head/sys/arm64/include/vdso.h head/sys/dev/acpica/acpi_hpet.c head/sys/dev/acpica/acpi_hpet.h head/sys/kern/kern_tc.c head/sys/sys/timetc.h head/sys/sys/vdso.h head/sys/x86/include/vdso.h head/sys/x86/x86/tsc.c Modified: head/lib/libc/Makefile == --- head/lib/libc/Makefile Wed Aug 17 09:34:56 2016(r304284) +++ head/lib/libc/Makefile Wed Aug 17 09:52:09 2016(r304285) @@ -110,6 +110,9 @@ NOASM= ${LIBC_ARCH} == "mips" .include "${LIBC_SRCTOP}/softfloat/Makefile.inc" .endif +.if ${LIBC_ARCH} == "i386" || ${LIBC_ARCH} == "amd64" +.include "${LIBC_SRCTOP}/x86/sys/Makefile.inc" +.endif .if ${MK_NIS} != "no" CFLAGS+= -DYP .include "${LIBC_SRCTOP}/yp/Makefile.inc" Modified: head/lib/libc/aarch64/sys/__vdso_gettc.c == --- head/lib/libc/aarch64/sys/__vdso_gettc.cWed Aug 17 09:34:56 2016 (r304284) +++ head/lib/libc/aarch64/sys/__vdso_gettc.cWed Aug 17 09:52:09 2016 (r304285) @@ -34,6 +34,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include "libc_private.h" static inline uint64_t @@ -55,14 +56,15 @@ cp15_cntpct_get(void) } #pragma weak __vdso_gettc -u_int -__vdso_gettc(const struct vdso_timehands *th) +int +__vdso_gettc(const struct vdso_timehands *th, u_int *tc) { - uint64_t val; + if (th->th_algo != VDSO_TH_ALGO_ARM_GENTIM) + return (ENOSYS); __asm __volatile("isb" : : : "memory"); - val = th->th_physical == 0 ? cp15_cntvct_get() : cp15_cntpct_get(); - return (val); + *tc = th->th_physical == 0 ? cp15_cntvct_get() : cp15_cntpct_get(); + return (0); } #pragma weak __vdso_gettimekeep Modified: head/lib/libc/amd64/sys/Makefile.inc == --- head/lib/libc/amd64/sys/Makefile.incWed Aug 17 09:34:56 2016 (r304284) +++ head/lib/libc/amd64/sys/Makefile.incWed Aug 17 09:52:09 2016 (r304285) @@ -2,7 +2,7 @@ # $FreeBSD$ SRCS+= amd64_get_fsbase.c amd64_get_gsbase.c amd64_set_fsbase.c \ - amd64_set_gsbase.c __vdso_gettc.c + amd64_set_gsbase.c MDASM= vfork.S brk.S cerror.S exect.S getcontext.S ptrace.S \ sbrk.S setlogin.S sigreturn.S Modified: head/lib/libc/arm/sys/__vdso_gettc.c
Re: svn commit: r304142 - head/usr.sbin/bsdinstall/partedit
Nathan Whitehorn writes: > As a note for people who weren't paying attention to the bug, we need > to fix this in a better way outside of the constraints of getting 11.0 > out the door. The system (gpart, the installer, ZFS, etc.) uses the > reported GEOM stripesize for partition alignment and IO block size > selection. If that is wrong, we should identify devices on which it is > wrong and fix them, and maybe also add some global tunable that sets a > floor on the numbers reported by GEOM_DISK. Hacking the installer like > this is triage, which is fine, but not viable as a permanent solution > to anything. Modifying GEOM to report a bogus number when none is provided by the lower layer(s) is absolutely not going to happen. You have absolutely no idea what your proposed change will break. And you keep refusing to address the fact that most drivers don't report a stripe size, except by repeating your claim that they do, with no evidence to back it up. Feel free to 'grep -r stripesize /usr/src/sys/dev'. Go on, I'll wait. Your contention that the installer does not make policy decisions is equally spurious. The installer makes many policy decisions, including the disk layout, the size of the swap partition, the name of the pool, the use of boot environments (which I dislike but am not allowed to override), the number of filesets and their mountpoints (which I also dislike and am not allowed to override either), etc. The Unix philosophy is to push such decisions up the stack, not down. The decision to align partitions on 4096-byte boundaries because we're not sure of the correct number but know for a fact that using a smaller number can have a huge impact on performance is the installer's to make. DES -- Dag-Erling Smørgrav - d...@des.no ___ 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-unsubscr...@freebsd.org"
svn commit: r304286 - head/sys/kern
Author: kib Date: Wed Aug 17 10:14:22 2016 New Revision: 304286 URL: https://svnweb.freebsd.org/changeset/base/304286 Log: Remove duplicated code. aio_aqueue() calls aio_init_aioinfo() as the first action. There is no need to duplicate the code in kern_aio_fsync(). Also fix indent for aio_aqueue() definition. Reviewed by: jhb Sponsored by: The FreeBSD Foundation MFC after:1 week Differential revision:https://reviews.freebsd.org/D7523 Modified: head/sys/kern/vfs_aio.c Modified: head/sys/kern/vfs_aio.c == --- head/sys/kern/vfs_aio.c Wed Aug 17 09:52:09 2016(r304285) +++ head/sys/kern/vfs_aio.c Wed Aug 17 10:14:22 2016(r304286) @@ -1441,7 +1441,7 @@ static struct aiocb_ops aiocb_ops_osigev */ int aio_aqueue(struct thread *td, struct aiocb *ujob, struct aioliojob *lj, - int type, struct aiocb_ops *ops) +int type, struct aiocb_ops *ops) { struct proc *p = td->td_proc; cap_rights_t rights; @@ -2476,14 +2476,9 @@ static int kern_aio_fsync(struct thread *td, int op, struct aiocb *ujob, struct aiocb_ops *ops) { - struct proc *p = td->td_proc; - struct kaioinfo *ki; if (op != O_SYNC) /* XXX lack of O_DSYNC */ return (EINVAL); - ki = p->p_aioinfo; - if (ki == NULL) - aio_init_aioinfo(p); return (aio_aqueue(td, ujob, NULL, LIO_SYNC, ops)); } ___ 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-unsubscr...@freebsd.org"
svn commit: r304287 - head/lib/libc/sys
Author: kib Date: Wed Aug 17 10:16:42 2016 New Revision: 304287 URL: https://svnweb.freebsd.org/changeset/base/304287 Log: Add fdatasync(2) man page, combined with fsync(2). Reviewed by: emaste, rpokala, wblock Sponsored by: The FreeBSD Foundation MFC after:2 weeks Differential revision:https://reviews.freebsd.org/D7522 Modified: head/lib/libc/sys/Makefile.inc head/lib/libc/sys/fsync.2 Modified: head/lib/libc/sys/Makefile.inc == --- head/lib/libc/sys/Makefile.inc Wed Aug 17 10:14:22 2016 (r304286) +++ head/lib/libc/sys/Makefile.inc Wed Aug 17 10:16:42 2016 (r304287) @@ -366,6 +366,7 @@ MLINKS+=ffclock.2 ffclock_getcounter.2 \ ffclock.2 ffclock_getestimate.2 \ ffclock.2 ffclock_setestimate.2 MLINKS+=fhopen.2 fhstat.2 fhopen.2 fhstatfs.2 +MLINKS+=fsync.2 fdatasync.2 MLINKS+=getdirentries.2 getdents.2 MLINKS+=getfh.2 lgetfh.2 MLINKS+=getgid.2 getegid.2 Modified: head/lib/libc/sys/fsync.2 == --- head/lib/libc/sys/fsync.2 Wed Aug 17 10:14:22 2016(r304286) +++ head/lib/libc/sys/fsync.2 Wed Aug 17 10:16:42 2016(r304287) @@ -1,5 +1,11 @@ .\" Copyright (c) 1983, 1993 .\"The Regents of the University of California. All rights reserved. +.\" Copyright (c) 2016 The FreeBSD Foundation, Inc. +.\" All rights reserved. +.\" +.\" Parts of this documentation were 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 @@ -28,40 +34,65 @@ .\" @(#)fsync.28.1 (Berkeley) 6/4/93 .\" $FreeBSD$ .\" -.Dd June 4, 1993 +.Dd August 17, 2016 .Dt FSYNC 2 .Os .Sh NAME -.Nm fsync +.Nm fdatasync, fsync .Nd "synchronise changes to a file" .Sh LIBRARY .Lb libc .Sh SYNOPSIS .In unistd.h .Ft int +.Fn fdatasync "int fd" +.Ft int .Fn fsync "int fd" .Sh DESCRIPTION The .Fn fsync system call -causes all modified data and attributes of +causes all modified data and attributes of the file referenced by +the file descriptor .Fa fd to be moved to a permanent storage device. This normally results in all in-core modified copies of buffers for the associated file to be written to a disk. .Pp The +.Fn fdatasync +system call causes all modified data of +.Fa fd +to be moved to a permanent storage device. +Unlike +.Fn fsync , +the system call does not guarantee that file attributes or +metadata necessary to access the file are committed to the permanent storage. +.Pp +The .Fn fsync system call should be used by programs that require a file to be in a known state, for example, in building a simple transaction facility. +If the file metadata has already been committed, using +.Fn fdatasync +can be more efficient than +.Fn fsync . +.Pp +Both +.Fn fdatasync +and +.Fn fsync +calls are cancellation points. .Sh RETURN VALUES .Rv -std fsync .Sh ERRORS The .Fn fsync -fails if: +and +.Fn fdatasync +calls fail if: .Bl -tag -width Er .It Bq Er EBADF The @@ -85,3 +116,15 @@ The .Fn fsync system call appeared in .Bx 4.2 . +The +.Fn fdatasync +system call appeared in +.Fx 12.0 +.Sh BUGS +The +.Fn fdatasync +system call currently does not guarantee that enqueued +.Xr aio 4 +requests for the file referenced by +.Fa fd +are completed before the syscall returns. ___ 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-unsubscr...@freebsd.org"
svn commit: r304288 - in head: lib/libc/sys sys/kern
Author: bdrewery Date: Wed Aug 17 10:20:05 2016 New Revision: 304288 URL: https://svnweb.freebsd.org/changeset/base/304288 Log: Garbage collect _umtx_lock(2)/_umtx_unlock(2) references removed in r263318. This has no real impact on the resulting libc.so file. MFC after:3 days Sponsored by: EMC / Isilon Storage Division Modified: head/lib/libc/sys/Symbol.map head/sys/kern/capabilities.conf Modified: head/lib/libc/sys/Symbol.map == --- head/lib/libc/sys/Symbol.mapWed Aug 17 10:16:42 2016 (r304287) +++ head/lib/libc/sys/Symbol.mapWed Aug 17 10:20:05 2016 (r304288) @@ -34,9 +34,7 @@ FBSD_1.0 { __setugid; __syscall; __sysctl; - _umtx_lock; _umtx_op; - _umtx_unlock; abort2; accept; access; @@ -459,12 +457,8 @@ FBSDprivate_1.0 { __sys___syscall; ___sysctl; __sys___sysctl; - __umtx_lock; - __sys__umtx_lock; __umtx_op; __sys__umtx_op; - __umtx_unlock; - __sys__umtx_unlock; _abort2; __sys_abort2; _accept; Modified: head/sys/kern/capabilities.conf == --- head/sys/kern/capabilities.conf Wed Aug 17 10:16:42 2016 (r304287) +++ head/sys/kern/capabilities.conf Wed Aug 17 10:20:05 2016 (r304288) @@ -64,9 +64,7 @@ __sysctl ## ## XXRW: Need to check this very carefully. ## -_umtx_lock _umtx_op -_umtx_unlock ## ## Allow process termination using abort2(2). ___ 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-unsubscr...@freebsd.org"
svn commit: r304289 - head/sys/arm/allwinner
Author: manu Date: Wed Aug 17 10:20:36 2016 New Revision: 304289 URL: https://svnweb.freebsd.org/changeset/base/304289 Log: a10_gpio_get_function now returns the whole function not only GPIO_INPUT/GPIO_OUTPUT. a10_gpio_get_pud now returns the whole pud not only PULLDOWN/PULLUP. Add a10_gpio_get_drv to get the current drive strenght. During fdt pin configure, avoid setting function/drive/pud if it's already in the correct value. Tested on Allwinner H3 and A20 MFC after:1 week Modified: head/sys/arm/allwinner/a10_gpio.c Modified: head/sys/arm/allwinner/a10_gpio.c == --- head/sys/arm/allwinner/a10_gpio.c Wed Aug 17 10:20:05 2016 (r304288) +++ head/sys/arm/allwinner/a10_gpio.c Wed Aug 17 10:20:36 2016 (r304289) @@ -210,14 +210,8 @@ a10_gpio_get_function(struct a10_gpio_so offset = ((pin & 0x07) << 2); func = A10_GPIO_READ(sc, A10_GPIO_GP_CFG(bank, pin >> 3)); - switch ((func >> offset) & 0x7) { - case A10_GPIO_INPUT: - return (GPIO_PIN_INPUT); - case A10_GPIO_OUTPUT: - return (GPIO_PIN_OUTPUT); - } - return (0); + return ((func >> offset) & 0x7); } static int @@ -257,14 +251,8 @@ a10_gpio_get_pud(struct a10_gpio_softc * offset = ((pin & 0x0f) << 1); val = A10_GPIO_READ(sc, A10_GPIO_GP_PUL(bank, pin >> 4)); - switch ((val >> offset) & 0x3) { - case A10_GPIO_PULLDOWN: - return (GPIO_PIN_PULLDOWN); - case A10_GPIO_PULLUP: - return (GPIO_PIN_PULLUP); - } - return (0); + return ((val >> offset) & AW_GPIO_PUD_MASK); } static void @@ -285,6 +273,23 @@ a10_gpio_set_pud(struct a10_gpio_softc * A10_GPIO_WRITE(sc, A10_GPIO_GP_PUL(bank, pin >> 4), val); } +static uint32_t +a10_gpio_get_drv(struct a10_gpio_softc *sc, uint32_t pin) +{ + uint32_t bank, offset, val; + + /* Must be called with lock held. */ + A10_GPIO_LOCK_ASSERT(sc); + + bank = sc->padconf->pins[pin].port; + pin = sc->padconf->pins[pin].pin; + offset = ((pin & 0x0f) << 1); + + val = A10_GPIO_READ(sc, A10_GPIO_GP_DRV(bank, pin >> 4)); + + return ((val >> offset) & AW_GPIO_DRV_MASK); +} + static void a10_gpio_set_drv(struct a10_gpio_softc *sc, uint32_t pin, uint32_t drive) { @@ -373,14 +378,39 @@ static int a10_gpio_pin_getflags(device_t dev, uint32_t pin, uint32_t *flags) { struct a10_gpio_softc *sc; + uint32_t func; + uint32_t pud; sc = device_get_softc(dev); if (pin >= sc->padconf->npins) return (EINVAL); A10_GPIO_LOCK(sc); - *flags = a10_gpio_get_function(sc, pin); - *flags |= a10_gpio_get_pud(sc, pin); + func = a10_gpio_get_function(sc, pin); + switch (func) { + case A10_GPIO_INPUT: + *flags = GPIO_PIN_INPUT; + break; + case A10_GPIO_OUTPUT: + *flags = GPIO_PIN_OUTPUT; + break; + default: + *flags = 0; + break; + } + + pud = a10_gpio_get_pud(sc, pin); + switch (pud) { + case A10_GPIO_PULLDOWN: + *flags |= GPIO_PIN_PULLDOWN; + break; + case A10_GPIO_PULLUP: + *flags |= GPIO_PIN_PULLUP; + break; + default: + break; + } + A10_GPIO_UNLOCK(sc); return (0); @@ -564,9 +594,13 @@ aw_fdt_configure_pins(device_t dev, phan } A10_GPIO_LOCK(sc); - a10_gpio_set_function(sc, pin_num, pin_func); - a10_gpio_set_drv(sc, pin_num, pin_drive); - a10_gpio_set_pud(sc, pin_num, pin_pull); + + if (a10_gpio_get_function(sc, pin_num) != pin_func) + a10_gpio_set_function(sc, pin_num, pin_func); + if (a10_gpio_get_drv(sc, pin_num) != pin_drive) + a10_gpio_set_drv(sc, pin_num, pin_drive); + if (a10_gpio_get_pud(sc, pin_num) != pin_pull) + a10_gpio_set_pud(sc, pin_num, pin_pull); A10_GPIO_UNLOCK(sc); } ___ 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-unsubscr...@freebsd.org"
Re: svn commit: r304180 - head/sys/ufs/ffs
On Wed, 17 Aug 2016, Konstantin Belousov wrote: On Tue, Aug 16, 2016 at 11:53:55PM +0200, Jilles Tjoelker wrote: Hmm, some people interpret POSIX differently than I do, but I think it is clear that XBD 3.384 Synchronized I/O Data Integrity Completion requires the indirect blocks to be written (because "all file system information required to retrieve the data is successfully transferred"). The Linux man page matches this interpretation except that an fsync of the parent directory may be required. All related directories must be synced. It is almost useless to sync the data if the data cannot be found later using normal file system operations. Not quite useless if the file can be recovered by fsck and saved in lost+found, but the metadata needed to guarantee that that works probably requires a lot of writes anyway. If the whole file is being considered, then any change to indirect blocks is needed to access some data (because the file was extended, a hole was filled or snapshotted data was overwritten). For other overwrites, there is no change to indirect blocks and no conflict with fdatasync's performance objectives. Note that the same argument is applicable to the inode block: the di_db and di_ib pointers to the direct blocks and to root indirect blocks are required to retrieve the written data. I would never have guessed that you left out either. ... Ideally, a changed i_size would also cause the inode to be written, but I don't know how to determine that (there is no i_flag for it). Always writing the inode would defeat the point of fdatasync. My version does a bcmp() of the in-core copy with the disk copy to avoid null changes. This turned out to be not very useful. It was intended mainly to avoid writing null changes for timestamps. By I already avoid most timestamp changes by mounting with -noatime and not having large data. I use only seconds granularity for timestamps. With nanoseconds granularity, any change to a file is guaranteed to change its in-core inode, so the bcmp() wouldn't work. But timestamps are about the only metadata that obviously doesn't need syncing. Especially atimes. POSIX doesn't allow turning off atimes, but it also doesn't require syncing them before the system crashes except probably using FSYNC of metadata. There is an i_flag for critical metadata like i_size. It is IN_MODIFIED. This flag is often mismanaged. Many places set only IN_CHANGE after making a critical change. ufs_chown() is one such place. Ownerships are fairly critical metadata. They are not considered critical enough to sync immediately, but they should be synced by FSYNC of metadata. But the implementation is to set only IN_CHANGE. i_ctime is usually updated much later and IN_MODIFIED is set then to say that the relatively unimportant i_ctime has been modified. This inhibits the optimization of syncing for chown() but not syncing for ctime changes. Which was my reasoning behind omitting the indirect block flushing. There is no practical difference between inode block and indirect blocks for metadata consistency. Ugh. Note that the affected case is only the async mounts (not sync mounts, not any variants of softdeps). I fixed the non-syncing of inodes for the async mount case ~15 years ago in my version, and finally merged the changes to my version of -current a few months OK. It was stupid that ordinary fsync() synced the indirect blocks but not the more important inode. Directory metadata is still not synced by fsync() in the async mount case. I can restore indirect block flushing and wait for them for DATA_ONLY sync, but then I should also add ffs_update() call. Here are my ffs fixes for -current. The are mostly to sprinkle missing DOINGASYNC() checks and finally fix ffs_update(): X Index: ffs/ffs_balloc.c X === X --- ffs/ffs_balloc.c (revision 304069) X +++ ffs/ffs_balloc.c (working copy) X @@ -155,4 +155,6 @@ X if (flags & IO_SYNC) X bwrite(bp); X + else if (DOINGASYNC(vp)) X + bdwrite(bp); X else X bawrite(bp); X @@ -265,12 +267,10 @@ X newb, 0, fs->fs_bsize, 0, bp); X bdwrite(bp); X + } else if ((flags & IO_SYNC) == 0 && DOINGASYNC(vp)) { X + if (bp->b_bufsize == fs->fs_bsize) X + bp->b_flags |= B_CLUSTEROK; X + bdwrite(bp); This restructures the code a little to fix the DOINGASYNC() check. IO_SYNC was not checked. X } else { X - /* X - * Write synchronously so that indirect blocks X - * never point at garbage. X - */ X - if (DOINGASYNC(vp)) X - bdwrite(bp); X -
svn commit: r304290 - head/sys/arm/allwinner
Author: manu Date: Wed Aug 17 13:09:31 2016 New Revision: 304290 URL: https://svnweb.freebsd.org/changeset/base/304290 Log: Only set pud settings if this is a pullup or pulldown configuration. This removes the need to set the MMC pins with pullups in our DTS. Thanks to jmcneill@ for spotting this. Tested on Orange Pi One (Allwinner H3). MFC after:1 week Modified: head/sys/arm/allwinner/a10_gpio.c Modified: head/sys/arm/allwinner/a10_gpio.c == --- head/sys/arm/allwinner/a10_gpio.c Wed Aug 17 10:20:36 2016 (r304289) +++ head/sys/arm/allwinner/a10_gpio.c Wed Aug 17 13:09:31 2016 (r304290) @@ -57,6 +57,8 @@ __FBSDID("$FreeBSD$"); #include #include +#include + #if defined(__aarch64__) #include "opt_soc.h" #endif @@ -599,7 +601,9 @@ aw_fdt_configure_pins(device_t dev, phan a10_gpio_set_function(sc, pin_num, pin_func); if (a10_gpio_get_drv(sc, pin_num) != pin_drive) a10_gpio_set_drv(sc, pin_num, pin_drive); - if (a10_gpio_get_pud(sc, pin_num) != pin_pull) + if (a10_gpio_get_pud(sc, pin_num) != pin_pull && + (pin_pull == SUN4I_PINCTRL_PULL_UP || + pin_pull == SUN4I_PINCTRL_PULL_DOWN)) a10_gpio_set_pud(sc, pin_num, pin_pull); A10_GPIO_UNLOCK(sc); } ___ 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-unsubscr...@freebsd.org"
svn commit: r304291 - head/sys/boot/fdt/dts/arm
Author: manu Date: Wed Aug 17 13:19:28 2016 New Revision: 304291 URL: https://svnweb.freebsd.org/changeset/base/304291 Log: Remove pullup settings for MMC pins, this is not needed since r304290 MFC after:1 week Modified: head/sys/boot/fdt/dts/arm/bananapi.dts Modified: head/sys/boot/fdt/dts/arm/bananapi.dts == --- head/sys/boot/fdt/dts/arm/bananapi.dts Wed Aug 17 13:09:31 2016 (r304290) +++ head/sys/boot/fdt/dts/arm/bananapi.dts Wed Aug 17 13:19:28 2016 (r304291) @@ -41,7 +41,3 @@ }; }; }; - -&mmc0_pins_a { - allwinner,pull = ; -}; ___ 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-unsubscr...@freebsd.org"
Re: svn commit: r304142 - head/usr.sbin/bsdinstall/partedit
On 08/17/16 03:07, Dag-Erling Smørgrav wrote: Nathan Whitehorn writes: As a note for people who weren't paying attention to the bug, we need to fix this in a better way outside of the constraints of getting 11.0 out the door. The system (gpart, the installer, ZFS, etc.) uses the reported GEOM stripesize for partition alignment and IO block size selection. If that is wrong, we should identify devices on which it is wrong and fix them, and maybe also add some global tunable that sets a floor on the numbers reported by GEOM_DISK. Hacking the installer like this is triage, which is fine, but not viable as a permanent solution to anything. Modifying GEOM to report a bogus number when none is provided by the lower layer(s) is absolutely not going to happen. You have absolutely no idea what your proposed change will break. And you keep refusing to address the fact that most drivers don't report a stripe size, except by repeating your claim that they do, with no evidence to back it up. Feel free to 'grep -r stripesize /usr/src/sys/dev'. Go on, I'll wait. And yet, if you look at the GEOM XML, it is reported and there. And, look, it's even right for the AF 512e disks in my machine! 512 4096 I've literally never seen a case where we don't already do the right thing here. The GEOM stripesize is, whether you like it or not, the way we have long ago decided to communicate the information about optimal alignment from the disk drivers to userland. We do a good job of it, too. It's correct, as far as I can tell, 100% of the time on all possible variants of AF disks. One could argue that calling this the "stripesize" is a hack, and I would agree, but it's what the operating system does and has done for many years. As for grepping, the CAM disk drivers are all in sys/cam, not sys/dev, as I'm sure you know, and you will find all the code that handles this there. Your contention that the installer does not make policy decisions is equally spurious. The installer makes many policy decisions, including the disk layout, the size of the swap partition, the name of the pool, the use of boot environments (which I dislike but am not allowed to override), the number of filesets and their mountpoints (which I also dislike and am not allowed to override either), etc. The Unix philosophy is to push such decisions up the stack, not down. The decision to align partitions on 4096-byte boundaries because we're not sure of the correct number but know for a fact that using a smaller number can have a huge impact on performance is the installer's to make. Those are all things that the operating system does not have defaults for: there are no tools like, say, gpart or newfs that layout disks in any even vaguely automated way, and so no tools that would ever have defaults for, say, the size of a swap partition except for the installer. As such, the defaults are quite properly in the installer. This is quite different: there are many tools that care about disk alignment (say, gpart) and, by default, use the GEOM stripesize. The installer is, after this patch, overriding what was meant to be a system-wide default. My concern is that pushing this into the installer means that newfs, zfs, gpart, etc., which all look at the GEOM stripesize for preferred alignment, will still have suboptimal behavior on systems affected by your patch. If we identified which drivers are reporting the wrong alignment, we could fix the whole system at a go by changing it there. As it is, we now have inconsistent default behavior for partitions between tools (the installer and sade will now use a different alignment than gpart on whatever systems you were trying to fix here) and between pre- and post-installation environments. You are papering over a bug in some unspecified driver with some unspecified disks by hacking the installer. This is fine as an expedient for 11.0, but is a ridiculous solution to the problem otherwise. We should just fix the driver for whatever weird disk you have in your machine (what is it, by the way?). Since making the reported "stripe size" match the physical sector size is what GEOM has done since at least 2009, I doubt very much that fixing any bugs in that reported value would have the weird unintended consequences you imply it might. -Nathan DES ___ 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-unsubscr...@freebsd.org"
svn commit: r304292 - head/usr.bin/netstat
Author: tuexen Date: Wed Aug 17 14:44:47 2016 New Revision: 304292 URL: https://svnweb.freebsd.org/changeset/base/304292 Log: Use names for SCTP and UDPLite when reporting the input histogram. MFC after: 3 days Modified: head/usr.bin/netstat/inet6.c Modified: head/usr.bin/netstat/inet6.c == --- head/usr.bin/netstat/inet6.cWed Aug 17 13:19:28 2016 (r304291) +++ head/usr.bin/netstat/inet6.cWed Aug 17 14:44:47 2016 (r304292) @@ -207,11 +207,11 @@ staticconst char *ip6nh[] = { "#129", "#130", "#131", - "#132", + "SCTP", "#133", "#134", "#135", - "#136", + "UDPLite", "#137", "#138", "#139", ___ 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-unsubscr...@freebsd.org"
Re: svn commit: r304142 - head/usr.sbin/bsdinstall/partedit
On Wed, Aug 17, 2016 at 07:36:00AM -0700, Nathan Whitehorn wrote: > > Your contention that the installer does not make policy decisions is > > equally spurious. The installer makes many policy decisions, including > > the disk layout, the size of the swap partition, the name of the pool, > > the use of boot environments (which I dislike but am not allowed to > > override), the number of filesets and their mountpoints (which I also > > dislike and am not allowed to override either), etc. The Unix > > philosophy is to push such decisions up the stack, not down. The > > decision to align partitions on 4096-byte boundaries because we're not > > sure of the correct number but know for a fact that using a smaller > > number can have a huge impact on performance is the installer's to make. > > Those are all things that the operating system does not have defaults > for: there are no tools like, say, gpart or newfs that layout disks in > any even vaguely automated way, and so no tools that would ever have > defaults for, say, the size of a swap partition except for the > installer. As such, the defaults are quite properly in the installer. > This is quite different: there are many tools that care about disk > alignment (say, gpart) and, by default, use the GEOM stripesize. The > installer is, after this patch, overriding what was meant to be a > system-wide default. > > My concern is that pushing this into the installer means that newfs, > zfs, gpart, etc., which all look at the GEOM stripesize for preferred > alignment, will still have suboptimal behavior on systems affected by > your patch. If we identified which drivers are reporting the wrong > alignment, we could fix the whole system at a go by changing it there. > As it is, we now have inconsistent default behavior for partitions > between tools (the installer and sade will now use a different alignment > than gpart on whatever systems you were trying to fix here) and between > pre- and post-installation environments. In long term, prefered aligment is forsing 4k (or may be more): install system on 512b [mirror] disk aligment now may be need required replace disk to 4k aligment. For more flexsible in future now best chois is 4k or more. ___ 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-unsubscr...@freebsd.org"
Re: svn commit: r304142 - head/usr.sbin/bsdinstall/partedit
On 08/17/16 16:49, Slawa Olhovchenkov wrote: On Wed, Aug 17, 2016 at 07:36:00AM -0700, Nathan Whitehorn wrote: In long term, prefered aligment is forsing 4k (or may be more): install system on 512b [mirror] disk aligment now may be need required replace disk to 4k aligment. For more flexsible in future now best chois is 4k or more. Hi, Not sure if it is an issue, but what will happen if a magic disk has a size less than 4K and uses a block size of 512bytes and the disk alignment gets rounded up to 4K. Will any of logic in this patch fail or hang? --HPS ___ 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-unsubscr...@freebsd.org"
Re: svn commit: r304142 - head/usr.sbin/bsdinstall/partedit
Nathan Whitehorn writes: > Dag-Erling Smørgrav writes: > > [...] And you keep refusing to address the fact that most drivers > > don't report a stripe size, except by repeating your claim that they > > do, with no evidence to back it up. Feel free to 'grep -r > > stripesize /usr/src/sys/dev'. Go on, I'll wait. > And yet, if you look at the GEOM XML, it is reported and there. And, > look, it's even right for the AF 512e disks in my machine! Yes, that is one of the few cases where we get it right, as previously mentioned. But it only works because it's known to us (listed in the quirk table) and directly attached. If you replace that drive with a brand new one a year from now, you have no guarantee that the new drive will be recognized as an AF drive. > I've literally never seen a case where we don't already do the right > thing here. The I can only conclude that you have very little real-world experience. I have mentioned several examples to you, and even told you how to confirm, by inspecting the source code, that most drivers do *not* set the stripe size. > It's correct, as far as I can tell, 100% of the time on all possible > variants of AF disks. You keep repeating this, as if it somehow proves me wrong. It doesn't. > One could argue that calling this the "stripesize" is a hack, and I > would agree, One could, but one would be wrong. > As for grepping, the CAM disk drivers are all in sys/cam, not sys/dev, > as I'm sure you know, and you will find all the code that handles this > there. Only for directly attached drives, and most drives do not report the correct physical sector size, which is why we have quirk tables. > We should just fix the driver for whatever weird disk you have in your > machine (what is it, by the way?). Oh please. Now you're just being an . DES -- Dag-Erling Smørgrav - d...@des.no ___ 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-unsubscr...@freebsd.org"
Re: svn commit: r304142 - head/usr.sbin/bsdinstall/partedit
On 08/17/16 07:49, Slawa Olhovchenkov wrote: On Wed, Aug 17, 2016 at 07:36:00AM -0700, Nathan Whitehorn wrote: Your contention that the installer does not make policy decisions is equally spurious. The installer makes many policy decisions, including the disk layout, the size of the swap partition, the name of the pool, the use of boot environments (which I dislike but am not allowed to override), the number of filesets and their mountpoints (which I also dislike and am not allowed to override either), etc. The Unix philosophy is to push such decisions up the stack, not down. The decision to align partitions on 4096-byte boundaries because we're not sure of the correct number but know for a fact that using a smaller number can have a huge impact on performance is the installer's to make. Those are all things that the operating system does not have defaults for: there are no tools like, say, gpart or newfs that layout disks in any even vaguely automated way, and so no tools that would ever have defaults for, say, the size of a swap partition except for the installer. As such, the defaults are quite properly in the installer. This is quite different: there are many tools that care about disk alignment (say, gpart) and, by default, use the GEOM stripesize. The installer is, after this patch, overriding what was meant to be a system-wide default. My concern is that pushing this into the installer means that newfs, zfs, gpart, etc., which all look at the GEOM stripesize for preferred alignment, will still have suboptimal behavior on systems affected by your patch. If we identified which drivers are reporting the wrong alignment, we could fix the whole system at a go by changing it there. As it is, we now have inconsistent default behavior for partitions between tools (the installer and sade will now use a different alignment than gpart on whatever systems you were trying to fix here) and between pre- and post-installation environments. In long term, prefered aligment is forsing 4k (or may be more): install system on 512b [mirror] disk aligment now may be need required replace disk to 4k aligment. For more flexsible in future now best chois is 4k or more. For future-proofing in such circumstances, it might be worth expanding the vfs.zfs.min_auto_ashift tunable into some global thing that the disk drivers (or geom_disk) read to round up the physical sector sizes they would otherwise report. That would ensure that gpart, zfs, etc. all behave consistently in such cases. -Nathan ___ 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-unsubscr...@freebsd.org"
Re: svn commit: r304142 - head/usr.sbin/bsdinstall/partedit
Hans Petter Selasky writes: > Not sure if it is an issue, but what will happen if a magic disk has a > size less than 4K and uses a block size of 512bytes and the disk > alignment gets rounded up to 4K. Will any of logic in this patch fail > or hang? What is a magic disk, and why would you want to install FreeBSD on a drive with less than 4096 bytes available? DES -- Dag-Erling Smørgrav - d...@des.no ___ 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-unsubscr...@freebsd.org"
Re: svn commit: r304142 - head/usr.sbin/bsdinstall/partedit
On Wed, Aug 17, 2016 at 05:00:16PM +0200, Hans Petter Selasky wrote: > On 08/17/16 16:49, Slawa Olhovchenkov wrote: > > On Wed, Aug 17, 2016 at 07:36:00AM -0700, Nathan Whitehorn wrote: > > > > > In long term, prefered aligment is forsing 4k (or may be more): > > install system on 512b [mirror] disk aligment now may be need required > > replace > > disk to 4k aligment. For more flexsible in future now best chois is 4k > > or more. > > Hi, > > Not sure if it is an issue, but what will happen if a magic disk has a > size less than 4K and uses a block size of 512bytes and the disk > alignment gets rounded up to 4K. Will any of logic in this patch fail or > hang? I am not sure about understunding you. Do you talk about disk total size of 1536 bytes and less? ___ 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-unsubscr...@freebsd.org"
Re: svn commit: r304142 - head/usr.sbin/bsdinstall/partedit
On 08/17/16 17:05, Dag-Erling Smørgrav wrote: Hans Petter Selasky writes: Not sure if it is an issue, but what will happen if a magic disk has a size less than 4K and uses a block size of 512bytes and the disk alignment gets rounded up to 4K. Will any of logic in this patch fail or hang? What is a magic disk, and why would you want to install FreeBSD on a drive with less than 4096 bytes available? Hi, My intention is not to install FreeBSD on a 3K disk. My question is pure mathematical, if the bsdinstall will segfault, division by zero or anything like that, if one should try to install FreeBSD on a 3K disk, because you round up the size of the disk to be bigger than it actually is. Should there be a check for too small disks in there? --HPS ___ 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-unsubscr...@freebsd.org"
Re: svn commit: r304142 - head/usr.sbin/bsdinstall/partedit
On 08/17/16 08:03, Dag-Erling Smørgrav wrote: Nathan Whitehorn writes: Dag-Erling Smørgrav writes: [...] And you keep refusing to address the fact that most drivers don't report a stripe size, except by repeating your claim that they do, with no evidence to back it up. Feel free to 'grep -r stripesize /usr/src/sys/dev'. Go on, I'll wait. And yet, if you look at the GEOM XML, it is reported and there. And, look, it's even right for the AF 512e disks in my machine! Yes, that is one of the few cases where we get it right, as previously mentioned. But it only works because it's known to us (listed in the quirk table) and directly attached. If you replace that drive with a brand new one a year from now, you have no guarantee that the new drive will be recognized as an AF drive. Not true at all. All modern disks report their physical sector size, as distinct from the logical one, in their ATA IDENTIFY data and ata_da.c uses that. There is also a small quirks table for some older spinning disks and a few SSDs that lie and mostly hasn't needed additions in quite some time. camcontrol identify correctly reports 4096 for the physical sector size on 5 different random AF-512e disks I just checked (some of those are also, redundantly, in the quirks table). Since this seems to have become the standard, I can't imagine that the quirks table would need to grow much in the future for this issue. I've literally never seen a case where we don't already do the right thing here. The I can only conclude that you have very little real-world experience. I have mentioned several examples to you, and even told you how to confirm, by inspecting the source code, that most drivers do *not* set the stripe size. Most drivers? Yes, sure. Most drivers that people use? No. And I am aware of how to use grep, thanks. It's correct, as far as I can tell, 100% of the time on all possible variants of AF disks. You keep repeating this, as if it somehow proves me wrong. It doesn't. One could argue that calling this the "stripesize" is a hack, and I would agree, One could, but one would be wrong. As for grepping, the CAM disk drivers are all in sys/cam, not sys/dev, as I'm sure you know, and you will find all the code that handles this there. Only for directly attached drives, and most drives do not report the correct physical sector size, which is why we have quirk tables. Which disks? Your original email said that VMware reports too-small values and that there is a bug in the LSI MegaRAID driver. I'm not sure which actual drivers those were (e.g. mfid or through CAM), or how they were set up (RAID or passthrough), but that's a small list and those issues can presumably be fixed. I would be happy to help make those changes if you can provide some more information. We should just fix the driver for whatever weird disk you have in your machine (what is it, by the way?). Oh please. Now you're just being an . I somehow still don't know what problem, on what hardware, you are actually trying to fix. Instead, I get delightful personal invective. The patch is fine for 11.0. I would like to know what bugs it was fixing, so we can fix them more broadly after the release. Is that so much to ask? -Nathan DES ___ 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-unsubscr...@freebsd.org"
Re: svn commit: r304142 - head/usr.sbin/bsdinstall/partedit
Hans Petter Selasky writes: > My intention is not to install FreeBSD on a 3K disk. My question is > pure mathematical, if the bsdinstall will segfault, division by zero > or anything like that, if one should try to install FreeBSD on a 3K > disk, because you round up the size of the disk to be bigger than it > actually is. The code in question computes the offset and size of the largest block of contiguous free space on a disk that already has a partition table. If you even got this far, it would round the offset up to 4096 and the size down by and equivalent amount and you'd get an error box saying "No free space left on device". Say you have a 3584-byte provider with 512-byte sectors formatted with MBR, leaving 3072 bytes (6 sectors) free at offset 512 (1); stripe size is unreported and is arbitrarily set to the smallest common multiple of 512 and 4096, which is 4096; misalignment is 512 % 4096 == 512 bytes; adjustment is (4096 - 512) / 512 == 7 sectors; adjusted offset is 8 sectors, adjusted size is -1 sectors which the caller rejects (and yes, the variables are unsigned and the check is for <= 0, not == 0, so everything works as intended). DES -- Dag-Erling Smørgrav - d...@des.no ___ 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-unsubscr...@freebsd.org"
Re: svn commit: r304142 - head/usr.sbin/bsdinstall/partedit
Nathan Whitehorn writes: > Dag-Erling Smørgrav writes: > > I have mentioned several examples to you, and even told you how to > > confirm, by inspecting the source code, that most drivers do *not* > > set the stripe size. > Most drivers? Yes, sure. Most drivers that people use? No. Every. Single. Dell. Server. Probably every single HP server as well, I haven't checked. VirtualBox gets it wrong. Xen gets it wrong. I believe KVM (including RHEV) and VMWare get it wrong too, but haven't been able to verify. I guess those aren't important to you? DES -- Dag-Erling Smørgrav - d...@des.no ___ 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-unsubscr...@freebsd.org"
Re: svn commit: r304142 - head/usr.sbin/bsdinstall/partedit
On Wed, Aug 17, 2016 at 8:36 AM, Nathan Whitehorn wrote: > As for grepping, the CAM disk drivers are all in sys/cam, not sys/dev, as > I'm sure you know, and you will find all the code that handles this there. There's at least a dozen disk drivers that aren't CAM. The code in CAM that handles this is, at best, a set of heuristics that can and does get it wrong. These two facts alone severely undermine your argument. Warner ___ 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-unsubscr...@freebsd.org"
Re: svn commit: r304142 - head/usr.sbin/bsdinstall/partedit
On Wed, Aug 17, 2016 at 9:26 AM, Nathan Whitehorn wrote: > Not true at all. All modern disks report their physical sector size, as > distinct from the logical one, in their ATA IDENTIFY data and ata_da.c uses > that. You are correct that there are two fields in the ATA IDENTIFY. However, you are incorrect in thinking that all modern disks report their actual physical sector size instead of a 'compatibility' number. We have dozens of quirks and are adding them at the rate of a couple a month to make the current imperfect magic happen. > There is also a small quirks table for some older spinning disks and a > few SSDs that lie and mostly hasn't needed additions in quite some time. > camcontrol identify correctly reports 4096 for the physical sector size on 5 > different random AF-512e disks I just checked (some of those are also, > redundantly, in the quirks table). Since this seems to have become the > standard, I can't imagine that the quirks table would need to grow much in > the future for this issue. Any yet the table continues to grow. As someone who evaluates disks for a large streaming media company, you cannot begin to imagine the number of things that vendors get wrong... Life would be so much easier if you could actually trust vendors to report things correctly in their ATA IDENTIFY command. SCSI is better, but still not perfect. You should really listen to people that have been on the front line here. CAM does a decent job of getting things right. It isn't perfect and can never be perfect. Expecting it to magically change to be perfect is unreasonable and will literally never happen. Warner ___ 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-unsubscr...@freebsd.org"
Re: svn commit: r304142 - head/usr.sbin/bsdinstall/partedit
On Wed, Aug 17, 2016 at 9:45 AM, Dag-Erling Smørgrav wrote: > Nathan Whitehorn writes: >> Dag-Erling Smørgrav writes: >> > I have mentioned several examples to you, and even told you how to >> > confirm, by inspecting the source code, that most drivers do *not* >> > set the stripe size. >> Most drivers? Yes, sure. Most drivers that people use? No. > > Every. Single. Dell. Server. > > Probably every single HP server as well, I haven't checked. > > VirtualBox gets it wrong. Xen gets it wrong. I believe KVM (including > RHEV) and VMWare get it wrong too, but haven't been able to verify. > > I guess those aren't important to you? Also, SD cards get it wrong. It is reported, true enough, but it is often wrong in the sense it can be suboptimal. Different SD cards report different things for the number of sectors to erase at a time. Some vendors do an excellent job of reporting the optimal amount. Others do not (often because the Warner ___ 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-unsubscr...@freebsd.org"
Re: svn commit: r304142 - head/usr.sbin/bsdinstall/partedit
On Wed, Aug 17, 2016 at 10:04 AM, Warner Losh wrote: > On Wed, Aug 17, 2016 at 9:45 AM, Dag-Erling Smørgrav wrote: >> Nathan Whitehorn writes: >>> Dag-Erling Smørgrav writes: >>> > I have mentioned several examples to you, and even told you how to >>> > confirm, by inspecting the source code, that most drivers do *not* >>> > set the stripe size. >>> Most drivers? Yes, sure. Most drivers that people use? No. >> >> Every. Single. Dell. Server. >> >> Probably every single HP server as well, I haven't checked. >> >> VirtualBox gets it wrong. Xen gets it wrong. I believe KVM (including >> RHEV) and VMWare get it wrong too, but haven't been able to verify. >> >> I guess those aren't important to you? > > Also, SD cards get it wrong. It is reported, true enough, but it is often > wrong in the sense it can be suboptimal. Different SD cards report > different things for the number of sectors to erase at a time. Some > vendors do an excellent job of reporting the optimal amount. Others > do not (often because [stupid gmail] often because they copy from last year's design. I've had to override the reported size numerous times to get decent performance from SD cards in the past. Almost all of the recent embedded boards that FreeBSD supports use SD cards. While we provide images to just boot off of, there are several designs that have both a SD card and an embedded eMMC or similar card that we should be able to run the installer on. Warner ___ 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-unsubscr...@freebsd.org"
Re: svn commit: r304142 - head/usr.sbin/bsdinstall/partedit
On 08/17/16 08:45, Dag-Erling Smørgrav wrote: Nathan Whitehorn writes: Dag-Erling Smørgrav writes: I have mentioned several examples to you, and even told you how to confirm, by inspecting the source code, that most drivers do *not* set the stripe size. Most drivers? Yes, sure. Most drivers that people use? No. Every. Single. Dell. Server. Probably every single HP server as well, I haven't checked. VirtualBox gets it wrong. Xen gets it wrong. I believe KVM (including RHEV) and VMWare get it wrong too, but haven't been able to verify. I guess those aren't important to you? DES OK. In which configurations? My Dell servers, for instance, don't do this. How are they set up? What drivers are being used? Is this something that affects passthrough disks, RAIDs, disk images? The point is that *if the reported stripe size is wrong*, more things than partition alignment in the installer will suffer for it. Fixing the installer with a bandaid in the run-up to a release is fine, but *we need to fix the underlying problem*. -Nathan ___ 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-unsubscr...@freebsd.org"
Re: svn commit: r304142 - head/usr.sbin/bsdinstall/partedit
On 08/17/16 08:57, Warner Losh wrote: On Wed, Aug 17, 2016 at 9:26 AM, Nathan Whitehorn wrote: Not true at all. All modern disks report their physical sector size, as distinct from the logical one, in their ATA IDENTIFY data and ata_da.c uses that. You are correct that there are two fields in the ATA IDENTIFY. However, you are incorrect in thinking that all modern disks report their actual physical sector size instead of a 'compatibility' number. We have dozens of quirks and are adding them at the rate of a couple a month to make the current imperfect magic happen. There is also a small quirks table for some older spinning disks and a few SSDs that lie and mostly hasn't needed additions in quite some time. camcontrol identify correctly reports 4096 for the physical sector size on 5 different random AF-512e disks I just checked (some of those are also, redundantly, in the quirks table). Since this seems to have become the standard, I can't imagine that the quirks table would need to grow much in the future for this issue. Any yet the table continues to grow. As someone who evaluates disks for a large streaming media company, you cannot begin to imagine the number of things that vendors get wrong... Life would be so much easier if you could actually trust vendors to report things correctly in their ATA IDENTIFY command. SCSI is better, but still not perfect. You should really listen to people that have been on the front line here. CAM does a decent job of getting things right. It isn't perfect and can never be perfect. Expecting it to magically change to be perfect is unreasonable and will literally never happen. Warner OK, so then what is the solution here? We have a number of tools that need to know this information: gpart, sade, bsdinstall, zfs, graid, etc. If we want to have a consistent set of defaults -- for example, to use 4K across the board, which I think is a good idea -- there should be a central place to set this that does not involve hacking a variety of independent tools. Do you disagree? I don't care how that happens. It happens that the way we currently encode this is geom stripesize. If we feel like we can't get this right in drivers, then we should provide a tunable to set a minimum default alignment. You could implement this in lots of different ways. But having static values hardcoded in random places that makes similar tools (sade, gpart) behave inconsistently cannot possibly be the answer. This is my point, from beginning to end. Is there any reason -- at all -- that we should prefer per-tool one-off changes to fixing the central mechanism we already have to give consistent results that we think are reliable? -Nathan ___ 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-unsubscr...@freebsd.org"
svn commit: r304295 - head/usr.bin/netstat
Author: tuexen Date: Wed Aug 17 16:56:20 2016 New Revision: 304295 URL: https://svnweb.freebsd.org/changeset/base/304295 Log: Fix the output for scope statistics. MFC after: 3 days Modified: head/usr.bin/netstat/inet6.c Modified: head/usr.bin/netstat/inet6.c == --- head/usr.bin/netstat/inet6.cWed Aug 17 15:50:56 2016 (r304294) +++ head/usr.bin/netstat/inet6.cWed Aug 17 16:56:20 2016 (r304295) @@ -488,8 +488,8 @@ ip6_stats(u_long off, const char *name, "{N:/global%s}\n");\ break;\ default:\ - xo_emit("\t\t{qke:name/%x}{:count/%ju} " \ - "addresses scope=%x\n",\ + xo_emit("\t\t{qke:name/%#x}{:count/%ju} " \ + "{N:/addresses scope=%#x}\n",\ i, (uintmax_t)ip6stat.s, i); \ }\ } while (0); ___ 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-unsubscr...@freebsd.org"
Re: svn commit: r304142 - head/usr.sbin/bsdinstall/partedit
On 08/17/16 10:56, Andriy Gapon wrote: On 17/08/2016 19:36, Nathan Whitehorn wrote: OK, so then what is the solution here? We have a number of tools that need to know this information: gpart, sade, bsdinstall, zfs, graid, etc. If we want to have a consistent set of defaults -- for example, to use 4K across the board, which I think is a good idea -- there should be a central place to set this that does not involve hacking a variety of independent tools. Do you disagree? I don't care how that happens. It happens that the way we currently encode this is geom stripesize. If we feel like we can't get this right in drivers, then we should provide a tunable to set a minimum default alignment. You could implement this in lots of different ways. But having static values hardcoded in random places that makes similar tools (sade, gpart) behave inconsistently cannot possibly be the answer. This is my point, from beginning to end. Is there any reason -- at all -- that we should prefer per-tool one-off changes to fixing the central mechanism we already have to give consistent results that we think are reliable? It would be perfect to get a correct description of a disk and to do that in central place. But still I, as a user / administrator, want to be able to _force_ the alignment that I want when I partition a disk, create a filesystem, etc. That is, even if the kernel reports the perfectly correct information and the tools know how to automatically do what's best for me, I still want to eb able to override. And I think that installers and administrative tools should provide a way to do that. And many already do, e.g. 'gpart add -a X'. So, I do not see how striving for the better disk detection (in a central place) and having more knobs in the administration tools are mutually exclusive or conflicting goals. Just my two bits. Agreed 100%. The issue here is that this kind of patch unconditionally overrides the kernel in an unsettable way. I think the right scheme is: 1. Try to get the real values as much as possible. 2. Provide a global hint to all tools that you want some value (e.g. 4K) unless the drivers are *sure* it's the wrong answer. 3. Have options in individual tools to force other values. We have (1), though it can probably be improved, and (3) and just need (2). -Nathan ___ 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-unsubscr...@freebsd.org"
Re: svn commit: r304142 - head/usr.sbin/bsdinstall/partedit
On 17/08/2016 19:36, Nathan Whitehorn wrote: > OK, so then what is the solution here? We have a number of tools that need to > know this information: gpart, sade, bsdinstall, zfs, graid, etc. If we want to > have a consistent set of defaults -- for example, to use 4K across the board, > which I think is a good idea -- there should be a central place to set this > that > does not involve hacking a variety of independent tools. Do you disagree? > > I don't care how that happens. It happens that the way we currently encode > this > is geom stripesize. If we feel like we can't get this right in drivers, then > we > should provide a tunable to set a minimum default alignment. You could > implement > this in lots of different ways. But having static values hardcoded in random > places that makes similar tools (sade, gpart) behave inconsistently cannot > possibly be the answer. > > This is my point, from beginning to end. Is there any reason -- at all -- that > we should prefer per-tool one-off changes to fixing the central mechanism we > already have to give consistent results that we think are reliable? It would be perfect to get a correct description of a disk and to do that in central place. But still I, as a user / administrator, want to be able to _force_ the alignment that I want when I partition a disk, create a filesystem, etc. That is, even if the kernel reports the perfectly correct information and the tools know how to automatically do what's best for me, I still want to eb able to override. And I think that installers and administrative tools should provide a way to do that. And many already do, e.g. 'gpart add -a X'. So, I do not see how striving for the better disk detection (in a central place) and having more knobs in the administration tools are mutually exclusive or conflicting goals. Just my two bits. -- Andriy Gapon ___ 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-unsubscr...@freebsd.org"
svn commit: r304297 - head/sys/modules/dtb/allwinner
Author: manu Date: Wed Aug 17 17:59:09 2016 New Revision: 304297 URL: https://svnweb.freebsd.org/changeset/base/304297 Log: Add sun5i-a13-olinuxino to the build. Modified: head/sys/modules/dtb/allwinner/Makefile Modified: head/sys/modules/dtb/allwinner/Makefile == --- head/sys/modules/dtb/allwinner/Makefile Wed Aug 17 17:54:24 2016 (r304296) +++ head/sys/modules/dtb/allwinner/Makefile Wed Aug 17 17:59:09 2016 (r304297) @@ -8,6 +8,7 @@ DTS=\ olimex-a20-som-evb.dts \ olinuxino-lime.dts \ pcduino3.dts \ - sinovoip-bpi-m3.dts + sinovoip-bpi-m3.dts \ + sun5i-a13-olinuxino.dts .include ___ 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-unsubscr...@freebsd.org"
Re: svn commit: r304176 - in head: include lib/libc/sys sys/compat/freebsd32 sys/kern
On Mon, Aug 15, 2016 at 07:08:51PM +, Konstantin Belousov wrote: > Author: kib > Date: Mon Aug 15 19:08:51 2016 > New Revision: 304176 > URL: https://svnweb.freebsd.org/changeset/base/304176 > Log: > Add an implementation of fdatasync(2). > The syscall is a trivial wrapper around new VOP_FDATASYNC(), sharing > code with fsync(2). For all filesystems, this commit provides the > implementation which delegates the work of VOP_FDATASYNC() to > VOP_FSYNC(). This is functionally correct but not efficient. > This is not yet POSIX-compliant implementation, because it does not > ensure that queued AIO requests are completed before returning. > Reviewed by:mckusick > Discussed with: avg (ZFS), jhb (AIO part) > Tested by: pho > Sponsored by: The FreeBSD Foundation > MFC after: 2 weeks > Differential revision: https://reviews.freebsd.org/D7471 > Modified: > head/include/unistd.h > head/lib/libc/sys/Symbol.map > head/sys/compat/freebsd32/syscalls.master > head/sys/kern/syscalls.master > head/sys/kern/vfs_default.c > head/sys/kern/vfs_syscalls.c > head/sys/kern/vnode_if.src > Modified: head/include/unistd.h > == > --- head/include/unistd.h Mon Aug 15 19:05:41 2016(r304175) > +++ head/include/unistd.h Mon Aug 15 19:08:51 2016(r304176) > @@ -384,6 +384,7 @@ extern int optind, opterr, optopt; > /* ISO/IEC 9945-1: 1996 */ > #if __POSIX_VISIBLE >= 199506 || __XSI_VISIBLE > int fsync(int); > +int fdatasync(int); > > /* > * ftruncate() was in the POSIX Realtime Extension (it's used for shared Apparently these functions were added closely enough in time that they can stay together here :) > [snip] > Modified: head/sys/kern/vfs_syscalls.c > == > --- head/sys/kern/vfs_syscalls.c Mon Aug 15 19:05:41 2016 > (r304175) > +++ head/sys/kern/vfs_syscalls.c Mon Aug 15 19:08:51 2016 > (r304176) > @@ -3354,20 +3354,8 @@ freebsd6_ftruncate(struct thread *td, st > } > #endif > > -/* > - * Sync an open file. > - */ > -#ifndef _SYS_SYSPROTO_H_ > -struct fsync_args { > - int fd; > -}; > -#endif > -int > -sys_fsync(td, uap) > - struct thread *td; > - struct fsync_args /* { > - int fd; > - } */ *uap; > +static int > +kern_fsync(struct thread *td, int fd, bool fullsync) > { > struct vnode *vp; > struct mount *mp; > @@ -3375,11 +3363,15 @@ sys_fsync(td, uap) > cap_rights_t rights; > int error, lock_flags; > > - AUDIT_ARG_FD(uap->fd); > - error = getvnode(td, uap->fd, cap_rights_init(&rights, CAP_FSYNC), &fp); > + AUDIT_ARG_FD(fd); > + error = getvnode(td, fd, cap_rights_init(&rights, CAP_FSYNC), &fp); > if (error != 0) > return (error); > vp = fp->f_vnode; > +#if 0 > + if (!fullsync) > + /* XXXKIB: compete outstanding aio writes */; Under the _POSIX_SYNCHRONIZED_IO option, completing outstanding I/O requests is in fact required for fsync() as well. The fdatasync() function is completely under the _POSIX_SYNCHRONIZED_IO option. We do not implement this option, but keeping fdatasync()'s guarantees a subset of fsync()'s guarantees seems sensible. > +#endif > error = vn_start_write(vp, &mp, V_WAIT | PCATCH); > if (error != 0) > goto drop; > [snip] > Modified: head/sys/kern/vnode_if.src > == > --- head/sys/kern/vnode_if.srcMon Aug 15 19:05:41 2016 > (r304175) > +++ head/sys/kern/vnode_if.srcMon Aug 15 19:08:51 2016 > (r304176) > @@ -703,6 +703,14 @@ vop_add_writecount { > IN int inc; > }; > > +%% fdatasync vp L L L > + > +vop_fdatasync { > + IN struct vnode *vp; > + IN struct thread *td; > +}; > + > + > # The VOPs below are spares at the end of the table to allow new VOPs to be > # added in stable branches without breaking the KBI. New VOPs in HEAD should > # be added above these spares. When merging a new VOP to a stable branch, A waitfor parameter like in vop_fsync may be useful to implement aio_fsync(O_DSYNC) later on. -- Jilles Tjoelker ___ 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-unsubscr...@freebsd.org"
svn commit: r304313 - head/sys/net
Author: ae Date: Wed Aug 17 20:21:33 2016 New Revision: 304313 URL: https://svnweb.freebsd.org/changeset/base/304313 Log: Teach netisr_get_cpuid() to limit a given value to supported by netisr. Use netisr_get_cpuid() in netisr_select_cpuid() to limit cpuid value returned by protocol to be sure that it is not greather than nws_count. PR: 211836 Reviewed by: adrian MFC after:3 days Modified: head/sys/net/if_epair.c head/sys/net/netisr.c Modified: head/sys/net/if_epair.c == --- head/sys/net/if_epair.c Wed Aug 17 19:43:45 2016(r304312) +++ head/sys/net/if_epair.c Wed Aug 17 20:21:33 2016(r304313) @@ -807,9 +807,9 @@ epair_clone_create(struct if_clone *ifc, * cache locality but we can at least allow parallelism. */ sca->cpuid = - netisr_get_cpuid(sca->ifp->if_index % netisr_get_cpucount()); + netisr_get_cpuid(sca->ifp->if_index); scb->cpuid = - netisr_get_cpuid(scb->ifp->if_index % netisr_get_cpucount()); + netisr_get_cpuid(scb->ifp->if_index); /* Initialise pseudo media types. */ ifmedia_init(&sca->media, 0, epair_media_change, epair_media_status); Modified: head/sys/net/netisr.c == --- head/sys/net/netisr.c Wed Aug 17 19:43:45 2016(r304312) +++ head/sys/net/netisr.c Wed Aug 17 20:21:33 2016(r304313) @@ -272,10 +272,7 @@ u_int netisr_get_cpuid(u_int cpunumber) { - KASSERT(cpunumber < nws_count, ("%s: %u > %u", __func__, cpunumber, - nws_count)); - - return (nws_array[cpunumber]); + return (nws_array[cpunumber % nws_count]); } /* @@ -810,10 +807,12 @@ netisr_select_cpuid(struct netisr_proto * dispatch. In the queued case, fall back on the SOURCE * policy. */ - if (*cpuidp != NETISR_CPUID_NONE) + if (*cpuidp != NETISR_CPUID_NONE) { + *cpuidp = netisr_get_cpuid(*cpuidp); return (m); + } if (dispatch_policy == NETISR_DISPATCH_HYBRID) { - *cpuidp = curcpu; + *cpuidp = netisr_get_cpuid(curcpu); return (m); } policy = NETISR_POLICY_SOURCE; ___ 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-unsubscr...@freebsd.org"
svn commit: r304314 - in head/sys/mips: broadcom conf
Author: landonf Date: Wed Aug 17 20:24:14 2016 New Revision: 304314 URL: https://svnweb.freebsd.org/changeset/base/304314 Log: mips/broadcom: Implement CFE-based EARLY_PRINTF support. This adds support for EARLY_PRINTF via the CFE console; the aim is to provide a fix for the otherwise cyclic dependency between PMU discovery and console printf/DELAY: - We need to parse the bhnd(4) core table to determine the address (and type) of the PMU/PLL registers and calculate the CPU clock frequency. - The core table parsing code will emit a printf() if a parse error is hit. - Safely calling printf() without EARLY_PRINTF requires a working DELAY+cninit, which means we need the PMU. Errors in core table parsing shouldn't happen, but lack of EARLY_PRINTF makes debugging more difficult. Approved by: adrian (mentor) Differential Revision:https://reviews.freebsd.org/D7498 Modified: head/sys/mips/broadcom/bcm_machdep.c head/sys/mips/conf/BCM head/sys/mips/conf/SENTRY5 Modified: head/sys/mips/broadcom/bcm_machdep.c == --- head/sys/mips/broadcom/bcm_machdep.cWed Aug 17 20:21:33 2016 (r304313) +++ head/sys/mips/broadcom/bcm_machdep.cWed Aug 17 20:24:14 2016 (r304314) @@ -198,6 +198,21 @@ platform_start(__register_t a0, __regist /* Initialize pcpu stuff */ mips_pcpu0_init(); +#ifdef CFE + /* +* Initialize CFE firmware trampolines. This must be done +* before any CFE APIs are called, including writing +* to the CFE console. +* +* CFE passes the following values in registers: +* a0: firmware handle +* a2: firmware entry point +* a3: entry point seal +*/ + if (a3 == CFE_EPTSEAL) + cfe_init(a0, a2); +#endif + #if 0 /* * Probe the Broadcom on-chip PLL clock registers @@ -234,23 +249,40 @@ platform_start(__register_t a0, __regist mips_timer_early_init(platform_counter_freq); -#ifdef CFE - /* -* Initialize CFE firmware trampolines before -* we initialize the low-level console. -* -* CFE passes the following values in registers: -* a0: firmware handle -* a2: firmware entry point -* a3: entry point seal -*/ - if (a3 == CFE_EPTSEAL) - cfe_init(a0, a2); -#endif - cninit(); mips_init(); mips_timer_init_params(platform_counter_freq, socinfo->double_count); } + +/* + * CFE-based EARLY_PRINTF support. To use, add the following to the kernel + * config: + * option EARLY_PRINTF + * option CFE + * device cfe + */ +#if defined(EARLY_PRINTF) && defined(CFE) +static void +bcm_cfe_eputc(int c) +{ + static int fd = -1; + unsigned char ch; + + ch = (unsigned char) c; + + if (fd == -1) { + if ((fd = cfe_getstdhandle(CFE_STDHANDLE_CONSOLE)) < 0) + return; + } + + if (ch == '\n') + early_putc('\r'); + + while ((cfe_write(fd, &ch, 1)) == 0) + continue; +} + +early_putc_t *early_putc = bcm_cfe_eputc; +#endif /* EARLY_PRINTF */ Modified: head/sys/mips/conf/BCM == --- head/sys/mips/conf/BCM Wed Aug 17 20:21:33 2016(r304313) +++ head/sys/mips/conf/BCM Wed Aug 17 20:24:14 2016(r304314) @@ -52,6 +52,7 @@ options INVARIANT_SUPPORT #options BHND_LOGLEVEL=BHND_DEBUG_LEVEL #options BUS_DEBUG #makeoptions BUS_DEBUG +optionsEARLY_PRINTF #options VERBOSE_SYSINIT #makeoptions VERBOSE_SYSINIT Modified: head/sys/mips/conf/SENTRY5 == --- head/sys/mips/conf/SENTRY5 Wed Aug 17 20:21:33 2016(r304313) +++ head/sys/mips/conf/SENTRY5 Wed Aug 17 20:24:14 2016(r304314) @@ -31,9 +31,8 @@ makeoptions TRAMPLOADADDR=0x807963c0 hints "SENTRY5.hints" include"../broadcom/std.broadcom" -# sentry5 normally ships with cfe firmware; use the console for now +# sentry5 normally ships with cfe firmware optionsCFE -optionsCFE_CONSOLE optionsALT_BREAK_TO_DEBUGGER device cfe @@ -57,6 +56,7 @@ options INVARIANT_SUPPORT #options BUS_DEBUG #makeoptions BUS_DEBUG +optionsEARLY_PRINTF device bhnd device siba ___ 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-unsubscr...@freebsd.org"
svn commit: r304315 - head/share/man/man4
Author: jilles Date: Wed Aug 17 20:27:04 2016 New Revision: 304315 URL: https://svnweb.freebsd.org/changeset/base/304315 Log: rights(4): CAP_FSYNC also permits fdatasync(2). Modified: head/share/man/man4/rights.4 Modified: head/share/man/man4/rights.4 == --- head/share/man/man4/rights.4Wed Aug 17 20:24:14 2016 (r304314) +++ head/share/man/man4/rights.4Wed Aug 17 20:27:04 2016 (r304315) @@ -32,7 +32,7 @@ .\" .\" $FreeBSD$ .\" -.Dd August 27, 2015 +.Dd August 17, 2016 .Dt RIGHTS 4 .Os .Sh NAME @@ -254,6 +254,7 @@ Permit .It Dv CAP_FSYNC Permit .Xr aio_fsync 2 , +.Xr fdatasync 2 , .Xr fsync 2 and .Xr openat 2 ___ 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-unsubscr...@freebsd.org"
svn commit: r304316 - in head/sys/arm: allwinner allwinner/a10 conf
Author: manu Date: Wed Aug 17 20:32:08 2016 New Revision: 304316 URL: https://svnweb.freebsd.org/changeset/base/304316 Log: Rename kernel config A10 into ALLWINNER_UP as it is intend to work with all Allwinner Uniprocessor SoC. As of now it works with A10 and A13 (and possibly R8 as it is the same as the A13). Move files.a10 into a1o subdirectory as it should be. Rename std.a10 into std.allwinner_up Added: head/sys/arm/allwinner/a10/files.a10 (contents, props changed) - copied, changed from r304315, head/sys/arm/allwinner/files.a10 head/sys/arm/allwinner/files.allwinner_up (contents, props changed) head/sys/arm/allwinner/std.allwinner_up (contents, props changed) - copied, changed from r304315, head/sys/arm/allwinner/std.a10 head/sys/arm/conf/ALLWINNER_UP (contents, props changed) - copied, changed from r304315, head/sys/arm/conf/A10 Deleted: head/sys/arm/allwinner/files.a10 head/sys/arm/allwinner/std.a10 head/sys/arm/conf/A10 Copied and modified: head/sys/arm/allwinner/a10/files.a10 (from r304315, head/sys/arm/allwinner/files.a10) == --- head/sys/arm/allwinner/files.a10Wed Aug 17 20:27:04 2016 (r304315, copy source) +++ head/sys/arm/allwinner/a10/files.a10Wed Aug 17 20:32:08 2016 (r304316) @@ -2,4 +2,3 @@ arm/allwinner/a10/a10_intc.c standard arm/allwinner/a10_padconf.cstandard -arm/allwinner/timer.c standard Added: head/sys/arm/allwinner/files.allwinner_up == --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/arm/allwinner/files.allwinner_up Wed Aug 17 20:32:08 2016 (r304316) @@ -0,0 +1,3 @@ +# $FreeBSD$ + +arm/allwinner/timer.c standard Copied and modified: head/sys/arm/allwinner/std.allwinner_up (from r304315, head/sys/arm/allwinner/std.a10) == --- head/sys/arm/allwinner/std.a10 Wed Aug 17 20:27:04 2016 (r304315, copy source) +++ head/sys/arm/allwinner/std.allwinner_up Wed Aug 17 20:32:08 2016 (r304316) @@ -1,4 +1,4 @@ -# Allwinner A10 common options +# Allwinner Uniprocessor common options #$FreeBSD$ cpuCPU_CORTEXA @@ -8,6 +8,7 @@ makeoptions CONF_CFLAGS="-march=armv7a" makeoptionsKERNVIRTADDR=0xc020 optionsKERNVIRTADDR=0xc020 +files "../allwinner/files.allwinner_up" files "../allwinner/files.allwinner" -files "../allwinner/files.a10" +files "../allwinner/a10/files.a10" files "../allwinner/a13/files.a13" Copied and modified: head/sys/arm/conf/ALLWINNER_UP (from r304315, head/sys/arm/conf/A10) == --- head/sys/arm/conf/A10 Wed Aug 17 20:27:04 2016(r304315, copy source) +++ head/sys/arm/conf/ALLWINNER_UP Wed Aug 17 20:32:08 2016 (r304316) @@ -1,5 +1,5 @@ # -# A10 -- Custom configuration for the AllWinner A10 SoC +# ALLWINNER_UP -- Custom configuration for the AllWinner Uniprocessor SoC # # For more information on this file, please read the config(5) manual page, # and/or the handbook section on Kernel Configuration Files: @@ -18,10 +18,10 @@ # # $FreeBSD$ -ident A10 +ident ALLWINNER_UP include"std.armv6" -include"../allwinner/std.a10" +include"../allwinner/std.allwinner_up" optionsINTRNG ___ 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-unsubscr...@freebsd.org"
svn commit: r304317 - head/sys/boot/efi/boot1
Author: tsoome Date: Wed Aug 17 21:29:57 2016 New Revision: 304317 URL: https://svnweb.freebsd.org/changeset/base/304317 Log: boot1.efi Free() should check for NULL to provide consistent behavior with libstand Free(). Reviewed by: imp Approved by: imp (mentor) Differential Revision:https://reviews.freebsd.org/D7497 Modified: head/sys/boot/efi/boot1/boot1.c Modified: head/sys/boot/efi/boot1/boot1.c == --- head/sys/boot/efi/boot1/boot1.c Wed Aug 17 20:32:08 2016 (r304316) +++ head/sys/boot/efi/boot1/boot1.c Wed Aug 17 21:29:57 2016 (r304317) @@ -78,7 +78,8 @@ Malloc(size_t len, const char *file __un void Free(void *buf, const char *file __unused, int line __unused) { - (void)bs->FreePool(buf); + if (buf != NULL) + (void)bs->FreePool(buf); } /* ___ 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-unsubscr...@freebsd.org"
svn commit: r304318 - in head/sys/arm/allwinner: . clk
Author: manu Date: Wed Aug 17 21:44:02 2016 New Revision: 304318 URL: https://svnweb.freebsd.org/changeset/base/304318 Log: Rename allwinner_machdep.{c.h} to aw_machdep.{c.h} as all allwinner source files are name aw_* Added: head/sys/arm/allwinner/aw_machdep.c - copied, changed from r304317, head/sys/arm/allwinner/allwinner_machdep.c head/sys/arm/allwinner/aw_machdep.h - copied, changed from r304317, head/sys/arm/allwinner/allwinner_machdep.h Deleted: head/sys/arm/allwinner/allwinner_machdep.c head/sys/arm/allwinner/allwinner_machdep.h Modified: head/sys/arm/allwinner/a10_ehci.c head/sys/arm/allwinner/a10_gpio.c head/sys/arm/allwinner/a10_mmc.c head/sys/arm/allwinner/aw_if_dwc.c head/sys/arm/allwinner/aw_mp.c head/sys/arm/allwinner/aw_rtc.c head/sys/arm/allwinner/clk/aw_pll.c head/sys/arm/allwinner/files.allwinner head/sys/arm/allwinner/timer.c Modified: head/sys/arm/allwinner/a10_ehci.c == --- head/sys/arm/allwinner/a10_ehci.c Wed Aug 17 21:29:57 2016 (r304317) +++ head/sys/arm/allwinner/a10_ehci.c Wed Aug 17 21:44:02 2016 (r304318) @@ -58,7 +58,7 @@ __FBSDID("$FreeBSD$"); #include #include -#include +#include #include #include #include Modified: head/sys/arm/allwinner/a10_gpio.c == --- head/sys/arm/allwinner/a10_gpio.c Wed Aug 17 21:29:57 2016 (r304317) +++ head/sys/arm/allwinner/a10_gpio.c Wed Aug 17 21:44:02 2016 (r304318) @@ -52,7 +52,7 @@ __FBSDID("$FreeBSD$"); #include #include -#include +#include #include #include #include Modified: head/sys/arm/allwinner/a10_mmc.c == --- head/sys/arm/allwinner/a10_mmc.cWed Aug 17 21:29:57 2016 (r304317) +++ head/sys/arm/allwinner/a10_mmc.cWed Aug 17 21:44:02 2016 (r304318) @@ -48,7 +48,7 @@ __FBSDID("$FreeBSD$"); #include #include -#include +#include #include #include #include Modified: head/sys/arm/allwinner/aw_if_dwc.c == --- head/sys/arm/allwinner/aw_if_dwc.c Wed Aug 17 21:29:57 2016 (r304317) +++ head/sys/arm/allwinner/aw_if_dwc.c Wed Aug 17 21:44:02 2016 (r304318) @@ -40,7 +40,7 @@ __FBSDID("$FreeBSD$"); #include #include -#include +#include #include #include Copied and modified: head/sys/arm/allwinner/aw_machdep.c (from r304317, head/sys/arm/allwinner/allwinner_machdep.c) == --- head/sys/arm/allwinner/allwinner_machdep.c Wed Aug 17 21:29:57 2016 (r304317, copy source) +++ head/sys/arm/allwinner/aw_machdep.c Wed Aug 17 21:44:02 2016 (r304318) @@ -1,6 +1,6 @@ /*- * Copyright (c) 2012 Ganbold Tsagaankhuu - * Copyright (c) 2015-2016 Emmanuel Vadot + * Copyright (c) 2015-2016 Emmanuel Vadot * All rights reserved. * * This code is derived from software written for Brini by Mark Brinicombe @@ -26,6 +26,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * + * from: FreeBSD: //depot/projects/arm/src/sys/arm/ti/ti_machdep.c */ @@ -52,7 +53,7 @@ __FBSDID("$FreeBSD$"); #include #include -#include +#include #include "platform_if.h" Copied and modified: head/sys/arm/allwinner/aw_machdep.h (from r304317, head/sys/arm/allwinner/allwinner_machdep.h) == --- head/sys/arm/allwinner/allwinner_machdep.h Wed Aug 17 21:29:57 2016 (r304317, copy source) +++ head/sys/arm/allwinner/aw_machdep.h Wed Aug 17 21:44:02 2016 (r304318) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2015 Emmanuel Vadot + * Copyright (c) 2015 Emmanuel Vadot * All rights reserved. * * Redistribution and use in source and binary forms, with or without Modified: head/sys/arm/allwinner/aw_mp.c == --- head/sys/arm/allwinner/aw_mp.c Wed Aug 17 21:29:57 2016 (r304317) +++ head/sys/arm/allwinner/aw_mp.c Wed Aug 17 21:44:02 2016 (r304318) @@ -46,7 +46,7 @@ __FBSDID("$FreeBSD$"); #include #include -#include +#include /* Register for all dual-core SoC */ #defineA20_CPUCFG_BASE 0x01c25c00 Modified: head/sys/arm/allwinner/aw_rtc.c == --- head/sys/arm/allwinner/aw_rtc.c Wed Aug 17 21:29:57 2016 (r304317) +++ head/sys/arm/allwinner/aw_rtc.c Wed Aug 17 21:44:02 2016 (r304318) @@ -43,7 +43,7 @@ __FBSDID("$FreeBSD$"); #include #include -#include +#include #include "clock_if.h" Modified: head/sys/arm/allwinner/clk/aw_pll.c
svn commit: r304319 - in head: contrib/llvm/lib/Target/X86 contrib/llvm/tools/clang/lib/Basic lib/clang
Author: dim Date: Wed Aug 17 21:57:11 2016 New Revision: 304319 URL: https://svnweb.freebsd.org/changeset/base/304319 Log: Pull in r262772 from upstream clang trunk (by Simon Pilgrim): [X86] AMD Bobcat CPU (btver1) doesn't support XSAVE btver1 is a SSSE3/SSE4a only CPU - it doesn't have AVX and doesn't support XSAVE. Differential Revision: http://reviews.llvm.org/D17682 Pull in r262782 from upstream llvm trunk (by Simon Pilgrim): [X86] AMD Bobcat CPU (btver1) doesn't support XSAVE btver1 is a SSSE3/SSE4a only CPU - it doesn't have AVX and doesn't support XSAVE. Differential Revision: http://reviews.llvm.org/D17683 This ensures clang does not emit AVX instructions for CPUTYPE=btver1. Reported by: Michel Depeige PR: 211864 MFC after:3 days Modified: head/contrib/llvm/lib/Target/X86/X86.td head/contrib/llvm/tools/clang/lib/Basic/Targets.cpp head/lib/clang/freebsd_cc_version.h Modified: head/contrib/llvm/lib/Target/X86/X86.td == --- head/contrib/llvm/lib/Target/X86/X86.td Wed Aug 17 21:44:02 2016 (r304318) +++ head/contrib/llvm/lib/Target/X86/X86.td Wed Aug 17 21:57:11 2016 (r304319) @@ -576,7 +576,6 @@ def : Proc<"btver1", [ FeaturePRFCHW, FeatureLZCNT, FeaturePOPCNT, - FeatureXSAVE, FeatureSlowSHLD, FeatureLAHFSAHF ]>; Modified: head/contrib/llvm/tools/clang/lib/Basic/Targets.cpp == --- head/contrib/llvm/tools/clang/lib/Basic/Targets.cpp Wed Aug 17 21:44:02 2016(r304318) +++ head/contrib/llvm/tools/clang/lib/Basic/Targets.cpp Wed Aug 17 21:57:11 2016(r304319) @@ -2731,7 +2731,6 @@ bool X86TargetInfo::initFeatureMap( setFeatureEnabledImpl(Features, "prfchw", true); setFeatureEnabledImpl(Features, "cx16", true); setFeatureEnabledImpl(Features, "fxsr", true); -setFeatureEnabledImpl(Features, "xsave", true); break; case CK_BDVER4: setFeatureEnabledImpl(Features, "avx2", true); Modified: head/lib/clang/freebsd_cc_version.h == --- head/lib/clang/freebsd_cc_version.h Wed Aug 17 21:44:02 2016 (r304318) +++ head/lib/clang/freebsd_cc_version.h Wed Aug 17 21:57:11 2016 (r304319) @@ -1,3 +1,3 @@ /* $FreeBSD$ */ -#defineFREEBSD_CC_VERSION 120 +#defineFREEBSD_CC_VERSION 121 ___ 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-unsubscr...@freebsd.org"
svn commit: r304320 - head/secure/lib/libcrypto
Author: jkim Date: Wed Aug 17 22:13:39 2016 New Revision: 304320 URL: https://svnweb.freebsd.org/changeset/base/304320 Log: Disable assembly sources when compiler/assembler cannot compile certain instructions. For example, GCC 4.2.1 + binutils 2.17.50 does not support AVX instructions. Reported by: bde MFC after:2 weeks Added: head/secure/lib/libcrypto/opensslconf-aarch64.h.in - copied, changed from r304319, head/secure/lib/libcrypto/opensslconf-aarch64.h head/secure/lib/libcrypto/opensslconf-arm.h.in - copied, changed from r304319, head/secure/lib/libcrypto/opensslconf-arm.h head/secure/lib/libcrypto/opensslconf-mips.h.in - copied, changed from r304319, head/secure/lib/libcrypto/opensslconf-mips.h head/secure/lib/libcrypto/opensslconf-powerpc.h.in - copied, changed from r304319, head/secure/lib/libcrypto/opensslconf-powerpc.h head/secure/lib/libcrypto/opensslconf-riscv.h.in - copied, changed from r304319, head/secure/lib/libcrypto/opensslconf-riscv.h head/secure/lib/libcrypto/opensslconf-sparc64.h.in - copied, changed from r304319, head/secure/lib/libcrypto/opensslconf-sparc64.h head/secure/lib/libcrypto/opensslconf-x86.h.in - copied, changed from r304319, head/secure/lib/libcrypto/opensslconf-x86.h Deleted: head/secure/lib/libcrypto/opensslconf-aarch64.h head/secure/lib/libcrypto/opensslconf-arm.h head/secure/lib/libcrypto/opensslconf-mips.h head/secure/lib/libcrypto/opensslconf-powerpc.h head/secure/lib/libcrypto/opensslconf-riscv.h head/secure/lib/libcrypto/opensslconf-sparc64.h head/secure/lib/libcrypto/opensslconf-x86.h Modified: head/secure/lib/libcrypto/Makefile head/secure/lib/libcrypto/Makefile.asm head/secure/lib/libcrypto/Makefile.inc Modified: head/secure/lib/libcrypto/Makefile == --- head/secure/lib/libcrypto/Makefile Wed Aug 17 21:57:11 2016 (r304319) +++ head/secure/lib/libcrypto/Makefile Wed Aug 17 22:13:39 2016 (r304320) @@ -22,9 +22,9 @@ MAN+= config.5 des_modes.7 # base sources SRCS= cpt_err.c cryptlib.c cversion.c ex_data.c mem.c mem_dbg.c o_dir.c \ o_fips.c o_init.c o_str.c o_time.c uid.c -.if ${MACHINE_CPUARCH} == "amd64" +.if defined(ASM_amd64) SRCS+= x86_64cpuid.S -.elif ${MACHINE_CPUARCH} == "i386" +.elif defined(ASM_i386) SRCS+= x86cpuid.S .else SRCS+= mem_clr.c @@ -33,10 +33,10 @@ INCS+= crypto.h ebcdic.h opensslv.h ossl # aes SRCS+= aes_cfb.c aes_ctr.c aes_ecb.c aes_ige.c aes_misc.c aes_ofb.c aes_wrap.c -.if ${MACHINE_CPUARCH} == "amd64" +.if defined(ASM_amd64) SRCS+= aes-x86_64.S aesni-mb-x86_64.S aesni-sha1-x86_64.S \ aesni-sha256-x86_64.S aesni-x86_64.S bsaes-x86_64.S vpaes-x86_64.S -.elif ${MACHINE_CPUARCH} == "i386" +.elif defined(ASM_i386) SRCS+= aes-586.S aesni-x86.S vpaes-x86.S .else SRCS+= aes_cbc.c aes_core.c @@ -60,7 +60,7 @@ INCS+=asn1.h asn1_mac.h asn1t.h # bf SRCS+= bf_cfb64.c bf_ecb.c bf_ofb64.c bf_skey.c -.if ${MACHINE_CPUARCH} == "i386" +.if defined(ASM_i386) .if ${MACHINE_CPU:Mi686} SRCS+= bf-686.S .else @@ -82,10 +82,10 @@ SRCS+= bn_add.c bn_blind.c bn_const.c bn bn_exp.c bn_exp2.c bn_gcd.c bn_gf2m.c bn_kron.c bn_lib.c bn_mod.c \ bn_mont.c bn_mpi.c bn_mul.c bn_nist.c bn_prime.c bn_print.c bn_rand.c \ bn_recp.c bn_shift.c bn_sqr.c bn_sqrt.c bn_word.c bn_x931p.c -.if ${MACHINE_CPUARCH} == "amd64" +.if defined(ASM_amd64) SRCS+= rsaz-avx2.S rsaz-x86_64.S rsaz_exp.c x86_64-gcc.c x86_64-gf2m.S \ x86_64-mont.S x86_64-mont5.S -.elif ${MACHINE_CPUARCH} == "i386" +.elif defined(ASM_i386) SRCS+= bn-586.S co-586.S x86-gf2m.S x86-mont.S .else SRCS+= bn_asm.c @@ -98,9 +98,9 @@ INCS+=buffer.h # camellia SRCS+= cmll_cfb.c cmll_ctr.c cmll_ecb.c cmll_ofb.c cmll_utl.c -.if ${MACHINE_CPUARCH} == "amd64" +.if defined(ASM_amd64) SRCS+= cmll_misc.c cmll-x86_64.S -.elif ${MACHINE_CPUARCH} == "i386" +.elif defined(ASM_i386) SRCS+= cmll-x86.S .else SRCS+= camellia.c cmll_cbc.c cmll_misc.c @@ -135,7 +135,7 @@ SRCS+= cbc_cksm.c cbc_enc.c cfb64ede.c c des_old2.c ecb3_enc.c ecb_enc.c ede_cbcm_enc.c enc_read.c enc_writ.c \ fcrypt.c ofb64ede.c ofb64enc.c ofb_enc.c pcbc_enc.c qud_cksm.c \ rand_key.c read2pwd.c rpc_enc.c set_key.c str2key.c xcbc_enc.c -.if ${MACHINE_CPUARCH} == "i386" +.if defined(ASM_i386) SRCS+= crypt586.S des-586.S .else SRCS+= des_enc.c fcrypt_b.c @@ -161,7 +161,7 @@ SRCS+= ec2_mult.c ec2_oct.c ec2_smpl.c e ec_curve.c ec_cvt.c ec_err.c ec_key.c ec_lib.c ec_mult.c ec_oct.c \ ec_pmeth.c ec_print.c eck_prn.c ecp_mont.c ecp_nist.c ecp_oct.c \ ecp_smpl.c -.if ${MACHINE_CPUARCH} == "amd64" +.if defined(ASM_amd64) SRCS+= ecp_nistz256.c ecp_nistz256-x86_64.S .endif INCS+= ec.h @@ -218,9 +218,9 @@ INCS+= md4.h # md5 SRCS+= md5_dgst.c md5_one.c -.if ${MACHINE_CPUARCH} == "amd64" +.if defined(ASM_amd64) SRCS+= md5-x86
svn commit: r304321 - in head/sys: boot/efi/boot1 boot/efi/loader boot/i386/boot2 boot/i386/gptboot boot/i386/gptzfsboot boot/i386/zfsboot boot/userboot/ficl boot/userboot/userboot boot/userboot/zf...
Author: tsoome Date: Thu Aug 18 00:37:07 2016 New Revision: 304321 URL: https://svnweb.freebsd.org/changeset/base/304321 Log: Add SHA512, skein, large blocks support for loader zfs. Updated sha512 from illumos. Using skein from freebsd crypto tree. Since loader itself is using 64MB memory for heap, updated zfsboot to use same, and this also allows to support zfs large blocks. Note, adding additional features does increate zfsboot code, therefore this update does increase zfsboot code to 128k, also I have ported gptldr.S update to zfsldr.S to support 64k+ code. With this update, boot1.efi has almost reached the current limit of the size set for it, so one of the future patches for boot1.efi will need to increase the limit. Currently known missing zfs features in boot loader are edonr and gzip support. Reviewed by: delphij, imp Approved by: imp (mentor) Obtained from:sha256.c update and skein_zfs.c stub from illumos. Differential Revision:https://reviews.freebsd.org/D7418 Added: head/sys/cddl/boot/zfs/skein_zfs.c (contents, props changed) Modified: head/sys/boot/efi/boot1/Makefile head/sys/boot/efi/loader/Makefile head/sys/boot/i386/boot2/Makefile head/sys/boot/i386/gptboot/Makefile head/sys/boot/i386/gptboot/gptldr.S head/sys/boot/i386/gptzfsboot/Makefile head/sys/boot/i386/zfsboot/Makefile head/sys/boot/i386/zfsboot/zfsboot.c head/sys/boot/i386/zfsboot/zfsldr.S head/sys/boot/userboot/ficl/Makefile head/sys/boot/userboot/userboot/Makefile head/sys/boot/userboot/zfs/Makefile head/sys/boot/zfs/Makefile head/sys/boot/zfs/zfsimpl.c head/sys/cddl/boot/zfs/fletcher.c head/sys/cddl/boot/zfs/sha256.c head/sys/cddl/boot/zfs/zfsimpl.h head/sys/cddl/boot/zfs/zfssubr.c Modified: head/sys/boot/efi/boot1/Makefile == --- head/sys/boot/efi/boot1/MakefileWed Aug 17 22:13:39 2016 (r304320) +++ head/sys/boot/efi/boot1/MakefileThu Aug 18 00:37:07 2016 (r304321) @@ -19,12 +19,16 @@ CWARNFLAGS.zfs_module.c += -Wno-missing- CWARNFLAGS.zfs_module.c += -Wno-sign-compare CWARNFLAGS.zfs_module.c += -Wno-unused-parameter CWARNFLAGS.zfs_module.c += -Wno-unused-function +CWARNFLAGS.skein.c += -Wno-cast-align +CWARNFLAGS.skein.c += -Wno-missing-variable-declarations .endif # architecture-specific loader code SRCS= boot1.c self_reloc.c start.S ufs_module.c .if ${MK_ZFS} != "no" SRCS+= zfs_module.c +SRCS+= skein.c skein_block.c +.PATH: ${.CURDIR}/../../../crypto/skein .endif CFLAGS+= -I. @@ -40,6 +44,7 @@ CFLAGS+= -DEFI_DEBUG .if ${MK_ZFS} != "no" CFLAGS+= -I${.CURDIR}/../../zfs/ CFLAGS+= -I${.CURDIR}/../../../cddl/boot/zfs/ +CFLAGS+= -I${.CURDIR}/../../../crypto/skein CFLAGS+= -DEFI_ZFS_BOOT .endif Modified: head/sys/boot/efi/loader/Makefile == --- head/sys/boot/efi/loader/Makefile Wed Aug 17 22:13:39 2016 (r304320) +++ head/sys/boot/efi/loader/Makefile Thu Aug 18 00:37:07 2016 (r304321) @@ -24,6 +24,8 @@ SRCS= autoload.c \ .if ${MK_ZFS} != "no" SRCS+= zfs.c .PATH: ${.CURDIR}/../../zfs +SRCS+= skein.c skein_block.c +.PATH: ${.CURDIR}/../../../crypto/skein # Disable warnings that are currently incompatible with the zfs boot code CWARNFLAGS.zfs.c+= -Wno-sign-compare @@ -53,6 +55,7 @@ CFLAGS+= -I${.CURDIR}/../../i386/libi386 .if ${MK_ZFS} != "no" CFLAGS+= -I${.CURDIR}/../../zfs CFLAGS+= -I${.CURDIR}/../../../cddl/boot/zfs +CFLAGS+= -I${.CURDIR}/../../../crypto/skein CFLAGS+= -DEFI_ZFS_BOOT .endif CFLAGS+= -DNO_PCI -DEFI Modified: head/sys/boot/i386/boot2/Makefile == --- head/sys/boot/i386/boot2/Makefile Wed Aug 17 22:13:39 2016 (r304320) +++ head/sys/boot/i386/boot2/Makefile Thu Aug 18 00:37:07 2016 (r304321) @@ -33,7 +33,7 @@ CFLAGS= -fomit-frame-pointer \ -DSIOSPD=${BOOT_COMCONSOLE_SPEED} \ -I${.CURDIR}/../../common \ -I${.CURDIR}/../btx/lib -I. \ - -Wall -Waggregate-return -Wbad-function-cast -Wcast-align \ + -Wall -Waggregate-return -Wbad-function-cast -Wno-cast-align \ -Wmissing-declarations -Wmissing-prototypes -Wnested-externs \ -Wpointer-arith -Wshadow -Wstrict-prototypes -Wwrite-strings \ -Winline Modified: head/sys/boot/i386/gptboot/Makefile == --- head/sys/boot/i386/gptboot/Makefile Wed Aug 17 22:13:39 2016 (r304320) +++ head/sys/boot/i386/gptboot/Makefile Thu Aug 18 00:37:07 2016 (r304321) @@ -32,10 +32,10 @@ CFLAGS= -DBOOTPROG=\"gptboot\" \ -I${.CURDIR}/../btx/lib -I. \ -I${.CURDIR}/../boot2 \
svn commit: r304322 - head/sys/net80211
Author: adrian Date: Thu Aug 18 01:25:12 2016 New Revision: 304322 URL: https://svnweb.freebsd.org/changeset/base/304322 Log: [net80211] correctly lock the ifp before accessing the lladdr. Tested by: dhw Modified: head/sys/net80211/ieee80211_ioctl.c Modified: head/sys/net80211/ieee80211_ioctl.c == --- head/sys/net80211/ieee80211_ioctl.c Thu Aug 18 00:37:07 2016 (r304321) +++ head/sys/net80211/ieee80211_ioctl.c Thu Aug 18 01:25:12 2016 (r304322) @@ -3394,10 +3394,12 @@ ieee80211_ioctl(struct ifnet *ifp, u_lon * Check if the MAC address was changed * via SIOCSIFLLADDR ioctl. */ + if_addr_rlock(ifp); if ((ifp->if_flags & IFF_UP) == 0 && !IEEE80211_ADDR_EQ(vap->iv_myaddr, IF_LLADDR(ifp))) IEEE80211_ADDR_COPY(vap->iv_myaddr, IF_LLADDR(ifp)); + if_addr_runlock(ifp); } break; case SIOCADDMULTI: ___ 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-unsubscr...@freebsd.org"
svn commit: r304323 - head/sys/dev/usb/net
Author: yongari Date: Thu Aug 18 01:48:58 2016 New Revision: 304323 URL: https://svnweb.freebsd.org/changeset/base/304323 Log: Pass PHY location information and remove PHY access hack. Modified: head/sys/dev/usb/net/if_axge.c head/sys/dev/usb/net/if_axgereg.h Modified: head/sys/dev/usb/net/if_axge.c == --- head/sys/dev/usb/net/if_axge.c Thu Aug 18 01:25:12 2016 (r304322) +++ head/sys/dev/usb/net/if_axge.c Thu Aug 18 01:48:58 2016 (r304323) @@ -303,8 +303,6 @@ axge_miibus_writereg(device_t dev, int p int locked; sc = device_get_softc(dev); - if (sc->sc_phyno != phy) - return (0); locked = mtx_owned(&sc->sc_mtx); if (!locked) AXGE_LOCK(sc); @@ -434,7 +432,6 @@ axge_attach_post(struct usb_ether *ue) struct axge_softc *sc; sc = uether_getsc(ue); - sc->sc_phyno = 3; /* Initialize controller and get station address. */ axge_chip_init(sc); @@ -466,7 +463,7 @@ axge_attach_post_sub(struct usb_ether *u mtx_lock(&Giant); error = mii_attach(ue->ue_dev, &ue->ue_miibus, ifp, uether_ifmedia_upd, ue->ue_methods->ue_mii_sts, - BMSR_DEFCAPMASK, sc->sc_phyno, MII_OFFSET_ANY, MIIF_DOPAUSE); + BMSR_DEFCAPMASK, AXGE_PHY_ADDR, MII_OFFSET_ANY, MIIF_DOPAUSE); mtx_unlock(&Giant); return (error); Modified: head/sys/dev/usb/net/if_axgereg.h == --- head/sys/dev/usb/net/if_axgereg.h Thu Aug 18 01:25:12 2016 (r304322) +++ head/sys/dev/usb/net/if_axgereg.h Thu Aug 18 01:48:58 2016 (r304323) @@ -158,11 +158,12 @@ enum { AXGE_N_TRANSFER, }; +#defineAXGE_PHY_ADDR 3 + struct axge_softc { struct usb_ethersc_ue; struct mtx sc_mtx; struct usb_xfer *sc_xfer[AXGE_N_TRANSFER]; - int sc_phyno; int sc_flags; #defineAXGE_FLAG_LINK 0x0001 /* got a link */ ___ 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-unsubscr...@freebsd.org"
svn commit: r304324 - head/sys/dev/usb/net
Author: yongari Date: Thu Aug 18 02:14:39 2016 New Revision: 304324 URL: https://svnweb.freebsd.org/changeset/base/304324 Log: Don't explicitly call MIIBUS_STATCHG() method handler. Link state change should be handled by PHY driver. Some broken PHY H/Ws may need that workaround but it seems axge(4) don't use such PHYs. Modified: head/sys/dev/usb/net/if_axge.c Modified: head/sys/dev/usb/net/if_axge.c == --- head/sys/dev/usb/net/if_axge.c Thu Aug 18 01:48:58 2016 (r304323) +++ head/sys/dev/usb/net/if_axge.c Thu Aug 18 02:14:39 2016 (r304324) @@ -724,11 +724,6 @@ axge_tick(struct usb_ether *ue) AXGE_LOCK_ASSERT(sc, MA_OWNED); mii_tick(mii); - if ((sc->sc_flags & AXGE_FLAG_LINK) == 0) { - axge_miibus_statchg(ue->ue_dev); - if ((sc->sc_flags & AXGE_FLAG_LINK) != 0) - axge_start(ue); - } } static void ___ 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-unsubscr...@freebsd.org"
svn commit: r304325 - head/sys/dev/usb/net
Author: yongari Date: Thu Aug 18 04:25:17 2016 New Revision: 304325 URL: https://svnweb.freebsd.org/changeset/base/304325 Log: Rename cryptic RX filter constants with more readable ones. No functional change. Modified: head/sys/dev/usb/net/if_axge.c head/sys/dev/usb/net/if_axgereg.h Modified: head/sys/dev/usb/net/if_axge.c == --- head/sys/dev/usb/net/if_axge.c Thu Aug 18 02:14:39 2016 (r304324) +++ head/sys/dev/usb/net/if_axge.c Thu Aug 18 04:25:17 2016 (r304325) @@ -743,11 +743,11 @@ axge_setmulti(struct usb_ether *ue) rxmode = axge_read_cmd_2(sc, AXGE_ACCESS_MAC, 2, AXGE_RCR); if (ifp->if_flags & (IFF_ALLMULTI | IFF_PROMISC)) { - rxmode |= RCR_AMALL; + rxmode |= RCR_ACPT_ALL_MCAST; axge_write_cmd_2(sc, AXGE_ACCESS_MAC, 2, AXGE_RCR, rxmode); return; } - rxmode &= ~RCR_AMALL; + rxmode &= ~RCR_ACPT_ALL_MCAST; if_maddr_rlock(ifp); TAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) { @@ -775,9 +775,9 @@ axge_setpromisc(struct usb_ether *ue) rxmode = axge_read_cmd_2(sc, AXGE_ACCESS_MAC, 2, AXGE_RCR); if (ifp->if_flags & IFF_PROMISC) - rxmode |= RCR_PRO; + rxmode |= RCR_PROMISC; else - rxmode &= ~RCR_PRO; + rxmode &= ~RCR_PROMISC; axge_write_cmd_2(sc, AXGE_ACCESS_MAC, 2, AXGE_RCR, rxmode); axge_setmulti(ue); @@ -828,16 +828,16 @@ axge_init(struct usb_ether *ue) axge_csum_cfg(ue); /* Configure RX settings. */ - rxmode = (RCR_AM | RCR_SO | RCR_DROP_CRCE); + rxmode = (RCR_ACPT_MCAST | RCR_START | RCR_DROP_CRCERR); if ((ifp->if_capenable & IFCAP_RXCSUM) != 0) rxmode |= RCR_IPE; /* If we want promiscuous mode, set the allframes bit. */ if (ifp->if_flags & IFF_PROMISC) - rxmode |= RCR_PRO; + rxmode |= RCR_PROMISC; if (ifp->if_flags & IFF_BROADCAST) - rxmode |= RCR_AB; + rxmode |= RCR_ACPT_BCAST; axge_write_cmd_2(sc, AXGE_ACCESS_MAC, 2, AXGE_RCR, rxmode); Modified: head/sys/dev/usb/net/if_axgereg.h == --- head/sys/dev/usb/net/if_axgereg.h Thu Aug 18 02:14:39 2016 (r304324) +++ head/sys/dev/usb/net/if_axgereg.h Thu Aug 18 04:25:17 2016 (r304325) @@ -57,13 +57,14 @@ /* Rx control register */ #defineAXGE_RCR0x0b #defineRCR_STOP0x -#defineRCR_PRO 0x0001 -#defineRCR_AMALL 0x0002 -#defineRCR_AB 0x0008 -#defineRCR_AM 0x0010 -#defineRCR_AP 0x0020 -#defineRCR_SO 0x0080 -#defineRCR_DROP_CRCE 0x0100 +#defineRCR_PROMISC 0x0001 +#defineRCR_ACPT_ALL_MCAST 0x0002 +#defineRCR_AUTOPAD_BNDRY 0x0004 +#defineRCR_ACPT_BCAST 0x0008 +#defineRCR_ACPT_MCAST 0x0010 +#defineRCR_ACPT_PHY_MCAST 0x0020 +#defineRCR_START 0x0080 +#defineRCR_DROP_CRCERR 0x0100 #defineRCR_IPE 0x0200 #defineRCR_TX_CRC_PAD 0x0400 ___ 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-unsubscr...@freebsd.org"
svn commit: r304326 - head/sys/dev/usb/net
Author: yongari Date: Thu Aug 18 05:07:02 2016 New Revision: 304326 URL: https://svnweb.freebsd.org/changeset/base/304326 Log: Switch to TX header format rather than directly manipulating header structures. This simplifies mbuf copy operation to USB buffers as well as improving readability. The controller supports Microsoft LSOv1(aka TSO) but this change set does not include the support due to copying overhead to USB buffers and large amount of memory waste. Remove useless ZLP padding which seems to come from Linux. Required bits the code tried to set was not copied into USB buffer so it had no effect. Unlike Linux, FreeBSD USB stack automatically generates ZLP so no explicit padding is required in driver.[1] Micro-optimize updating IFCOUNTER_OPACKETS counter by moving it out of TX loop since updating counter is not cheap operation as it did long time ago and we already know how many number of packets were queued after exiting the loop. While here, fix a checksum offloading bug which will happen when upper stack computes checksum while H/W checksum offloading is active. The controller should be notified to not recompute the checksum in this case. Reviewed by: kevlo (initial version), hselasky Pointed out by: hselasky [1] Modified: head/sys/dev/usb/net/if_axge.c head/sys/dev/usb/net/if_axgereg.h Modified: head/sys/dev/usb/net/if_axge.c == --- head/sys/dev/usb/net/if_axge.c Thu Aug 18 04:25:17 2016 (r304325) +++ head/sys/dev/usb/net/if_axge.c Thu Aug 18 05:07:02 2016 (r304326) @@ -35,6 +35,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -144,8 +145,8 @@ static const struct usb_config axge_conf .type = UE_BULK, .endpoint = UE_ADDR_ANY, .direction = UE_DIR_OUT, - .frames = 16, - .bufsize = 16 * MCLBYTES, + .frames = AXGE_N_FRAMES, + .bufsize = AXGE_N_FRAMES * MCLBYTES, .flags = {.pipe_bof = 1,.force_short_xfer = 1,}, .callback = axge_bulk_write_callback, .timeout = 1, /* 10 seconds */ @@ -630,7 +631,7 @@ axge_bulk_write_callback(struct usb_xfer struct ifnet *ifp; struct usb_page_cache *pc; struct mbuf *m; - uint32_t txhdr; + struct axge_frame_txhdr txhdr; int nframes, pos; sc = usbd_xfer_softc(xfer); @@ -651,36 +652,25 @@ tr_setup: return; } - for (nframes = 0; nframes < 16 && + for (nframes = 0; nframes < AXGE_N_FRAMES && !IFQ_DRV_IS_EMPTY(&ifp->if_snd); nframes++) { IFQ_DRV_DEQUEUE(&ifp->if_snd, m); if (m == NULL) break; usbd_xfer_set_frame_offset(xfer, nframes * MCLBYTES, - nframes); - pos = 0; + nframes); pc = usbd_xfer_get_frame(xfer, nframes); - txhdr = htole32(m->m_pkthdr.len); - usbd_copy_in(pc, 0, &txhdr, sizeof(txhdr)); - txhdr = 0; - txhdr = htole32(txhdr); - usbd_copy_in(pc, 4, &txhdr, sizeof(txhdr)); - pos += 8; + txhdr.mss = 0; + txhdr.len = htole32(AXGE_TXBYTES(m->m_pkthdr.len)); + if ((ifp->if_capenable & IFCAP_TXCSUM) != 0 && + (m->m_pkthdr.csum_flags & AXGE_CSUM_FEATURES) == 0) + txhdr.len |= htole32(AXGE_CSUM_DISABLE); + + pos = 0; + usbd_copy_in(pc, pos, &txhdr, sizeof(txhdr)); + pos += sizeof(txhdr); usbd_m_copy_in(pc, pos, m, 0, m->m_pkthdr.len); pos += m->m_pkthdr.len; - if ((pos % usbd_xfer_max_framelen(xfer)) == 0) - txhdr |= 0x80008000; - - /* -* XXX -* Update TX packet counter here. This is not -* correct way but it seems that there is no way -* to know how many packets are sent at the end -* of transfer because controller combines -* multiple writes into single one if there is -* room in TX buffer of controller. -*/ - if_inc_counter(ifp, IFCOUNTER_OPACKETS, 1); /* * if there's a BPF listener, bounce a copy @@ -694,6 +684,16 @@ tr_setup:
svn commit: r304327 - head/sys/dev/hyperv/netvsc
Author: sephe Date: Thu Aug 18 05:33:58 2016 New Revision: 304327 URL: https://svnweb.freebsd.org/changeset/base/304327 Log: hyperv/hn: Pass RX packet info to netvsc_recv. This paves to nuke netvsc_packet, which does not serves much purpose now. MFC after:1 week Sponsored by: Microsoft Differential Revision:https://reviews.freebsd.org/D7541 Modified: head/sys/dev/hyperv/netvsc/hv_net_vsc.h head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c head/sys/dev/hyperv/netvsc/hv_rndis.h head/sys/dev/hyperv/netvsc/hv_rndis_filter.c head/sys/dev/hyperv/netvsc/if_hnvar.h Modified: head/sys/dev/hyperv/netvsc/hv_net_vsc.h == --- head/sys/dev/hyperv/netvsc/hv_net_vsc.h Thu Aug 18 05:07:02 2016 (r304326) +++ head/sys/dev/hyperv/netvsc/hv_net_vsc.h Thu Aug 18 05:33:58 2016 (r304327) @@ -275,7 +275,6 @@ typedef void (*pfn_on_send_rx_completion #endif typedef struct netvsc_packet_ { - uint16_tvlan_tci; uint32_tstatus; uint32_ttot_data_buf_len; void*data; Modified: head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c == --- head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c Thu Aug 18 05:07:02 2016(r304326) +++ head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c Thu Aug 18 05:33:58 2016(r304327) @@ -1278,9 +1278,7 @@ hn_lro_rx(struct lro_ctrl *lc, struct mb */ int netvsc_recv(struct hn_rx_ring *rxr, netvsc_packet *packet, -const rndis_tcp_ip_csum_info *csum_info, -const struct rndis_hash_info *hash_info, -const struct rndis_hash_value *hash_value) +const struct hn_recvinfo *info) { struct ifnet *ifp = rxr->hn_ifp; struct mbuf *m_new; @@ -1332,28 +1330,28 @@ netvsc_recv(struct hn_rx_ring *rxr, netv do_csum = 0; /* receive side checksum offload */ - if (csum_info != NULL) { + if (info->csum_info != NULL) { /* IP csum offload */ - if (csum_info->receive.ip_csum_succeeded && do_csum) { + if (info->csum_info->receive.ip_csum_succeeded && do_csum) { m_new->m_pkthdr.csum_flags |= (CSUM_IP_CHECKED | CSUM_IP_VALID); rxr->hn_csum_ip++; } /* TCP/UDP csum offload */ - if ((csum_info->receive.tcp_csum_succeeded || -csum_info->receive.udp_csum_succeeded) && do_csum) { + if ((info->csum_info->receive.tcp_csum_succeeded || +info->csum_info->receive.udp_csum_succeeded) && do_csum) { m_new->m_pkthdr.csum_flags |= (CSUM_DATA_VALID | CSUM_PSEUDO_HDR); m_new->m_pkthdr.csum_data = 0x; - if (csum_info->receive.tcp_csum_succeeded) + if (info->csum_info->receive.tcp_csum_succeeded) rxr->hn_csum_tcp++; else rxr->hn_csum_udp++; } - if (csum_info->receive.ip_csum_succeeded && - csum_info->receive.tcp_csum_succeeded) + if (info->csum_info->receive.ip_csum_succeeded && + info->csum_info->receive.tcp_csum_succeeded) do_lro = 1; } else { const struct ether_header *eh; @@ -1409,19 +1407,18 @@ netvsc_recv(struct hn_rx_ring *rxr, netv } } skip: - if ((packet->vlan_tci != 0) && - (ifp->if_capenable & IFCAP_VLAN_HWTAGGING) != 0) { - m_new->m_pkthdr.ether_vtag = packet->vlan_tci; + if (info->vlan_info != NULL) { + m_new->m_pkthdr.ether_vtag = info->vlan_info->u1.s1.vlan_id; m_new->m_flags |= M_VLANTAG; } - if (hash_info != NULL && hash_value != NULL) { + if (info->hash_info != NULL && info->hash_value != NULL) { rxr->hn_rss_pkts++; - m_new->m_pkthdr.flowid = hash_value->hash_value; - if ((hash_info->hash_info & NDIS_HASH_FUNCTION_MASK) == + m_new->m_pkthdr.flowid = info->hash_value->hash_value; + if ((info->hash_info->hash_info & NDIS_HASH_FUNCTION_MASK) == NDIS_HASH_FUNCTION_TOEPLITZ) { uint32_t type = - (hash_info->hash_info & NDIS_HASH_TYPE_MASK); + (info->hash_info->hash_info & NDIS_HASH_TYPE_MASK); switch (type) { case NDIS_HASH_IPV4: @@ -1450,8 +1447,8 @@ skip: } } } else { - if (hash_value != NULL) { - m_new->m_pkthdr.flow
svn commit: r304329 - head/sys/dev/hyperv/netvsc
Author: sephe Date: Thu Aug 18 05:44:58 2016 New Revision: 304329 URL: https://svnweb.freebsd.org/changeset/base/304329 Log: hyperv/hn: Constify RNDIS messages on RX path. MFC after:1 week Sponsored by: Microsoft Differential Revision:https://reviews.freebsd.org/D7542 Modified: head/sys/dev/hyperv/netvsc/hv_rndis_filter.c Modified: head/sys/dev/hyperv/netvsc/hv_rndis_filter.c == --- head/sys/dev/hyperv/netvsc/hv_rndis_filter.cThu Aug 18 05:35:43 2016(r304328) +++ head/sys/dev/hyperv/netvsc/hv_rndis_filter.cThu Aug 18 05:44:58 2016(r304329) @@ -67,10 +67,11 @@ __FBSDID("$FreeBSD$"); */ static int hv_rf_send_request(rndis_device *device, rndis_request *request, uint32_t message_type); -static void hv_rf_receive_response(rndis_device *device, rndis_msg *response); +static void hv_rf_receive_response(rndis_device *device, +const rndis_msg *response); static void hv_rf_receive_indicate_status(rndis_device *device, - rndis_msg *response); -static void hv_rf_receive_data(struct hn_rx_ring *rxr, rndis_msg *message, +const rndis_msg *response); +static void hv_rf_receive_data(struct hn_rx_ring *rxr, const rndis_msg *message, netvsc_packet *pkt); static int hv_rf_query_device(rndis_device *device, uint32_t oid, void *result, uint32_t *result_size); @@ -295,7 +296,7 @@ sendit: * RNDIS filter receive response */ static void -hv_rf_receive_response(rndis_device *device, rndis_msg *response) +hv_rf_receive_response(rndis_device *device, const rndis_msg *response) { rndis_request *request = NULL; rndis_request *next_request; @@ -417,9 +418,9 @@ cleanup: * RNDIS filter receive indicate status */ static void -hv_rf_receive_indicate_status(rndis_device *device, rndis_msg *response) +hv_rf_receive_indicate_status(rndis_device *device, const rndis_msg *response) { - rndis_indicate_status *indicate = &response->msg.indicate_status; + const rndis_indicate_status *indicate = &response->msg.indicate_status; switch(indicate->status) { case RNDIS_STATUS_MEDIA_CONNECT: @@ -518,10 +519,10 @@ skip: * RNDIS filter receive data */ static void -hv_rf_receive_data(struct hn_rx_ring *rxr, rndis_msg *message, +hv_rf_receive_data(struct hn_rx_ring *rxr, const rndis_msg *message, netvsc_packet *pkt) { - rndis_packet *rndis_pkt; + const rndis_packet *rndis_pkt; uint32_t data_offset; struct hn_recvinfo info; @@ -563,7 +564,7 @@ hv_rf_on_receive(netvsc_dev *net_dev, struct hn_rx_ring *rxr, netvsc_packet *pkt) { rndis_device *rndis_dev; - rndis_msg *rndis_hdr; + const rndis_msg *rndis_hdr; /* Make sure the rndis device state is initialized */ if (net_dev->extension == NULL) { ___ 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-unsubscr...@freebsd.org"
svn commit: r304330 - head/sys/dev/hyperv/netvsc
Author: sephe Date: Thu Aug 18 05:52:03 2016 New Revision: 304330 URL: https://svnweb.freebsd.org/changeset/base/304330 Log: hyperv/hn: Get rid of the useless netvsc_packet MFC after:1 week Sponsored by: Microsoft Differential Revision:https://reviews.freebsd.org/D7544 Modified: head/sys/dev/hyperv/netvsc/hv_net_vsc.c head/sys/dev/hyperv/netvsc/hv_net_vsc.h head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c head/sys/dev/hyperv/netvsc/hv_rndis.h head/sys/dev/hyperv/netvsc/hv_rndis_filter.c head/sys/dev/hyperv/netvsc/hv_rndis_filter.h Modified: head/sys/dev/hyperv/netvsc/hv_net_vsc.c == --- head/sys/dev/hyperv/netvsc/hv_net_vsc.c Thu Aug 18 05:44:58 2016 (r304329) +++ head/sys/dev/hyperv/netvsc/hv_net_vsc.c Thu Aug 18 05:52:03 2016 (r304330) @@ -66,7 +66,7 @@ static int hv_nv_connect_to_vsp(struct static void hv_nv_on_send_completion(netvsc_dev *net_dev, struct vmbus_channel *, const struct vmbus_chanpkt_hdr *pkt); static void hv_nv_on_receive_completion(struct vmbus_channel *chan, -uint64_t tid, uint32_t status); +uint64_t tid); static void hv_nv_on_receive(netvsc_dev *net_dev, struct hn_rx_ring *rxr, struct vmbus_channel *chan, const struct vmbus_chanpkt_hdr *pkt); @@ -844,11 +844,8 @@ hv_nv_on_receive(netvsc_dev *net_dev, st { const struct vmbus_chanpkt_rxbuf *pkt; const struct hn_nvs_hdr *nvs_hdr; - netvsc_packet vsc_pkt; - netvsc_packet *net_vsc_pkt = &vsc_pkt; int count = 0; int i = 0; - int status = HN_NVS_STATUS_OK; /* Make sure that this is a RNDIS message. */ nvs_hdr = VMBUS_CHANPKT_CONST_DATA(pkthdr); @@ -870,16 +867,9 @@ hv_nv_on_receive(netvsc_dev *net_dev, st /* Each range represents 1 RNDIS pkt that contains 1 Ethernet frame */ for (i = 0; i < count; i++) { - net_vsc_pkt->status = HN_NVS_STATUS_OK; - net_vsc_pkt->data = ((uint8_t *)net_dev->rx_buf + - pkt->cp_rxbuf[i].rb_ofs); - net_vsc_pkt->tot_data_buf_len = pkt->cp_rxbuf[i].rb_len; - - hv_rf_on_receive(net_dev, rxr, net_vsc_pkt); - - /* XXX pretty broken; whack it */ - if (net_vsc_pkt->status != HN_NVS_STATUS_OK) - status = HN_NVS_STATUS_FAILED; + hv_rf_on_receive(net_dev, rxr, + (const uint8_t *)net_dev->rx_buf + pkt->cp_rxbuf[i].rb_ofs, + pkt->cp_rxbuf[i].rb_len); } /* @@ -887,7 +877,7 @@ hv_nv_on_receive(netvsc_dev *net_dev, st * messages (not just data messages) will trigger a response * message back to the host. */ - hv_nv_on_receive_completion(chan, pkt->cp_hdr.cph_xactid, status); + hv_nv_on_receive_completion(chan, pkt->cp_hdr.cph_xactid); } /* @@ -896,15 +886,14 @@ hv_nv_on_receive(netvsc_dev *net_dev, st * Send a receive completion packet to RNDIS device (ie NetVsp) */ static void -hv_nv_on_receive_completion(struct vmbus_channel *chan, uint64_t tid, -uint32_t status) +hv_nv_on_receive_completion(struct vmbus_channel *chan, uint64_t tid) { struct hn_nvs_rndis_ack ack; int retries = 0; int ret = 0; ack.nvs_type = HN_NVS_TYPE_RNDIS_ACK; - ack.nvs_status = status; + ack.nvs_status = HN_NVS_STATUS_OK; retry_send_cmplt: /* Send the completion */ Modified: head/sys/dev/hyperv/netvsc/hv_net_vsc.h == --- head/sys/dev/hyperv/netvsc/hv_net_vsc.h Thu Aug 18 05:44:58 2016 (r304329) +++ head/sys/dev/hyperv/netvsc/hv_net_vsc.h Thu Aug 18 05:52:03 2016 (r304330) @@ -274,12 +274,6 @@ typedef void (*pfn_on_send_rx_completion #define BITS_PER_LONG 32 #endif -typedef struct netvsc_packet_ { - uint32_tstatus; - uint32_ttot_data_buf_len; - void*data; -} netvsc_packet; - typedef struct { uint8_t mac_addr[6]; /* Assumption unsigned long */ uint8_t link_state; Modified: head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c == --- head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c Thu Aug 18 05:44:58 2016(r304329) +++ head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c Thu Aug 18 05:52:03 2016(r304330) @@ -1277,7 +1277,7 @@ hn_lro_rx(struct lro_ctrl *lc, struct mb * Note: This is no longer used as a callback */ int -netvsc_recv(struct hn_rx_ring *rxr, netvsc_packet *packet, +netvsc_recv(struct hn_rx_ring *rxr, const void *data, int dlen, const struct hn_recvinfo *info) { struct ifnet *ifp = rxr->hn_ifp; @@ -1291,17 +1291,16 @@ netvsc_recv(struct hn_rx_ring *rxr, netv /* * Bail out if pack
Re: svn commit: r304320 - head/secure/lib/libcrypto
On Wed, 17 Aug 2016, Jung-uk Kim wrote: Log: Disable assembly sources when compiler/assembler cannot compile certain instructions. For example, GCC 4.2.1 + binutils 2.17.50 does not support AVX instructions. Reported by: bde MFC after: 2 weeks Thanks. I tried WITHOUT_SSL to work around this, but that was broken too. WITHOUT_SSL removes too many things, but not enough for makeworld to actually work. I sent the list to bdrewery. He already knows about the problem of course. Bruce ___ 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-unsubscr...@freebsd.org"
svn commit: r304331 - head/sys/dev/hyperv/utilities
Author: sephe Date: Thu Aug 18 06:03:55 2016 New Revision: 304331 URL: https://svnweb.freebsd.org/changeset/base/304331 Log: hyperv/kvp: Remove unnecessary function parameter. MFC after:1 week Sponsored by: Microsoft Differential Revision:https://reviews.freebsd.org/D7550 Modified: head/sys/dev/hyperv/utilities/hv_kvp.c Modified: head/sys/dev/hyperv/utilities/hv_kvp.c == --- head/sys/dev/hyperv/utilities/hv_kvp.c Thu Aug 18 05:52:03 2016 (r304330) +++ head/sys/dev/hyperv/utilities/hv_kvp.c Thu Aug 18 06:03:55 2016 (r304331) @@ -217,10 +217,9 @@ hv_kvp_transaction_init(hv_kvp_sc *sc, u * hv_kvp - version neogtiation function */ static void -hv_kvp_negotiate_version(struct hv_vmbus_icmsg_hdr *icmsghdrp, -struct hv_vmbus_icmsg_negotiate *negop, -uint8_t *buf) +hv_kvp_negotiate_version(struct hv_vmbus_icmsg_hdr *icmsghdrp, uint8_t *buf) { + struct hv_vmbus_icmsg_negotiate *negop; int icframe_vercnt; int icmsg_vercnt; @@ -641,7 +640,7 @@ hv_kvp_process_request(void *context, in hv_kvp_transaction_init(sc, recvlen, requestid, kvp_buf); if (icmsghdrp->icmsgtype == HV_ICMSGTYPE_NEGOTIATE) { - hv_kvp_negotiate_version(icmsghdrp, NULL, kvp_buf); + hv_kvp_negotiate_version(icmsghdrp, kvp_buf); hv_kvp_respond_host(sc, ret); /* ___ 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-unsubscr...@freebsd.org"
svn commit: r304332 - head/sys/dev/usb/net
Author: yongari Date: Thu Aug 18 06:29:07 2016 New Revision: 304332 URL: https://svnweb.freebsd.org/changeset/base/304332 Log: Introduce axge_rxfilter() which configures RX filtering and replace axge_setmulti()/axge_setpromisc() with axge_rxfilter(). Multicast filter programming and promiscuous mode requires access to a common RX configuration register so there is no need to use separate functions with added complexity. axge_rxfilter() does not read back AXGE_RCR register since accessing a register in USB is too slow and we already have all knowledge of required configuration. Rebuilding RX filter configuration is simpler and faster than manipulating every bits after reading back the register. Note, axge_rxfilter() does not set RCR_IPE(IP header alignment on 32bit boundary) to disable extra padding bytes insertion. The extra padding wastes ethernet to USB host bandwidth as well as complicating RX handling logic. Current USB framework requires copying RX frames to mbufs so there is no need to worry about alignment. Previously axge_rx_frame() performed wrong bound check due to the extra padding and it was broken when RX checksum offloading is disabled. See added comment in axge_rx_frame () for actual RX packet layout. In axge_init(), disable WOL. It's meaningless to enable WOL in normal operation. In axge_rxeof(), use properly sized mbuf rather than blindly allocating a mbuf cluster. Use RX H/W checksum offloading only when administrator requested RX checksum offloading. Previously it always used RX H/W checksum offloading result regardless of RX checksum offloading state. Separate L4 checksum offloading validation from L3 one and properly set required offloading bits for each layer. This is to fix setting L4 checksum offloading bits for L3 packets. There are still lots of RX errors(probably RX FIFO overflows) under moderate load. Users are strongly recommended to enable ethernet flow control. Reviewed by: kevlo (initial version), hselasky Modified: head/sys/dev/usb/net/if_axge.c head/sys/dev/usb/net/if_axgereg.h Modified: head/sys/dev/usb/net/if_axge.c == --- head/sys/dev/usb/net/if_axge.c Thu Aug 18 06:03:55 2016 (r304331) +++ head/sys/dev/usb/net/if_axge.c Thu Aug 18 06:29:07 2016 (r304332) @@ -104,8 +104,7 @@ static uether_fn_t axge_init; static uether_fn_t axge_stop; static uether_fn_t axge_start; static uether_fn_t axge_tick; -static uether_fn_t axge_setmulti; -static uether_fn_t axge_setpromisc; +static uether_fn_t axge_rxfilter; static int axge_read_mem(struct axge_softc *, uint8_t, uint16_t, uint16_t, void *, int); @@ -200,8 +199,8 @@ static const struct usb_ether_methods ax .ue_init = axge_init, .ue_stop = axge_stop, .ue_tick = axge_tick, - .ue_setmulti = axge_setmulti, - .ue_setpromisc = axge_setpromisc, + .ue_setmulti = axge_rxfilter, + .ue_setpromisc = axge_rxfilter, .ue_mii_upd = axge_ifmedia_upd, .ue_mii_sts = axge_ifmedia_sts, }; @@ -727,7 +726,7 @@ axge_tick(struct usb_ether *ue) } static void -axge_setmulti(struct usb_ether *ue) +axge_rxfilter(struct usb_ether *ue) { struct axge_softc *sc; struct ifnet *ifp; @@ -741,14 +740,26 @@ axge_setmulti(struct usb_ether *ue) h = 0; AXGE_LOCK_ASSERT(sc, MA_OWNED); - rxmode = axge_read_cmd_2(sc, AXGE_ACCESS_MAC, 2, AXGE_RCR); + /* +* Configure RX settings. +* Don't set RCR_IPE(IP header alignment on 32bit boundary) to disable +* inserting extra padding bytes. This wastes ethernet to USB host +* bandwidth as well as complicating RX handling logic. Current USB +* framework requires copying RX frames to mbufs so there is no need +* to worry about alignment. +*/ + rxmode = RCR_DROP_CRCERR | RCR_START; + if (ifp->if_flags & IFF_BROADCAST) + rxmode |= RCR_ACPT_BCAST; if (ifp->if_flags & (IFF_ALLMULTI | IFF_PROMISC)) { + if (ifp->if_flags & IFF_PROMISC) + rxmode |= RCR_PROMISC; rxmode |= RCR_ACPT_ALL_MCAST; axge_write_cmd_2(sc, AXGE_ACCESS_MAC, 2, AXGE_RCR, rxmode); return; } - rxmode &= ~RCR_ACPT_ALL_MCAST; + rxmode |= RCR_ACPT_MCAST; if_maddr_rlock(ifp); TAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) { if (ifma->ifma_addr->sa_family != AF_LINK) @@ -764,26 +775,6 @@ axge_setmulti(struct usb_ether *ue) } static void -axge_setpromisc(struct usb_ether *ue) -{ - struct axge_softc *sc; - struct ifnet *ifp; - uint16_t rxmode; - - sc = uether_getsc(ue); - ifp = uether_getifp(ue); - rxmode = axge_read_cmd_2(sc, AXGE_ACCESS_MAC, 2, AXGE_RCR); - -
svn commit: r304333 - head/sys/dev/usb/net
Author: yongari Date: Thu Aug 18 06:35:09 2016 New Revision: 304333 URL: https://svnweb.freebsd.org/changeset/base/304333 Log: When usbd_transfer_setup() fails, don't call usbd_transfer_unsetup(). Modified: head/sys/dev/usb/net/if_axge.c Modified: head/sys/dev/usb/net/if_axge.c == --- head/sys/dev/usb/net/if_axge.c Thu Aug 18 06:29:07 2016 (r304332) +++ head/sys/dev/usb/net/if_axge.c Thu Aug 18 06:35:09 2016 (r304333) @@ -553,7 +553,8 @@ axge_attach(device_t dev) sc->sc_xfer, axge_config, AXGE_N_TRANSFER, sc, &sc->sc_mtx); if (error) { device_printf(dev, "allocating USB transfers failed\n"); - goto detach; + mtx_destroy(&sc->sc_mtx); + return (ENXIO); } ue->ue_sc = sc; ___ 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-unsubscr...@freebsd.org"
svn commit: r304334 - in head/lib/libc: net sys
Author: kevlo Date: Thu Aug 18 06:39:09 2016 New Revision: 304334 URL: https://svnweb.freebsd.org/changeset/base/304334 Log: Remove from the SYNOPSIS. Modified: head/lib/libc/net/inet_net.3 head/lib/libc/sys/bind.2 head/lib/libc/sys/connect.2 head/lib/libc/sys/listen.2 head/lib/libc/sys/recv.2 head/lib/libc/sys/send.2 head/lib/libc/sys/socket.2 Modified: head/lib/libc/net/inet_net.3 == --- head/lib/libc/net/inet_net.3Thu Aug 18 06:35:09 2016 (r304333) +++ head/lib/libc/net/inet_net.3Thu Aug 18 06:39:09 2016 (r304334) @@ -32,7 +32,7 @@ .\" .\" $FreeBSD$ .\" -.Dd February 26, 2006 +.Dd August 18, 2016 .Dt INET_NET 3 .Os .Sh NAME @@ -42,7 +42,6 @@ .Sh LIBRARY .Lb libc .Sh SYNOPSIS -.In sys/types.h .In sys/socket.h .In netinet/in.h .In arpa/inet.h Modified: head/lib/libc/sys/bind.2 == --- head/lib/libc/sys/bind.2Thu Aug 18 06:35:09 2016(r304333) +++ head/lib/libc/sys/bind.2Thu Aug 18 06:39:09 2016(r304334) @@ -28,7 +28,7 @@ .\" @(#)bind.2 8.1 (Berkeley) 6/4/93 .\" $FreeBSD$ .\" -.Dd June 26, 2014 +.Dd August 18, 2016 .Dt BIND 2 .Os .Sh NAME @@ -37,7 +37,6 @@ .Sh LIBRARY .Lb libc .Sh SYNOPSIS -.In sys/types.h .In sys/socket.h .Ft int .Fn bind "int s" "const struct sockaddr *addr" "socklen_t addrlen" Modified: head/lib/libc/sys/connect.2 == --- head/lib/libc/sys/connect.2 Thu Aug 18 06:35:09 2016(r304333) +++ head/lib/libc/sys/connect.2 Thu Aug 18 06:39:09 2016(r304334) @@ -28,7 +28,7 @@ .\" @(#)connect.2 8.1 (Berkeley) 6/4/93 .\" $FreeBSD$ .\" -.Dd February 4, 2016 +.Dd August 18, 2016 .Dt CONNECT 2 .Os .Sh NAME @@ -37,7 +37,6 @@ .Sh LIBRARY .Lb libc .Sh SYNOPSIS -.In sys/types.h .In sys/socket.h .Ft int .Fn connect "int s" "const struct sockaddr *name" "socklen_t namelen" Modified: head/lib/libc/sys/listen.2 == --- head/lib/libc/sys/listen.2 Thu Aug 18 06:35:09 2016(r304333) +++ head/lib/libc/sys/listen.2 Thu Aug 18 06:39:09 2016(r304334) @@ -28,7 +28,7 @@ .\"From: @(#)listen.2 8.2 (Berkeley) 12/11/93 .\" $FreeBSD$ .\" -.Dd July 15, 2014 +.Dd August 18, 2016 .Dt LISTEN 2 .Os .Sh NAME @@ -37,7 +37,6 @@ .Sh LIBRARY .Lb libc .Sh SYNOPSIS -.In sys/types.h .In sys/socket.h .Ft int .Fn listen "int s" "int backlog" Modified: head/lib/libc/sys/recv.2 == --- head/lib/libc/sys/recv.2Thu Aug 18 06:35:09 2016(r304333) +++ head/lib/libc/sys/recv.2Thu Aug 18 06:39:09 2016(r304334) @@ -28,7 +28,7 @@ .\" @(#)recv.2 8.3 (Berkeley) 2/21/94 .\" $FreeBSD$ .\" -.Dd January 29, 2016 +.Dd August 18, 2016 .Dt RECV 2 .Os .Sh NAME @@ -40,7 +40,6 @@ .Sh LIBRARY .Lb libc .Sh SYNOPSIS -.In sys/types.h .In sys/socket.h .Ft ssize_t .Fn recv "int s" "void *buf" "size_t len" "int flags" Modified: head/lib/libc/sys/send.2 == --- head/lib/libc/sys/send.2Thu Aug 18 06:35:09 2016(r304333) +++ head/lib/libc/sys/send.2Thu Aug 18 06:39:09 2016(r304334) @@ -28,7 +28,7 @@ .\" From: @(#)send.2 8.2 (Berkeley) 2/21/94 .\" $FreeBSD$ .\" -.Dd January 29, 2016 +.Dd August 18, 2016 .Dt SEND 2 .Os .Sh NAME @@ -40,7 +40,6 @@ .Sh LIBRARY .Lb libc .Sh SYNOPSIS -.In sys/types.h .In sys/socket.h .Ft ssize_t .Fn send "int s" "const void *msg" "size_t len" "int flags" Modified: head/lib/libc/sys/socket.2 == --- head/lib/libc/sys/socket.2 Thu Aug 18 06:35:09 2016(r304333) +++ head/lib/libc/sys/socket.2 Thu Aug 18 06:39:09 2016(r304334) @@ -28,7 +28,7 @@ .\" From: @(#)socket.2 8.1 (Berkeley) 6/4/93 .\" $FreeBSD$ .\" -.Dd March 19, 2013 +.Dd August 18, 2016 .Dt SOCKET 2 .Os .Sh NAME @@ -37,7 +37,6 @@ .Sh LIBRARY .Lb libc .Sh SYNOPSIS -.In sys/types.h .In sys/socket.h .Ft int .Fn socket "int domain" "int type" "int protocol" ___ 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-unsubscr...@freebsd.org"
svn commit: r304335 - head/sys/dev/usb/net
Author: yongari Date: Thu Aug 18 06:46:14 2016 New Revision: 304335 URL: https://svnweb.freebsd.org/changeset/base/304335 Log: In axge_stop(), clear medium receive enable bit which will stop RX MAC operation. Modified: head/sys/dev/usb/net/if_axge.c Modified: head/sys/dev/usb/net/if_axge.c == --- head/sys/dev/usb/net/if_axge.c Thu Aug 18 06:39:09 2016 (r304334) +++ head/sys/dev/usb/net/if_axge.c Thu Aug 18 06:46:14 2016 (r304335) @@ -847,12 +847,17 @@ axge_stop(struct usb_ether *ue) { struct axge_softc *sc; struct ifnet *ifp; + uint16_t val; sc = uether_getsc(ue); ifp = uether_getifp(ue); AXGE_LOCK_ASSERT(sc, MA_OWNED); + val = axge_read_cmd_2(sc, AXGE_ACCESS_MAC, 2, AXGE_MSR); + val &= ~MSR_RE; + axge_write_cmd_2(sc, AXGE_ACCESS_MAC, 2, AXGE_MSR, val); + ifp->if_drv_flags &= ~(IFF_DRV_RUNNING | IFF_DRV_OACTIVE); sc->sc_flags &= ~AXGE_FLAG_LINK; ___ 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-unsubscr...@freebsd.org"
Re: svn commit: r304187 - in head: . share/man/man4 sys/conf sys/dev/mcd sys/modules sys/modules/mcd
On 16/08/2016 4:54 AM, John Baldwin wrote: On Monday, August 15, 2016 08:38:02 PM John Baldwin wrote: Author: jhb Date: Mon Aug 15 20:38:02 2016 New Revision: 304187 URL: https://svnweb.freebsd.org/changeset/base/304187 Log: Remove the mcd(4) driver for Mitsumi CD-ROM players. This is a driver for a pre-ATAPI ISA CD-ROM adapter. As noted in the manpage, this driver is only useful as a backend to cdcontrol to play audio CDs since it doesn't use DMA, so its data performance is "abysmal" (and that was true in the mid 90's). No one stepped up to test patches for it either when I last posted patches to convert it from timeout(9) to callout(9). I have a few more drivers that are both very old and that people have no business using in 12 (think ISA adapters that don't do DMA and can't be used with pccard) that I will be removing over the next little while. I brought up a list of drivers on arch@ a couple of years ago and the conversation drifted off into the weeds about trimming GENERIC, etc. No one objected to the specific drivers I listed though (and I got a few pleas of "please remove"). If someone shows up desperately clutching an ISA adapter they can always dig up the source from svn and deal with forward porting it for whatever API changes have happened since it was removed. I would imagine any machine still holding one of these probably has not enough memory to run FreeBSD. would we still run in 2MB? ___ 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-unsubscr...@freebsd.org"