]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
9 years agoRename pmap_kenter_temp to pmap_kenter_temporary to be consistent with the
andrew [Thu, 11 Sep 2014 10:53:57 +0000 (10:53 +0000)]
Rename pmap_kenter_temp to pmap_kenter_temporary to be consistent with the
other architectures with this function.

Submitted by: Svatopluk Kraus <onwahe at gmail.com>
Submitted by: Michal Meloun <meloun at miracle.cz>

9 years ago* constify argument of in6_addrscope();
ae [Thu, 11 Sep 2014 10:27:59 +0000 (10:27 +0000)]
* constify argument of in6_addrscope();
* use IN6_IS_ADDR_XXX() macro instead of hardcoded values;
* for multicast addresses just return scope value, the only exception
  is addresses with 0x0F scope value (RFC 4291 p2.7.0);

Obtained from: Yandex LLC
Sponsored by: Yandex LLC

9 years agoAdd new a M_START() mbuf macro that returns a pointer to the start of
rwatson [Thu, 11 Sep 2014 07:16:15 +0000 (07:16 +0000)]
Add new a M_START() mbuf macro that returns a pointer to the start of
an mbuf's storage (internal or external).

Add a new M_SIZE() mbuf macro that returns the size of an mbuf's
storage (internal or external).

These contrast with m_data and m_len, which are with respect to data
in the buffer, rather than the buffer itself.

Rewrite M_LEADINGSPACE() and M_TRAILINGSPACE() in terms of M_START()
and M_SIZE().

This is done as we currently have many instances of using mbuf flags
to generate pointers or lengths for internal storage in header and
regular mbufs, as well as to external storage. Rather than replicate
this logic throughout the network stack, centralising the
implementation will make it easier for us to refine mbuf storage.
This should also help reduce bugs by limiting the amount of
mbuf-type-specific pointer arithmetic.  Followup changes will
propagate use of the macros throughout the stack.

M_SIZE() conflicts with one macro in the Chelsio driver; rename that
macro in a slightly unsatisfying way to eliminate the collision.

MFC after: 3 days
Obtained from: jeff (with enhancements)
Sponsored by: EMC / Isilon Storage Division
Reviewed by: bz, glebius, np
Differential Revision: https://reviews.freebsd.org/D753

9 years agoSince r270929 raw sockets expect network byte order.
glebius [Thu, 11 Sep 2014 05:48:39 +0000 (05:48 +0000)]
Since r270929 raw sockets expect network byte order.

Submitted by: avg

9 years agoUpdate a stale comment.
alc [Thu, 11 Sep 2014 03:16:57 +0000 (03:16 +0000)]
Update a stale comment.

9 years agoUse the linker to perform relocations in the SUNW_dof section rather than
markj [Thu, 11 Sep 2014 01:04:56 +0000 (01:04 +0000)]
Use the linker to perform relocations in the SUNW_dof section rather than
doing them in drti during startup. This fixes a number of problems with
using USDT probes in stripped executables and shared libraries, and with
USDT probes in static functions.

Reviewed by: rpaulo
MFC after: 1 month
Sponsored by: EMC / Isilon Storage Division
Phabric:  D751

9 years agoFix a bug which could break extended attributes in a dump output.
hrs [Wed, 10 Sep 2014 22:37:20 +0000 (22:37 +0000)]
Fix a bug which could break extended attributes in a dump output.
This occurred when a file was >892kB long and had a large data (>1kB)
in the extended attributes.

Reported by: Masashi Toriumi
Reviewed by: mckusick

9 years agoFix header output when -P is specified and (ncpus - 1) != maxid.
hrs [Wed, 10 Sep 2014 22:34:08 +0000 (22:34 +0000)]
Fix header output when -P is specified and (ncpus - 1) != maxid.

Reported by: Hiroaki Shimizu
PR: 152738

9 years agoMFamd64: Use initializecpu() to set various model-specific registers on
jhb [Wed, 10 Sep 2014 21:37:47 +0000 (21:37 +0000)]
MFamd64: Use initializecpu() to set various model-specific registers on
AP startup and AP resume (it was already used for BSP startup and BSP
resume).
- Split code to do one-time probing of cache properties out of
  initializecpu() and into initializecpucache().  This is called once on
  the BSP during boot.
- Move enable_sse() into initializecpu().
- Call initializecpu() for AP startup instead of enable_sse() and
  manually frobbing MSR_EFER to enable PG_NX.
- Call initializecpu() when an AP resumes.  In theory this will now
  properly re-enable PG_NX in MSR_EFER when resuming a PAE kernel on
  APs.

9 years agoTo workaround an errata on certain Pentium Pro CPUs, i386 disables
jhb [Wed, 10 Sep 2014 21:25:54 +0000 (21:25 +0000)]
To workaround an errata on certain Pentium Pro CPUs, i386 disables
the local APIC in initializecpu() and re-enables it if the APIC code
decides to use the local APIC after all.  Rework this workaround
slightly so that initializecpu() won't re-disable the local APIC if
it is called after the APIC code re-enables the local APIC.

9 years agoExtend UNMAP blacklist on all STEC SSD models.
mav [Wed, 10 Sep 2014 21:24:15 +0000 (21:24 +0000)]
Extend UNMAP blacklist on all STEC SSD models.

