rrs [Sun, 13 Feb 2011 14:48:11 +0000 (14:48 +0000)]
Fix a bug reported by Jonathan Leighton in his web-sctp testing
at the Univ-of-Del. Basically when a 1-to-1 socket did a
socket/bind/send(data)/close. If the timing was right
we would dereference a socket that is NULL.
alc [Sun, 13 Feb 2011 14:46:39 +0000 (14:46 +0000)]
Eliminate tn_reg.tn_aobj_pages. Instead, correctly maintain the vm
object's size field. Previously, that field was always zero, even
when the object tn_reg.tn_aobj contained numerous pages.
deischen [Sun, 13 Feb 2011 04:44:06 +0000 (04:44 +0000)]
Oops, revert an accidental local change that got added in
my last commit (r218627). No damage was done in the last
commit, just some duplicated code was added (which is now
removed).
simon [Sat, 12 Feb 2011 21:30:46 +0000 (21:30 +0000)]
Fix Incorrectly formatted ClientHello SSL/TLS handshake messages could
cause OpenSSL to parse past the end of the message.
Note: Applications are only affected if they act as a server and call
SSL_CTX_set_tlsext_status_cb on the server's SSL_CTX. This includes
Apache httpd >= 2.3.3, if configured with "SSLUseStapling On".
brucec [Sat, 12 Feb 2011 20:42:53 +0000 (20:42 +0000)]
If the pf.conf(5) example file is copied when setting up a firewall it's
easy to forget about icmp. Update the file to show allowing icmp through
the firewall.
kib [Sat, 12 Feb 2011 13:17:14 +0000 (13:17 +0000)]
In checker, read journal by sectors.
Due to UFS insistence to pretend that device sector size is 512 bytes,
sector size is obtained from ioctl(DIOCGSECTORSIZE) for real devices,
and from the label otherwise. The file images without label have to
be made with 512 sector size.
In collaboration with: pho
Reviewed by: jeff
Tested by: bz, pho
kib [Sat, 12 Feb 2011 13:12:45 +0000 (13:12 +0000)]
When creating a directory entry for the journal, always read at least
the fragment, and write the full block. Reading less might not work
due to device sector size bigger then size of direntries in the
last directory fragment.
Reported by: bz
In collaboration with: pho
Reviewed by: jeff
Tested by: bz, pho
kib [Sat, 12 Feb 2011 12:52:12 +0000 (12:52 +0000)]
Use the native sector size of the device backing the UFS volume for SU+J
journal blocks, instead of hard coding 512 byte sector size. Journal need
to atomically write the block, that can only be guaranteed at the device
sector size, not larger. Attempt to write less then sector size results in
driver errors.
Note that this is the first structure in UFS that depends on the
sector size. Other elements are written in the units of fragments.
In collaboration with: pho
Reviewed by: jeff
Tested by: bz, pho
kib [Sat, 12 Feb 2011 12:46:00 +0000 (12:46 +0000)]
Replace ERROR() macro with inline function. In-tree gcc cannot tolerate
the construct like printf("%\s", NULL) resulting from macroexpand of
ERROR(u, NULL), making it impossible to use LIBUFS_DEBUGGING.
With inline function, compiler cannot detect the NULL argument to
known function and does not try to convert it into puts().
mav [Sat, 12 Feb 2011 07:06:40 +0000 (07:06 +0000)]
Disable NCQ for multiport Marvell 88SX61XX SATA controllers. Simultaneous
active I/O to several disks (copying large file on ZFS) causes timeout after
just a few seconds of run. Single port 88SX6111 seems like not affected.
Skip reading transferred bytes count for these controllers. It works for
88SX6111, but 88SX6145 always returns zero there. Haven't tested others,
but better to be safe.
jmallett [Sat, 12 Feb 2011 02:41:33 +0000 (02:41 +0000)]
The Lanner MR-730 uses the first two MACs at its MAC base for the 10/100
management ports, and gigabit ports start at an offset of 2 from the MAC
base.
adrian [Sat, 12 Feb 2011 02:14:19 +0000 (02:14 +0000)]
The current code used the fields in ath_set11nratescenario() . Use them
correctly:
* pass in whether to allow the hardware to override the duration field
in the main data frame (durupdate_en) - PS_POLL frames in particular
don't have the duration bit overriden;
* there's no rts/cts duration here; that's done elsehwere
jmallett [Sat, 12 Feb 2011 02:08:24 +0000 (02:08 +0000)]
Allow the platform code to return a bitmask of running cores rather than just
a number of cores, this allows for a sparse set of CPUs. Implement support
for sparse core masks on Octeon.
XXX jeff@ suggests that all_cpus should include cores that are offline or
running other applications/OSes, so the platform API should be further
extended to allow us to set all_cpus to include all cores that are
physically-present as opposed to only those that are running FreeBSD.
kib [Fri, 11 Feb 2011 10:46:15 +0000 (10:46 +0000)]
For UIO_NOCOPY case of reading request on zfs vnode, which has vm object
attached, activate the page after the successful read, and free the page
if read was unsuccessfull.
Freshly allocated page is not on any queue yet, and not activating (or
deactivating) the page leaves it on no queue, excluding the page from
pagedaemon scans and making the memory disappeared until the vnode
reclaimed.
imp [Fri, 11 Feb 2011 06:35:53 +0000 (06:35 +0000)]
Generate MACHINE= and MACHINE_ARCH= lines based on the machine
directive. Once this is MFC'd, we can move these out of the template
files where they are (incosnsitently) defined.
imp [Fri, 11 Feb 2011 04:03:39 +0000 (04:03 +0000)]
Hmmm, specifying TARGET and TARGET_ARCH in the environment doesn't
seem to work when building xdev anymore (most likely my changes lately
moving the TARGET guessing stuff to Makefile from Makefile.inc1, but I
really don't grok why). Fix make xdev by putting them on the command
line. This will work either way while I try to figure it out.
jfv [Fri, 11 Feb 2011 01:00:26 +0000 (01:00 +0000)]
Add support for the new I350 family of 1G interfaces.
- this also includes virtualization support on these devices
Correct some vlan issues we were seeing in test, jumbo frames on vlans
did not work correctly, this was all due to confused logic around HW
filters, the new code should now work for all uses.
Important fix: when mbuf resources are depeleted, it was possible to
completely empty the RX ring, and then the RX engine would stall
forever. This is fixed by a flag being set whenever the refresh code
fails due to an mbuf shortage, also the local timer now makes sure
that all queues get an interrupt when it runs, the interrupt code
will then always call rxeof, and in that routine the first thing done
is now to check the refresh flag and call refresh_mbufs. This has been
verified to fix this type 'hang'. Similar code will follow in the other
drivers.
Finally, sync up shared code for the I350 support.
Thanks to everyone that has been reporting issues, and helping in the
debug/test process!!
imp [Thu, 10 Feb 2011 23:36:39 +0000 (23:36 +0000)]
Add 'generic' flash images. This is for projects producing generic
images that are of a certain size. The geometery is bogus, but that
doesn't matter since the new packet mode onviates the need to get the
geometry right.
imp [Thu, 10 Feb 2011 19:58:21 +0000 (19:58 +0000)]
You are now *REQUIRED* to pass both TARGET and TARGET_ARCH to any
invocations of Makefile.inc1 (since that's supposed to be an internal
interface for world and related targets). Document this with a .error
message. For a transition period, support passing in just TARGET, but
give a .warning for that case: I plan on removing it in 9.0...
keramida [Thu, 10 Feb 2011 19:13:54 +0000 (19:13 +0000)]
Add LIBEXECDIR to the bsd.own.mk vars, pointing to /usr/libexec by default
Some of the patches we are preparing for porting ATF from NetBSD
refer to '/usr/libexec' several times. Instead of repeating the
path all over the place, add ${LIBEXECDIR} to match ${LIBDATADIR}
and reduce the redundancy of the relevant makefiles.
jhb [Thu, 10 Feb 2011 18:54:52 +0000 (18:54 +0000)]
- Add a new UNIVERSE_TARGET variable for 'make universe'. If it is set,
then that target is invoked for each architecture rather than the
default action of building world and kernels for each architecture.
- Add a 'make toolchains' wrapper which uses UNIVERSE_TARGET to build
toolchains for all architectures.
- Document JFLAG, MAKE_JUST_KERNELS, and MAKE_JUST_WORLDS variables for
'make universe'.
jpaetzel [Thu, 10 Feb 2011 15:41:32 +0000 (15:41 +0000)]
Netgear renamed the WG311 to the WG311v1 after they released a second
version of it. There is also a WG311v3 which uses a chipset covered by
malo(4). Along the way add the WG311T to the list which is also an
atheros chipset.
PR: docs/154589
Approved by: kib (mentor)
MFC after: 3 days
das [Thu, 10 Feb 2011 07:38:38 +0000 (07:38 +0000)]
Fix a bug where the wrong argument was passed to SET_FLOAT_WORD().
This bug results in a type mismatch that happens to be harmless
because of the way SET_FLOAT_WORD() works.
das [Thu, 10 Feb 2011 07:38:13 +0000 (07:38 +0000)]
Fix a bug where the wrong argument was passed to INSERT_WORDS().
This bug results in a type mismatch that happens to be harmless
because of the way INSERT_WORDS() works.
das [Thu, 10 Feb 2011 07:37:50 +0000 (07:37 +0000)]
For small arguments, these functions use simple approximations,
e.g. cos(small) = 1, sin(small) = small. This commit tightens
the thresholds at which the simple approximations are used.
das [Thu, 10 Feb 2011 07:37:29 +0000 (07:37 +0000)]
Fix a bogus threshold that was copied from the double precision version.
This commit should have no effect on correctness; it merely changes the
threshold at which a simpler approximation can be used.
netchild [Wed, 9 Feb 2011 20:23:22 +0000 (20:23 +0000)]
Linux' shm_open() fails because it wants to find some funky shmfs
to construct the full pathname. It starts to search at the default
mountpoint which is /dev/shm. If this fails it runs through fstab
and searches for shmfs and tmpfs. Whatever it finds will be
statfs()'ed to be checked for Linux' fs magic for shmfs (0x01021994).
Ideally our tmpfs should deliver this fs magic to Linux processes, but
as our tmpfs is considered to be an experimental feature we can not
assume that there is always a tmpfs available.
To make shared memory work in the Linuxulator, force the fs type of
/dev/shm (which can be a symlink) to match what Linux expects. The user
is responsible (info has to be added to the linux base ports and the docs)
to setup a suitable link for /dev/shm.
Noticed by: Andre Albsmeier <Andre.Albsmeier@siemens.com>
Submitted by: Andre Albsmeier <Andre.Albsmeier@siemens.com>
MFC after: 1 month
marcel [Wed, 9 Feb 2011 19:08:21 +0000 (19:08 +0000)]
Provide convenience function for obtaining MODINFO_ADDR and MODINFO_SIZE
attributes for preloaded modules/images. In particular, MODINFO_ADDR has
the added complexity of not always being relocated properly. Rather than
kluging this in the various components that are affected, we handle it
in a centralized place (preload_fetch_addr()). To that end, expose a new
variable, preload_addr_relocate, that MD initialization code can set and
that turns the address attribute into a valid kernel VA.
Architectures that need the relocation: arm & powerpc (at least).
Components that can utilize this: acpi(4), md(4), fb(4), pci(4), ZFS, geli.
Drivers which rely on net80211 to create the beacon need to call
ieee80211_beacon_update() on iv_update_beacon() calls. This is required
that certain bits, e.g. TIM, get updated. A call to ieee80211_beacon_alloc()
is not enough because it does not care about flags which can only change
during runtime. By design a beacon is supposed to be allocated only once
while moving into RUN state.
To handle all possible calls to iv_update_beacon() the run_updateslot()
function has been revived and run_updateprot() has been added.
run_updateslot() handles slot time changes and run_updateprot() changes
to protection, both can change while nodes associate/leave.
Submitted by: Alexander Zagrebin <alex at zagrebin.ru>,
PseudoCylon <moonlightakkiy atyahoo.ca>
MFC after: 3 weeks
adrian [Wed, 9 Feb 2011 15:43:38 +0000 (15:43 +0000)]
Add in the (very!) optional glue to flip the 11n bits for if_ath.
There's still a lot of random issues to sort out with the radio side of
things and AMPDU RX handling (and completely missing AMPDU TX handling!)
but if people wish to give this a go and assist in debugging the
issues, they can define ATH_DO_11N to enable it.
I'm just re-iterating - this is here to allow people to assist in
further 11n development; it is not any indication that the 11n support
is complete and functional.
Important notes:
* This doesn't support 1-stream cards yet - (eg AR9285) - the various bits
that negotiate TX/RX MCS don't know not to try >1 stream TX or negotiate
1-stream RX; so don't enable 11n unless you've first taught the rate
control module and the net80211 stack to negotiate 1-stream stuff;
* The only rate control module minimally 11n aware is ath_rate_sample;
* ath_rate_sample doesn't know about HT/40; so airtime will be incorrectly
calculated;
* The AR9160 and AR9280 radio code is unreliable at the higher MCS rates for
some reason; this will definitely impact 11n performance;
* AMPDU-TX isn't yet implemented;
* AMPDU-RX may be a bit buggy still and will definitely suffer from the
radio unreliability mentioned above (ie, don't expect 150/300mbit
RX just yet.)
netchild [Wed, 9 Feb 2011 15:33:13 +0000 (15:33 +0000)]
Add some FEATURE macros for some UFS features.
SU+J is not included as a FEATURE macro:
- it was not in the tree during the GSoC
- I do not see an option to en-/disable it in NOTES
Two minor changes where made during the review compared to what was developed
during GSoC 2010.
No FreeBSD version bump, the userland application to query the features will
be committed last and can serve as an indication of the availablility if
needed.
Sponsored by: Google Summer of Code 2010
Submitted by: kibab
Reviewed by: kib
X-MFC after: to be determined in last commit with code from this project
adrian [Wed, 9 Feb 2011 15:23:16 +0000 (15:23 +0000)]
Fix the keycache behaviour for multicast keycache search.
The correct bit to set is 0x1 in the high MAC address byte, not 0x80.
The hardware isn't programmed with that bit (which is the multicast
adress bit.)
The linux ath9k keycache code uses that bit in the MAC as a "this is
a multicast key!" and doesn't set the AR_KEYTABLE_VALID bit.
This tells the hardware the MAC isn't to be used for unicast destination
matching but it can be used for multicast bssid traffic.
This fixes some encryption problems in station mode.
kib [Wed, 9 Feb 2011 09:20:27 +0000 (09:20 +0000)]
Use sigsetjmp/siglongjmp with disabled signal mask access for
lock upgrade in rtld. There is no need to care about the mask,
which causes a lot of unneeded sigprocmask(2) calls during each
symbol lookup.
hselasky [Wed, 9 Feb 2011 08:01:45 +0000 (08:01 +0000)]
Minor cleanup:
- use device_printf() instead of printf() to give more accurate warnings.
- use memcpy() instead of bcopy().
- add missing #if's for non-FreeBSD compilation.