adrian [Wed, 27 May 2009 02:49:08 +0000 (02:49 +0000)]
Ensure that there are enough TX mbuf ring slots available before beginning
to dequeue a packet.
The tx path was trying to ensure that enough Xenbus TX ring slots existed but
it didn't check to see whether the mbuf TX ring slots were also available.
They get freed in xn_txeof() which occurs after transmission, rather than earlier
on in the process. (The same happens under Linux too.)
Due to whatever reason (CPU use, scheduling, memory constraints, whatever) the
mbuf TX ring may not have enough slots free and would allocate slot 0. This is
used as the freelist head pointer to represent "free" mbuf TX ring slots; setting
this to an actual mbuf value rather than an id crashes the code.
This commit introduces some basic code to track the TX mbuf ring use and then
(hopefully!) ensures that enough slots are free in said TX mbuf ring before it
enters the actual work loop.
A few notes:
* Similar logic needs to be introduced to check there are enough actual slots
available in the xenbuf TX ring. There's some logic which is invoked earlier
but it doesn't hard-check against the number of available ring slots.
Its trivial to do; I'll do it in a subsequent commit.
* As I've now commented in the source, it is likely possible to deadlock the
driver under certain conditions where the rings aren't receiving any changes
(which I should enumerate) and thus Xen doesn't send any further software
interrupts. I need to make sure that the timer(s) are running right and
the queues are periodically kicked.
adrian [Wed, 27 May 2009 01:45:23 +0000 (01:45 +0000)]
Add in some INVARIANT checks in the TX mbuf descriptor "freelist" management code.
Slot 0 must always remain "free" and be a pointer to the first free entry in the
mbuf descriptor list. It is thus an error to have code allocate or push slot 0
back into the list.
jilles [Tue, 26 May 2009 22:33:10 +0000 (22:33 +0000)]
Fix various cases with 3 or 4 parameters in test(1) to be POSIX compliant.
More precisely, this gives precedence to an interpretation not using the
'(', ')', '-a' and '-o' in their special meaning, if possible. For example,
it is now safe to write [ "$a" = "$b" ] and assume it compares the two
strings.
The man page already says that test(1) works this way, so does not need to
be changed.
Interpretation of input with more parameters tries a bit harder to find a
valid parse in some cases.
rmacklem [Tue, 26 May 2009 22:21:53 +0000 (22:21 +0000)]
Fix the experimental nfs subsystem so that it builds with the
current NFSv4 ACLs, as defined in sys/acl.h. It still needs a
way to test a mount point for NFSv4 ACL support before it will
work. Until then, the NFSHASNFS4ACL() macro just always returns 0.
sson [Tue, 26 May 2009 21:39:09 +0000 (21:39 +0000)]
Add the ksyms(4) pseudo driver. The ksyms driver allows a process to
get a quick snapshot of the kernel's symbol table including the symbols
from any loaded modules (the symbols are all merged into one symbol
table). Unlike like other implementations, this ksyms driver maps
memory in the process memory space to store the snapshot at the time
/dev/ksyms is opened. It also checks to see if the process has already
a snapshot open and won't allow it to open /dev/ksyms it again until it
closes first. This prevents kernel and process memory from being
exhausted. Note that /dev/ksyms is used by the lockstat(1) command.
ed [Tue, 26 May 2009 21:06:51 +0000 (21:06 +0000)]
Merge local changes to ee(1) into contrib space.
The source file, manual page and English translation are now directly
obtained from the contrib/ directory. This makes it a lot easier to
merge a newer version of ee(1) into the tree.
sson [Tue, 26 May 2009 20:28:22 +0000 (20:28 +0000)]
Add the OpenSolaris dtrace lockstat provider. The lockstat provider
adds probes for mutexes, reader/writer and shared/exclusive locks to
gather contention statistics and other locking information for
dtrace scripts, the lockstat(1M) command and other potential
consumers.
jhb [Tue, 26 May 2009 20:00:30 +0000 (20:00 +0000)]
Correct the sense of a test so that this filter always waits for the full
request to arrive. Previously it would end up returning as soon as the
request length stored in the first two bytes had arrived.
rmacklem [Tue, 26 May 2009 15:19:04 +0000 (15:19 +0000)]
Add two new utilities and two new daemons to /usr/src/usr.sbin that
are specifically used by the experimental nfsv4 subsystem.
nfscbd - The NFSv4 client callback daemon.
nfsuserd - The NFSv4 daemon that maps between user and group name
and their corresponding uid/gid numbers.
nfsdumpstate - A utility that dumps out the NFSv4 Open/Lock state.
nfsrevoke - Administratively revokes an NFSv4 client, releasing all
NFSv4 Open/Lock state it holds on the server.
trasz [Tue, 26 May 2009 08:21:59 +0000 (08:21 +0000)]
MFp4 changes neccessary for NFSv4 ACLs support in ZFS. This is mostly
about removing a few #ifdefs and providing compatibility wrappers and
VOP implementations to get and set an ACL; ZFS does ACL enforcement all
by itself.
Note that the VOPs are ifdefed out for now, so this change should be
a no-op.
rmacklem [Tue, 26 May 2009 01:47:37 +0000 (01:47 +0000)]
Add two sysctl variables to the experimental nfs server, so
that the range of versions of NFS handled by the server can
be limited. The nfsd daemon must be restarted after these
sysctl variables are changed, in order for the change to take
effect.
rmacklem [Tue, 26 May 2009 01:16:09 +0000 (01:16 +0000)]
Fix the handling of NFSv4 Illegal Operation number to conform
to RFC3530 (the operation number in the reply must be set to
the value for OP_ILLEGAL). Also cleaned up some indentation.
rmacklem [Tue, 26 May 2009 01:09:33 +0000 (01:09 +0000)]
Fix the experimental nfs server's interface to the new krpc so
that it handles the case of a non-exported NFSv4 root correctly.
Also, delete handling for the case where nd_repstat is already
set in nfs_proc(), since that no longer happens.
dougb [Tue, 26 May 2009 00:07:02 +0000 (00:07 +0000)]
Per the man page:
The makekey utility has been deprecated and will be removed in a future
release of FreeBSD.
Actually removing it was approved back on 10/29/2007 by re (kensmith) but
I dropped the ball on actually removing it. It's doubtful that it's become
more relevant/useful in the intervening time.
ed [Mon, 25 May 2009 20:07:41 +0000 (20:07 +0000)]
Fix kdump build when building it by hand.
I don't entirely like this approach, but it will only be temporarily,
namely until we get rid of COMPAT_43TTY. I do want <sys/ioctl_compat.h>
to cause a compiler error when included, because it's just there for
binary compatibility.
sam [Mon, 25 May 2009 16:38:47 +0000 (16:38 +0000)]
Fix handling of devices w/o radiotap support:
o do not attach DLT_IEEE802_11_RADIO unless both tx and rx headers are
present; this is assumed in the capture code paths
o verify the above with asserts in ieee80211_radiotap_{rx,tx}
o add missing checks for active taps before calling ieee80211_radiotap_rx
attilio [Mon, 25 May 2009 14:37:10 +0000 (14:37 +0000)]
Use, in uncovered part, the END() macro in order to improve debugging.
In this specific case, Valgrind won't get confused when analyzing such
functions.
Sponsored by: Sandvine Incorporated
Tested by: emaste
MFC: 3 days
rwatson [Mon, 25 May 2009 13:34:03 +0000 (13:34 +0000)]
Add missing call to ipx_pcbdetach() during SPX socket tear-down: not
harmful in practice if running without INVARIANTS, but will panic
with KASSERT enabled when SPX sockets are closed.
rwatson [Mon, 25 May 2009 11:50:58 +0000 (11:50 +0000)]
Rather than store a skeleton IPX header in an mbuf hung off the SPX
PCB, simply embed it in the PCB, avoiding additional memory overhead,
memory allocation overhead, and removing one of the few remaining
uses of dtom() in the network stack.
Restore misplaced spx_ctlinput() from an earlier commit.
yongari [Mon, 25 May 2009 07:31:18 +0000 (07:31 +0000)]
Add workaround for Yukon FE+ A0. This controller is known to have
severe silicon bugs that can't handle VLAN hardware tagging as well
as status LE writeback bug. The status LE writeback bug is so
critical we can't trust status word of received frame. To accept
frames on Yukon FE+ A0 msk(4) just do minimal check for received
frames and pass them to upper stack. This means msk(4) can pass
corrupted frames to upper layer. You have been warned!
Also I supposed RX_GMF_FL_THR to be 32bits register but Linux
driver treated it as 16bit register so follow their leads. At least
this does not seem to break msk(4) on Yukon FE+.
Tested by: bz, Tanguy Bouzeloc ( the.zauron <> gmail dot com )
Bruce Cran ( bruce <> cran dot org dot uk )
Michael Reifenberger ( mike <> reifenberger dot com )
Stephen Montgomery-Smith ( stephen <> missouri dot edu )
yongari [Mon, 25 May 2009 07:06:10 +0000 (07:06 +0000)]
Add preliminary Yukon FE+ support and register definitions.
Yukon FE+ is fast ethernet controller and uses new descriptor
format. Since I don't have this controller, the support code was
written from guess and various feedback from enthusiastic users.
Thanks to all users who patiently tested my initial patches.
Special thanks to Tanguy Bouzeloc who fixed critical bug of initial
patch.
Tested by: bz, Tanguy Bouzeloc ( the.zauron <> gmail dot com )
Bruce Cran ( bruce <> cran dot org dot uk )
Michael Reifenberger ( mike <> reifenberger dot com )
Stephen Montgomery-Smith ( stephen <> missouri dot edu )
yongari [Mon, 25 May 2009 06:39:48 +0000 (06:39 +0000)]
Explicitly reset GMAC Controls and initialize GM_GP_CTRL register.
The GM_GP_CTRL register may have stale content from previous link
information so clearing it will make hardware update the register
correctly when it established a valid link.
While I'm here remove stale comment.
yongari [Mon, 25 May 2009 06:29:02 +0000 (06:29 +0000)]
Disable HW WOL for Yukon EC Ultra. While I'm here use switch
statement over if-else statement. This change will make it easy to
add newer Yukon controllers.
yongari [Mon, 25 May 2009 06:19:36 +0000 (06:19 +0000)]
Explicitly check resolved speed/duplex. Just checking IFM_ACTIVE
does not guarantee established link. Also 1000baseT link report for
fast ethernet controller is not valid one so make sure gigabit link
is allowed for this controller.
Whenever we lost link, check whether Rx/Tx MACs were enabled. If both
MAC are not active, do not try to disable it again.
yongari [Mon, 25 May 2009 04:22:27 +0000 (04:22 +0000)]
Rather than checking every chip revision, introduce more flags to
mark controller's capability. Controllers that have jumbo frame
support sets MSK_FLAG_JUMBO, and controllers that does not support
checksum offloading for jumbo frames will set MSK_FLAG_JUMBO_NOCSUM.
For Fast Ethernet controllers it will set MSK_FLAG_FASTETHER and it
would be used in link state handling.
While here, disable Tx checksum offloading if jumbo frame is used
on controllers that does not have Tx checksum offloading capability
for jumbo frame(e.g. Yukon EC Ultra).
yongari [Mon, 25 May 2009 02:36:29 +0000 (02:36 +0000)]
Add driver support for 88E3016 PHY which is found on Marvell Yukon
FE+ controller. Due to the severe silicon bugs for Yukon FE+, 88E3016 seems to require more workarounds. However I'm not sure
whether the workaround is PHY specific or only applicable to Yukon
FE+. The datasheet for the PHY is publicly available but it lacks
several details for the workaround used in this change. The
workaround information was obtained from Linux. Many thanks to
Yukon FE+ users who helped me add 88E3016 support.
Tested by: bz, Tanguy Bouzeloc ( the.zauron <> gmail dot com )
Bruce Cran ( bruce <> cran dot org dot uk )
Michael Reifenberger ( mike <> reifenberger dot com )
Stephen Montgomery-Smith ( stephen <> missouri dot edu )
yongari [Mon, 25 May 2009 02:05:00 +0000 (02:05 +0000)]
Do not ignore NEXT Page capability of auto-negotiation
advertisement register. Some PHYs such as 88E3016 requires NEXT
Page capability to establish valid link. Also set protocol selector
field which is read only but it makes the intention clearer.
yongari [Mon, 25 May 2009 01:56:19 +0000 (01:56 +0000)]
Don't read unnecessary PHY registers. Speed/duplex resolution bit
is valid only for auto-negotiation case so check the bit if we know
auto-negotiation is active. While I'm here explicitly checks
current speed with speed mask and set IFM_NONE if resolved speed
is unknown.
yongari [Mon, 25 May 2009 01:41:05 +0000 (01:41 +0000)]
Use mii_phy_add_media() and remove usage of local macro ADD. Also
checks extended status register to see whether the PHY is fast
ethernet or not. This removes a lot of checks for specific PHY
models and it makes easy to add more PHYs to e1000phy(4).
While I'm here remove setting mii_anegticks as it is set with
mii_phy_add_media().
rmacklem [Mon, 25 May 2009 01:00:09 +0000 (01:00 +0000)]
Add NFSv4 root export checks to the DelegPurge, Renew and
ReleaseLockOwner operations analagous to what is already
in place for SetClientID and SetClientIDConfirm. These are
the five NFSv4 operations that do not use file handle(s),
so the checks are done using the NFSv4 root export entries
in /etc/exports.
yongari [Mon, 25 May 2009 00:56:01 +0000 (00:56 +0000)]
NVIDIA MCP controllers have no Rx buffer alignment restrictions.
Remove PAGE_SIZE alignment used in Rx buffer DMA tag creation. The
alignment restriction was used in old local jumbo allocator and
nfe(4) switched to UMA backed page allocator for jumbo frame.
This change should fix jumbo buffer allocation failure.
rmacklem [Sun, 24 May 2009 19:46:12 +0000 (19:46 +0000)]
Crib the realign function out of nfs_krpc.c and add a call
to it for the client side reply. Hopefully this fixes the
problem with using the new krpc for arm for the experimental
nfs client.
trasz [Sun, 24 May 2009 19:21:49 +0000 (19:21 +0000)]
Don't allow non-owner to set SUID bit on a file. It doesn't make
any difference now, but in NFSv4 ACLs, there is write_acl permission,
which also affects mode changes.
rmacklem [Sun, 24 May 2009 18:49:53 +0000 (18:49 +0000)]
Fix the experimental NFSv4 server so that it handles the case
where a client is not allowed NFSv4 access correctly. This
restriction is specified in the "V4: ..." line(s) in
/etc/exports.