None of existing STEC devices need UNMAP or even support it well, having
many limitations and even hanging sometimes executing those commands.
New devices that may use UNMAP going to be released under HGST name.

MFC after: 3 days

9 years agoAdd support for calling pcibios routines from the
imp [Wed, 10 Sep 2014 21:07:00 +0000 (21:07 +0000)]
Add support for calling pcibios routines from the
bootloader. Implement the following routines:
pcibios-device-count count the number of instances of a devid
pcibios-read-config read pci config space
pcibios-write-config write pci config space
pcibios-find-devclass find the nth device with a given devclass
pcibios-find-device find the nth device with a given devid
pcibios-locator convert bus device function ti pcibios locator
These commands are thin wrappers over their PCI BIOS 2.1 counterparts. More
informaiton, such as it is, can be found in the standard.

Export a nunmber of pcibios.X variables into the environment to report
what the PCI IDENTIFY command returned.

Also implmenet a new command line primitive (pci-device-count), but don't
include it by default just yet, since it depends on the recently added
words and any errors here can render a system unbootable.

This is intended to allow the boot loader to do special things based
on the hardware it finds. This could be have special settings that are
optimized for the specific cards, or even loading special drivers. It
goes without saying that writing to pci config space should not be
done without a just cause and a sound mind.

Sponsored by: Netflix

9 years agoMove code to set various MSRs on AMD cpus out of printcpuinfo() and
jhb [Wed, 10 Sep 2014 21:04:44 +0000 (21:04 +0000)]
Move code to set various MSRs on AMD cpus out of printcpuinfo() and
into initalizecpu() instead.

9 years agoAdd PCI ID for Promise TX8660 8-port 3Gbps HBA.
mav [Wed, 10 Sep 2014 19:53:31 +0000 (19:53 +0000)]
Add PCI ID for Promise TX8660 8-port 3Gbps HBA.

This device reports RAID subclass, but appears to be AHCI compatible.

Submitted by: Yuri Perejilin <yuri@rivera.ru>
MFC after: 1 week

9 years agoRegen after 271401.
asomers [Wed, 10 Sep 2014 19:22:14 +0000 (19:22 +0000)]
Regen after 271401.

Sponsored by: Spectra Logic

9 years agoConditionalize build of etcupdate(8) on MK_RCS. Since etcupdate calls
asomers [Wed, 10 Sep 2014 19:00:17 +0000 (19:00 +0000)]
Conditionalize build of etcupdate(8) on MK_RCS. Since etcupdate calls
merge(1), which is part of the RCS package, it must not be installed if
WITHOUT_RCS update is set. Otherwise, it will produce confusing errors.

CR: https://reviews.freebsd.org/D691
MFC after: 1 week
Sponsored by: Spectra Logic

9 years agoAdd scope zone id to the in_endpoints and hc_metrics structures.
ae [Wed, 10 Sep 2014 16:26:18 +0000 (16:26 +0000)]
Add scope zone id to the in_endpoints and hc_metrics structures.

A non-global IPv6 address can be used in more than one zone of the same
scope. This zone index is used to identify to which zone a non-global
address belongs.

Also we can have many foreign hosts with equal non-global addresses,
but from different zones. So, they can have different metrics in the
host cache.

Obtained from: Yandex LLC
Sponsored by: Yandex LLC

9 years agoUnify interrupts bit definition and usage. While here remove PSR_C_bit.
andrew [Wed, 10 Sep 2014 15:25:15 +0000 (15:25 +0000)]
Unify interrupts bit definition and usage. While here remove PSR_C_bit.

Submitted by: Svatopluk Kraus <onwahe at gmail.com>,
Michal Meloun <meloun at miracle.cz>
Differential Revision: https://reviews.freebsd.org/D754

9 years agoAbort the create_socket test if socket creation fails.
asomers [Wed, 10 Sep 2014 14:57:26 +0000 (14:57 +0000)]
Abort the create_socket test if socket creation fails.

MFC after: 1 week
Reported by: Coverity
CID: 1232756

9 years agoAdd additional checks for IPV6_PKTINFO handling (RFC 3542):
ae [Wed, 10 Sep 2014 14:32:07 +0000 (14:32 +0000)]
Add additional checks for IPV6_PKTINFO handling (RFC 3542):

* Return ENETDOWN when interface specified by ipi6_ifindex is not
  enabled for IPv6 use.
* Return EADDRNOTAVAIL when ipi6_ifindex specifies an interface, but the
  address ipi6_addr is not available for use on that interface.
* Return EINVAL when ipi6_addr is multicast address.

Obtained from: Yandex LLC
Sponsored by: Yandex LLC

9 years agoMake sure we handle less than zero timeouts in iSCSI initiator and target
trasz [Wed, 10 Sep 2014 14:04:10 +0000 (14:04 +0000)]
Make sure we handle less than zero timeouts in iSCSI initiator and target
in a reasonable way.

Sponsored by: The FreeBSD Foundation

9 years agoAdd more register values to armreg.h and remove CPU_CONTROL_32BP_ENABLE
andrew [Wed, 10 Sep 2014 13:38:52 +0000 (13:38 +0000)]
Add more register values to armreg.h and remove CPU_CONTROL_32BP_ENABLE
from asm.h as they were already defined in armreg.h.

Submitted by: Michal Meloun <meloun at miracle.cz>

9 years agoMake it possible to disable NOP-In PDUs by the iSCSI initiator by setting
trasz [Wed, 10 Sep 2014 13:34:27 +0000 (13:34 +0000)]
Make it possible to disable NOP-In PDUs by the iSCSI initiator by setting
kern.cam.ctl.iscsi.ping_timeout to 0.  This fixes interoperability with
some initiators that don't properly support NOP-Ins, namely iPXE/gPXE.

Submitted by: Chen Wen <pokkys@gmail.com>
MFC after: 1 week
Sponsored by: The FreeBSD Foundation

9 years agoMake in6_pcblookup_hash_locked and in6_pcbladdr static.
ae [Wed, 10 Sep 2014 13:17:35 +0000 (13:17 +0000)]
Make in6_pcblookup_hash_locked and in6_pcbladdr static.

Obtained from: Yandex LLC
Sponsored by: Yandex LLC

9 years agoStop accessing the saved stack pointer by looking past the end of the
andrew [Wed, 10 Sep 2014 13:07:01 +0000 (13:07 +0000)]
Stop accessing the saved stack pointer by looking past the end of the
array of registers.

Submitted by: Michal Meloun <meloun at miracle.cz>

9 years agoRemove unused arguments for VOP_GETPAGES(), VOP_PUTPAGES().
glebius [Wed, 10 Sep 2014 12:36:41 +0000 (12:36 +0000)]
Remove unused arguments for VOP_GETPAGES(), VOP_PUTPAGES().

9 years agoIntroduce INP6_PCBHASHKEY macro. Replace usage of hardcoded part of
ae [Wed, 10 Sep 2014 12:35:42 +0000 (12:35 +0000)]
Introduce INP6_PCBHASHKEY macro. Replace usage of hardcoded part of
IPv6 address as hash key in all places.

Obtained from: Yandex LLC

9 years agoFix one more spelling mistake.
ray [Wed, 10 Sep 2014 11:48:13 +0000 (11:48 +0000)]
Fix one more spelling mistake.

Pointed by: danfe

9 years agospelling fixes
ray [Wed, 10 Sep 2014 11:27:33 +0000 (11:27 +0000)]
spelling fixes

Submitted by: "Sam Fourman Jr." <sfourman@gmail.com>
MFC after: 1 week

9 years agoo Add sysctls to enable/disable potentially dengerous key combinations, like
ray [Wed, 10 Sep 2014 11:13:13 +0000 (11:13 +0000)]
o Add sysctls to enable/disable potentially dengerous key combinations, like
        reboot/halt/debug.
o Add support for most key combinations supported by syscons(4).

Reviewed by: dumbbell, emaste (prev revision of D747)
MFC after: 5 days
Sponsored by: The FreeBSD Foundation

9 years agoMove if_smc_fdt.c to live in sys/dev/smc. It's not specific to the ARM
andrew [Wed, 10 Sep 2014 10:59:17 +0000 (10:59 +0000)]
Move if_smc_fdt.c to live in sys/dev/smc. It's not specific to the ARM
Versatile hardware.

9 years agoReplace local copy-and-paste implementations of printmbuf() in several
rwatson [Wed, 10 Sep 2014 09:57:32 +0000 (09:57 +0000)]
Replace local copy-and-paste implementations of printmbuf() in several
device drivers with calls to the centralised m_print() implementation.
While the formatting and output details differ a little, the content
is essentially the same, and it is unlikely anyone has used this
debugging output in some time.

This change reduces awareness of mbuf cluster allocation (and,
especially, the M_EXT flag) outside of the mbuf allocator, which will
make it easier to refine the external storage mechanism without
disrupting drivers in the future.

Style bugs are preserved.

Reviewed by: bz, glebius
MFC after: 3 days
Sponsored by: EMC / Isilon Storage Division

9 years agoFix memory leak, reported by Coverity.
mav [Wed, 10 Sep 2014 08:06:31 +0000 (08:06 +0000)]
Fix memory leak, reported by Coverity.

CID: 1229996

9 years agoRemove many false positives with make checkdpadd
ngie [Wed, 10 Sep 2014 07:55:51 +0000 (07:55 +0000)]
Remove many false positives with make checkdpadd

- Reduce DPADD and LDADD in checkdpadd to -l<foo>
- Skip over -Wl,[es]*-group because -Wl,--end-group and
  -Wl,--start-group might be required to properly link objects (see
  usr.bin/clang/lldb as an example)

This caveat has been present for a while with some components of
the build. However, these false positives were made more more apparent
after r269648.

Phabric: D635
Reviewed by: jmmv (an earlier version)
PR: 192730
MFC after: 2 weeks

9 years agoMake ctl_port_mask an array to support more then 32 ports.
mav [Wed, 10 Sep 2014 07:16:17 +0000 (07:16 +0000)]
Make ctl_port_mask an array to support more then 32 ports.

Overflow reported by Coverity.

CID: 1229894
MFC after: 3 days

9 years agoRemove uninitialized and unused variable, reported by Coverity.
mav [Wed, 10 Sep 2014 07:00:36 +0000 (07:00 +0000)]
Remove uninitialized and unused variable, reported by Coverity.

CID: 1230015

9 years agoFix array overrun, reported by Coverity.
mav [Wed, 10 Sep 2014 06:56:45 +0000 (06:56 +0000)]
Fix array overrun, reported by Coverity.

CID: 1229970

9 years agoFix couple off-by-one range check errors, reported by Coverity.
mav [Wed, 10 Sep 2014 06:35:00 +0000 (06:35 +0000)]
Fix couple off-by-one range check errors, reported by Coverity.

CID: 1007837

9 years agoFix memory leak on error, reported by Coverity.
mav [Wed, 10 Sep 2014 06:29:31 +0000 (06:29 +0000)]
Fix memory leak on error, reported by Coverity.

CID: 1007773

9 years agoFix minor buffer overflow reported by Coverity.
mav [Wed, 10 Sep 2014 06:25:18 +0000 (06:25 +0000)]
Fix minor buffer overflow reported by Coverity.

CID: 1006781

9 years agoFix a boundary case error in vm_reserv_alloc_contig(): If a reservation
alc [Wed, 10 Sep 2014 05:52:30 +0000 (05:52 +0000)]
Fix a boundary case error in vm_reserv_alloc_contig(): If a reservation
isn't being allocated for the last of the requested pages, because a
reservation won't fit in the gap between allocated pages, then the
reservation structure shouldn't be initialized.

While I'm here, improve the nearby comments.

Reported by: jeff, pho
MFC after: 1 week
Sponsored by: EMC / Isilon Storage Division

9 years agoFix issue with nmdm and leading zeros in device name.
grehan [Wed, 10 Sep 2014 05:44:15 +0000 (05:44 +0000)]
Fix issue with nmdm and leading zeros in device name.

The nmdm code enforces a number between the 'nmdm' and 'A|B' portions
of the device name. This is then used as a unit number, and sprintf'd
back into the tty name. If leading zeros were used in the name,
the created device name is different than the string used for the
clone-open (e.g. /dev/nmdm0001A will result in /dev/nmdm1A).

Since unit numbers are no longer required with the updated tty
code, there seems to be no reason to force the string to be a
number. The fix is to allow an arbitrary string between
'nmdm' and 'A|B', within the constraints of devfs names. This allows
all existing user of numeric strings to continue to work, and also
allows more meaningful names to be used, such as bhyve VM names.

Tested on amd64, i386 and ppc64.

Reported by: Dave Smith
PR: 192281
Reviewed by: neel, glebius
Phabric: D729
MFC after: 3 days

9 years agoAdd diagnostic printfs and disable test # 4 on i386
ngie [Wed, 10 Sep 2014 03:54:57 +0000 (03:54 +0000)]
Add diagnostic printfs and disable test # 4 on i386

Reviewed by: jmmv, rpaulo
MFC after: 3 days
Phabric: D749
PR: 191676
Sponsored by: EMC / Isilon Storage Division

9 years agoBump __FreeBSD_version after SA-14:18
gjb [Wed, 10 Sep 2014 00:19:33 +0000 (00:19 +0000)]
Bump __FreeBSD_version after SA-14:18

Approved by: re (implicit)
Sponsored by: The FreeBSD Foundation

9 years agoAllow vtnet operation without merged rx buffers.
grehan [Tue, 9 Sep 2014 22:35:02 +0000 (22:35 +0000)]
Allow vtnet operation without merged rx buffers.

NetBSD's virtio-net implementation doesn't negotiate
the merged rx-buffers feature. To support this, check
to see if the feature was negotiated, and then adjust
the operation of the receive path accordingly by using
a larger iovec, and a smaller rx header.
In addition, ignore writes to the (read-only) status byte.

Tested with NetBSD/amd64 5.2.2, 6.1.4 and 7-beta.

Reviewed by: neel, tychon
Phabric: D745
MFC after: 3 days

9 years agoExpand the tests structure in test_small(..) to workaround the
ngie [Tue, 9 Sep 2014 22:14:15 +0000 (22:14 +0000)]
Expand the tests structure in test_small(..) to workaround the
"initializer not constant" warning with gcc

Approved by: jmmv (mentor)
MFC after: 3 days
Phabric: D744
Sponsored by: EMC / Isilon Storage Division

9 years agoAdd an arch.powerpc64 entity.
gjb [Tue, 9 Sep 2014 19:58:55 +0000 (19:58 +0000)]
Add an arch.powerpc64 entity.

Sponsored by: The FreeBSD Foundation

9 years agoChange how the recommended mailing list to track is
gjb [Tue, 9 Sep 2014 19:51:57 +0000 (19:51 +0000)]
Change how the recommended mailing list to track is
added to the footer of the release/doc/ pages by
moving a hard-coded value (that is subject to human
error to change) to release.ent where other values
are regularly changed, and adding parsing logic to
release.xsl.

Approved by: re (implicit)
MFC after: 3 days
Sponsored by: The FreeBSD Foundation

9 years agoWhitespace nit.
np [Tue, 9 Sep 2014 18:36:00 +0000 (18:36 +0000)]
Whitespace nit.

MFC after: 1 week

9 years agoDon't cross mount boundaries when cleaning tmp files.
bdrewery [Tue, 9 Sep 2014 17:03:58 +0000 (17:03 +0000)]
Don't cross mount boundaries when cleaning tmp files.

Mounting something in /tmp such as a build jail with nullfs mounts for
some directories can result in very surprising results the next day.

MFC after: 2 weeks
Relnotes: yes

9 years agoUse keys_add_int() where appropriate. No functional changes.
trasz [Tue, 9 Sep 2014 16:57:02 +0000 (16:57 +0000)]
Use keys_add_int() where appropriate.  No functional changes.

Sponsored by: The FreeBSD Foundation

9 years agoFix ctld(8) to not forget to send TargetPortalGroupTag and TargetAlias
trasz [Tue, 9 Sep 2014 16:45:36 +0000 (16:45 +0000)]
Fix ctld(8) to not forget to send TargetPortalGroupTag and TargetAlias
when the initiator skips security negotiation.  This fixes interoperability
with Xtend SAN initiator.

PR: 193021
MFC after: 1 week
Sponsored by: The FreeBSD Foundation

9 years agoAvoid unlocking unlocked mutex in RCTL jail code. Specific test case
trasz [Tue, 9 Sep 2014 16:05:33 +0000 (16:05 +0000)]
Avoid unlocking unlocked mutex in RCTL jail code.  Specific test case
is attached to PR.

PR: 193457
MFC after: 1 week
Sponsored by: The FreeBSD Foundation

9 years agoReport that DPO and FUA bits are supported after r271311.
mav [Tue, 9 Sep 2014 15:19:38 +0000 (15:19 +0000)]
Report that DPO and FUA bits are supported after r271311.

9 years agoMinor mdoc nit.
joel [Tue, 9 Sep 2014 14:34:54 +0000 (14:34 +0000)]
Minor mdoc nit.

9 years ago- Add missing "
joel [Tue, 9 Sep 2014 14:31:56 +0000 (14:31 +0000)]
- Add missing "
- Sort sections

9 years agoOops, missed piece of r271311.
mav [Tue, 9 Sep 2014 14:20:55 +0000 (14:20 +0000)]
Oops, missed piece of r271311.

9 years agoRevert r269474. Special keyboard combinations should be handled by separate
ray [Tue, 9 Sep 2014 14:18:56 +0000 (14:18 +0000)]
Revert r269474. Special keyboard combinations should be handled by separate
sysctls.

9 years agoAdd support for Mode Page Policy (0x87) VPD page.
mav [Tue, 9 Sep 2014 14:09:51 +0000 (14:09 +0000)]
Add support for Mode Page Policy (0x87) VPD page.

9 years agoRename new to newval in inline asm code, to avoid clashes with C++ new.
ian [Tue, 9 Sep 2014 13:50:21 +0000 (13:50 +0000)]
Rename new to newval in inline asm code, to avoid clashes with C++ new.
Also rename cmp to cmpval just to keep the asm variable names similar to
the C variable names.

9 years agoImprove cache control support, including DPO/FUA flags and the mode page.
mav [Tue, 9 Sep 2014 11:38:29 +0000 (11:38 +0000)]
Improve cache control support, including DPO/FUA flags and the mode page.

At this moment it works only for files and ZVOLs in device mode since BIOs
have no respective respective cache control flags (DPO/FUA).

MFC after: 1 month
Sponsored by: iXsystems, Inc.

9 years agoMake ZVOL writes in device mode support IO_SYNC flag.
mav [Tue, 9 Sep 2014 11:29:55 +0000 (11:29 +0000)]
Make ZVOL writes in device mode support IO_SYNC flag.

MFC after: 1 month

9 years agoAdd the ability to set `prefer_source' flag to an IPv6 address.
ae [Tue, 9 Sep 2014 10:52:50 +0000 (10:52 +0000)]
Add the ability to set `prefer_source' flag to an IPv6 address.
It affects the IPv6 source address selection algorithm (RFC 6724)
and allows override the last rule ("longest matching prefix") for
choosing among equivalent addresses. The address with `prefer_source'
will be preferred source address.

Obtained from: Yandex LLC
MFC after: 1 month
Sponsored by: Yandex LLC

9 years agoDrop frames that have larger than MCLBYTES.
kevlo [Tue, 9 Sep 2014 05:21:31 +0000 (05:21 +0000)]
Drop frames that have larger than MCLBYTES.

9 years agoAdd basic RSS awareness for the UDPv6 send path.
adrian [Tue, 9 Sep 2014 04:20:53 +0000 (04:20 +0000)]
Add basic RSS awareness for the UDPv6 send path.

This doesn't include the same kind of userland overriding that the IPv4
path has; nor does it yet know about 2-tuple versus 4-tuple hashing.
That'll come later.

Differential Revision: https://reviews.freebsd.org/D527
Reviewed by: grehan

9 years agoCalculate the RSS hash for outbound UDPv4 frames.
adrian [Tue, 9 Sep 2014 04:19:36 +0000 (04:19 +0000)]
Calculate the RSS hash for outbound UDPv4 frames.

Differential Revision: https://reviews.freebsd.org/D527
Reviewed by: grehan

9 years agoUpdate the IPv4 input path to handle reassembled frames and incoming frames
adrian [Tue, 9 Sep 2014 04:18:20 +0000 (04:18 +0000)]
Update the IPv4 input path to handle reassembled frames and incoming frames
with no RSS hash.

When doing RSS:

* Create a new IPv4 netisr which expects the frames to have been verified;
  it just directly dispatches to the IPv4 input path.
* Once IPv4 reassembly is done, re-calculate the RSS hash with the new
  IP and L3 header; then reinject it as appropriate.
* Update the IPv4 netisr to be a CPU affinity netisr with the RSS hash
  function (rss_soft_m2cpuid) - this will do a software hash if the
  hardware doesn't provide one.

NICs that don't implement hardware RSS hashing will now benefit from RSS
distribution - it'll inject into the correct destination netisr.

Note: the netisr distribution doesn't work out of the box - netisr doesn't
query RSS for how many CPUs and the affinity setup.  Yes, netisr likely
shouldn't really be doing CPU stuff anymore and should be "some kind of
'thing' that is a workqueue that may or may not have any CPU affinity";
that's for a later commit.

Differential Revision: https://reviews.freebsd.org/D527
Reviewed by: grehan

9 years agoAdd a callback to be notified about negotiated features.
grehan [Tue, 9 Sep 2014 04:11:54 +0000 (04:11 +0000)]
Add a callback to be notified about negotiated features.

Submitted by: luigi
Obtained from: Vincenzo Maffione, Universita` di Pisa
MFC after: 3 days

9 years agoImplement IPv4 RSS software hash functions to use during packet ingress
adrian [Tue, 9 Sep 2014 03:10:21 +0000 (03:10 +0000)]
Implement IPv4 RSS software hash functions to use during packet ingress
and egress.

* rss_mbuf_software_hash_v4 - look at the IPv4 mbuf to fetch the IPv4 details
  + direction to calculate a hash.
* rss_proto_software_hash_v4 - hash the given source/destination IPv4 address,
  port and direction.
* rss_soft_m2cpuid - map the given mbuf to an RSS CPU ("bucket" for now)

These functions are intended to be used by the stack to support
the following:

* Not all NICs do RSS hashing, so we should support some way of doing
  a hash in software;
* The NIC / driver may not hash frames the way we want (eg UDP 4-tuple
  hashing when the stack is only doing 2-tuple hashing for UDP); so we
  may need to re-hash frames;
* .. same with IPv4 fragments - they will need to be re-hashed after
  reassembly;
* .. and same with things like IP tunneling and such;
* The transmit path for things like UDP, RAW and ICMP don't currently
  have any RSS information attached to them - so they'll need an
  RSS calculation performed before transmit.

TODO:

* Counters! Everywhere!
* Add a debug mode that software hashes received frames and compares them
  to the hardware hash provided by the hardware to ensure they match.

The IPv6 part of this is missing - I'm going to do some re-juggling of
where various parts of the RSS framework live before I add the IPv6
code (read: the IPv6 code is going to go into netinet6/in6_rss.[ch],
rather than living here.)

Note: This API is still fluid.  Please keep that in mind.

Differential Revision: https://reviews.freebsd.org/D527
Reviewed by: grehan

9 years agoBe ANSI-C compliant when defining CX_LIMITED_RANGE #pragma
ngie [Tue, 9 Sep 2014 02:58:58 +0000 (02:58 +0000)]
Be ANSI-C compliant when defining CX_LIMITED_RANGE #pragma

This mutes warnings with clang

Approved by: rpaulo (mentor)
Reviewed by: das, kargl (both as part of a larger patch)
Phabric: D742
Sponsored by: EMC / Isilon Storage Division

9 years agoAdd support for receiving and setting flowtype, flowid and RSS bucket
adrian [Tue, 9 Sep 2014 01:45:39 +0000 (01:45 +0000)]
Add support for receiving and setting flowtype, flowid and RSS bucket
information as part of recvmsg().

This is primarily used for debugging/verification of the various
processing paths in the IP, PCB and driver layers.

Unfortunately the current implementation of the control message path
results in a ~10% or so drop in UDP frame throughput when it's used.

Differential Revision: https://reviews.freebsd.org/D527
Reviewed by: grehan

9 years agoAdd IP_NODEFAULTFLOWID awareness to ip6_output().
adrian [Tue, 9 Sep 2014 00:21:21 +0000 (00:21 +0000)]
Add IP_NODEFAULTFLOWID awareness to ip6_output().

Differential Revision: https://reviews.freebsd.org/D527

9 years agoAdd a flag to ip_output() - IP_NODEFAULTFLOWID - which prevents it from
adrian [Tue, 9 Sep 2014 00:19:02 +0000 (00:19 +0000)]
Add a flag to ip_output() - IP_NODEFAULTFLOWID - which prevents it from
overriding an existing flowid/flowtype field in the outbound mbuf with
the inp_flowid/inp_flowtype details.

The upcoming RSS UDP support calculates a valid RSS value for outbound
mbufs and since it may change per send, it doesn't cache it in the inpcb.
So overriding it here would be wrong.

Differential Revision: https://reviews.freebsd.org/D527
Reviewed by: grehan

9 years agoMerge from NetBSD:
brooks [Mon, 8 Sep 2014 19:26:21 +0000 (19:26 +0000)]
Merge from NetBSD:

PR/49185: Conrad Meyer: strvisx: Handle zero-length input strings
gracefully.  (don't abuse 0 to mean compute string length internally)

PR: 193447
Submitted by: Conrad Meyer <conrad.meyer@isilon.com>
MFC after: 1 month

9 years agoUse the right constants in comparisons. This is currently a nop, as
brueffer [Mon, 8 Sep 2014 19:24:25 +0000 (19:24 +0000)]
Use the right constants in comparisons.  This is currently a nop, as
MIN_RXD == MIN_TXD and MAX_RXD == MAX_TXD.

Reviewed by: Eric Joyner @ Intel
MFC after: 1 week

9 years agoAdd a 'ubenv import' command to import environment variables from the
ian [Mon, 8 Sep 2014 19:19:10 +0000 (19:19 +0000)]
Add a 'ubenv import' command to import environment variables from the
u-boot env into the loader(8) env (which also gets them into the kernel
env).  You can import selected variables or the whole environment.  Each
u-boot var=value becomes uboot.var=value in the loader env.  You can also
use 'ubenv show' to display uboot vars without importing them.

9 years agoInclude the gssapi_krb5 library in KRB5_LDFLAGS.
gjb [Mon, 8 Sep 2014 19:00:13 +0000 (19:00 +0000)]
Include the gssapi_krb5 library in KRB5_LDFLAGS.

PR: 156245
MFC after: 3 days
Sponsored by: The FreeBSD Foundation

9 years agoAdd clang patch for r271282
emaste [Mon, 8 Sep 2014 18:48:54 +0000 (18:48 +0000)]
Add clang patch for r271282

Note that r271282 contains only the src change from Clang rev 200797.
This patch file includes two follow-on changes to the test case, which
do not apply to the copy in the FreeBSD tree.

Upstream Clang revisions:

200797:

    Debug info: fix a crasher when when emitting debug info for
    not-yet-completed templated types. getTypeSize() needs a complete type.

    rdar://problem/15931354

200798:

    Simplify testcase from r200797 some more.

200805:

    Further simplify r200797 and add an explanatory comment.

PR: 193347
MFC after: 3 days
Sponsored by: DARPA, AFRL

9 years agoMerge Clang debug info crash fix rev 200797:
emaste [Mon, 8 Sep 2014 18:43:33 +0000 (18:43 +0000)]
Merge Clang debug info crash fix rev 200797:

    Debug info: fix a crasher when when emitting debug info for
    not-yet-completed templated types. getTypeSize() needs a complete type.

    rdar://problem/15931354

PR: 193347
MFC after: 3 days
Sponsored by: DARPA, AFRL

9 years agoAvoid rs(1) hitting LINE_MAX with custom trees that have large dependencies.
bdrewery [Mon, 8 Sep 2014 17:01:30 +0000 (17:01 +0000)]
Avoid rs(1) hitting LINE_MAX with custom trees that have large dependencies.

9 years agoRevert r271257 after several issues were pointed out. An updated patch
des [Mon, 8 Sep 2014 12:26:52 +0000 (12:26 +0000)]
Revert r271257 after several issues were pointed out.  An updated patch
will be committed at a later date.

9 years agoBunch of microoptimizations to reduce dereferences and cache collisions.
mav [Mon, 8 Sep 2014 12:11:49 +0000 (12:11 +0000)]
Bunch of microoptimizations to reduce dereferences and cache collisions.

9 years agoMake it possible to use empty user name ("-U ''") for mount_smbfs(8).
trasz [Mon, 8 Sep 2014 11:01:57 +0000 (11:01 +0000)]
Make it possible to use empty user name ("-U ''") for mount_smbfs(8).
It's just like "-U guest", except that it actually works, at least
with Samba 4, which seems to return authentication failure for "-U guest".

MFC after: 1 month
Sponsored by: The FreeBSD Foundation

9 years agoMake mount_smbfs(8) preserve the "automounted" mount flag.
trasz [Mon, 8 Sep 2014 10:57:43 +0000 (10:57 +0000)]
Make mount_smbfs(8) preserve the "automounted" mount flag.

The issue here is that we have to pass this flag as a string,
in iov, because it doesn't fit in mntflags, which is an int.

MFC after: 2 weeks
Sponsored by: The FreeBSD Foundation

9 years agoUse the correct idiom for default values, and ensure that the script
des [Mon, 8 Sep 2014 09:33:43 +0000 (09:33 +0000)]
Use the correct idiom for default values, and ensure that the script
works correctly if the user overrides them.

PR: 193255
Submitted by: hrs@
MFC after: 3 days

9 years agoFail rather than segfault if neither PAM_TTY nor PAM_RHOST is set.
des [Mon, 8 Sep 2014 09:19:01 +0000 (09:19 +0000)]
Fail rather than segfault if neither PAM_TTY nor PAM_RHOST is set.

PR: 83099
MFC after: 3 days

9 years agoFix support for IPv6 nameservers.
des [Mon, 8 Sep 2014 09:16:07 +0000 (09:16 +0000)]
Fix support for IPv6 nameservers.

PR: 188931
Submitted by: Takefu <takefu@airport.fm>
MFC after: 3 days

9 years ago- Make hhook_run_socket() vnet-aware instead of adding CURVNET_SET() around
hrs [Mon, 8 Sep 2014 09:04:22 +0000 (09:04 +0000)]
- Make hhook_run_socket() vnet-aware instead of adding CURVNET_SET() around
  the function calls.
- Fix a memory leak and stats in the case that hhook_run_socket() fails
  in soalloc().

PR: 193265

9 years agopause_sbt(): Take the cold path (ie. use DELAY()) if KDB is active
dumbbell [Mon, 8 Sep 2014 08:44:50 +0000 (08:44 +0000)]
pause_sbt(): Take the cold path (ie. use DELAY()) if KDB is active

This fixes a panic in the i915 driver when one uses debug.kdb.enter=1
under vt(4).

PR: 193269
Reported by: emaste@
Submitted by: avg@
MFC after: 3 days

9 years agoUse __DECONST to avoid compiler warnings (and thus build failures)
bz [Mon, 8 Sep 2014 08:12:09 +0000 (08:12 +0000)]
Use __DECONST to avoid compiler warnings (and thus build failures)
with gcc on sparc64, mips, and powerpc after r271173.

9 years agovt(4): Change the terminal and buffer sizes, even without a font
dumbbell [Mon, 8 Sep 2014 07:37:03 +0000 (07:37 +0000)]
vt(4): Change the terminal and buffer sizes, even without a font

This fixes a bug where scroll lock would not work for tty #0 when using
vt_vga's textmode. The reason was that this window is created with a
static 256x100 buffer, larger than the real size of 80x25.

Now, in vt_change_font() and vt_compute_drawable_area(), we still
perform operations even of the window has no font loaded (this is the
case in textmode here vw->vw_font == NULL). One of these operation
resizes the buffer accordingly.

In vt_compute_drawable_area(), we take the terminal size as is (ie.
80x25) for the drawable area.

The font argument to vt_set_border() is removed (it was never used) and
the code now uses the computed drawable area instead of re-doing its own
calculation.

Reported by: Harald Schmalzbauer <h.schmalzbauer_omnilan.de>
Tested by: Harald Schmalzbauer <h.schmalzbauer_omnilan.de>
MFC after: 3 days

9 years agoImplement htprotmode handling.
adrian [Mon, 8 Sep 2014 07:16:00 +0000 (07:16 +0000)]
Implement htprotmode handling.

This is separate to 11g protection - the default is to RTS protect
11n frames, including A-MPDU frames.

Tested:

* Intel 5100, STA mode

9 years agoTemporarily remove the warning added r270781 - it prints the warning
peter [Mon, 8 Sep 2014 05:14:58 +0000 (05:14 +0000)]
Temporarily remove the warning added r270781 - it prints the warning
regardless of whether the usage is correct or not and this generates a
LOT of noise, even when you have specified a mask.

9 years ago(more) correctly account TX completion status for A-MPDU session frames.
adrian [Mon, 8 Sep 2014 03:16:28 +0000 (03:16 +0000)]
(more) correctly account TX completion status for A-MPDU session frames.

The rules turn out to be:

* for non-aggregation session TX queues - it's either sent or not sent.
* for aggregation session TX queues - if nframes=1, then the status reflects
  the completed transmission.
* however, for nframes > 1, then this is just a status reflecting what
  the initial transmission did.  The compressed BA (immediate or delayed)
  may not have yet been received, so the actual frame status is in the
  compressed BA updates.

Whilst here, I fiddled with debugging and formatting a bit.

There's also RTS attempts (what the atheros chips call "short retries")
which weren't being logged and they aren't yet being used in the rate
control statistics updates.  For now, at least log them.

TODO:

* This still isn't 100% correct! So I have to tinker with this some more.
  (The failures aren't always failures..)
* Extend the rate control API in net80211 so it can take both short and
  long retry counts.

Tested:

* Intel 5100, STA mode

9 years agoBring over some more status codes from the Linux iwlwifi driver.
adrian [Mon, 8 Sep 2014 03:12:42 +0000 (03:12 +0000)]
Bring over some more status codes from the Linux iwlwifi driver.

The (eventual) intention is to create MIB counters for transmitted
frame completion to count how many packets with each status are
transmitted.

Note the difference between A-MPDU and non A-MPDU status.

Obtained from: Linux iwlwifi/dvm driver

9 years agoSilence a bmake(1) warning in the gif(4) module build
gjb [Mon, 8 Sep 2014 02:37:45 +0000 (02:37 +0000)]
Silence a bmake(1) warning in the gif(4) module build
when built with WITHOUT_INET6.

LGTM:  sbruno
Sponsored by: The FreeBSD Foundation

9 years agoOops. vm_map_simplify_entry() is used by mac_proc_vm_revoke_recurse(), so
alc [Mon, 8 Sep 2014 02:25:01 +0000 (02:25 +0000)]
Oops.  vm_map_simplify_entry() is used by mac_proc_vm_revoke_recurse(), so
it can't be static.

9 years agoMake two functions static and eliminate an unused #define.
alc [Mon, 8 Sep 2014 00:19:03 +0000 (00:19 +0000)]
Make two functions static and eliminate an unused #define.

9 years agoInclude src.opts.mk after SHLIBDIR has been defined so libnv is installed to
ngie [Sun, 7 Sep 2014 22:56:57 +0000 (22:56 +0000)]
Include src.opts.mk after SHLIBDIR has been defined so libnv is installed to
/lib , not /usr/lib

MFC after: 3 days
Approved by: rpaulo (mentor)
Submitted by: antoine
Pointyhat to: me
Phabric: D739

9 years agoWhen entering the kernel with the MMU off assume we are running from a
andrew [Sun, 7 Sep 2014 21:46:54 +0000 (21:46 +0000)]
When entering the kernel with the MMU off assume we are running from a
va == pa map.

I'm not sure the code would work if we are not running from the identity
map as the ARM core may attempt to read the next instruction from an
invalid memory location.