dragonfly.git
16 years agoMerge from vendor branch FILE:
Peter Avalos [Mon, 28 May 2007 18:42:39 +0000 (18:42 +0000)]
Merge from vendor branch FILE:
Update to file 4.21 which is a bugfix release including an integer
overflow.  See Changelog for more changes.

16 years agoUpdate to file 4.21 which is a bugfix release including an integer
Peter Avalos [Mon, 28 May 2007 18:42:39 +0000 (18:42 +0000)]
Update to file 4.21 which is a bugfix release including an integer
overflow.  See Changelog for more changes.

16 years agoAdd some syslink debugging programs.
Matthew Dillon [Mon, 28 May 2007 05:28:12 +0000 (05:28 +0000)]
Add some syslink debugging programs.

16 years agoOpen the root image O_EXLOCK|O_NONBLOCK and exit with an error message
Matthew Dillon [Mon, 28 May 2007 05:26:29 +0000 (05:26 +0000)]
Open the root image O_EXLOCK|O_NONBLOCK and exit with an error message
if the open fails due to e.g. another virtual kernel using the same root
image.

Enable NL->CRNL conversion when we put the console in raw mode.

16 years agoRemove etc/rc.d/archdep which didn't serve any real purpose.
Sascha Wildner [Sun, 27 May 2007 23:46:29 +0000 (23:46 +0000)]
Remove etc/rc.d/archdep which didn't serve any real purpose.

16 years agoFrom within a virtual kernel, make /sbin/shutdown and /sbin/halt actually
Matthew Dillon [Sun, 27 May 2007 23:28:30 +0000 (23:28 +0000)]
From within a virtual kernel, make /sbin/shutdown and /sbin/halt actually
halt and exit the vkernel, and make /sbin/reboot automatically re-exec
a fresh vkernel.

Talk about creating a clean slate!  Having reboot re-exec the vkernel
is really nice.  The kernel development cycle time is now down to around
18 seconds, reboot -n -q to root login prompt, and 28 seconds for a normal
reboot.  That's running a vkernel with a normal RC startup and as a
bridged DHCP client.

16 years agoFix typo.
Sascha Wildner [Sun, 27 May 2007 23:17:47 +0000 (23:17 +0000)]
Fix typo.

16 years agoRemove unnecessary empty arguments.
Sascha Wildner [Sun, 27 May 2007 23:06:33 +0000 (23:06 +0000)]
Remove unnecessary empty arguments.

16 years agoSyslink API work - greatly simplify the syslink_msg structure. Reimplement
Matthew Dillon [Sun, 27 May 2007 20:35:43 +0000 (20:35 +0000)]
Syslink API work - greatly simplify the syslink_msg structure.  Reimplement
the user API (NOTE: DMA buffers not yet implemented) and start working on
a kernel backend API.

Get rid of the inband DMA buffer fields and physical routing fields.
Replace the 32 bit message id with a 64 bit message id.

The 64 bit msgid allows guarenteed unique ids to be synthesized without
requiring the end points to actually track message ids.

Add a RPC protocol field (sm_proto) and move the command/reply bit and
endian detect bits from sm_msgid to sm_proto.  This allows the exact same
sm_msgid supplied in a command to be used in the reply and frees up bits
in the msgid that were previously going to be used for the protocol.
A separate protocol field also makes it a lot easier for the recipient
to check that the protocol is compatible with its expectations.

Implement a message based userland API and implement a syslink pair feature
so userland can get descriptors for both sides, for testing.  Implement
buffering limits, non-blocking I/O (but not select support yet), check
for duplicate message ids in active commands and match replies to commands.

Implement endian conversion to native endianess for the syslink message
header and any structured message elements.

Begin work on an out-of-band dma buffer API.

16 years agoThe proper root device for a vkernel fs is vkd0s0a, not vkd0a.
Matthew Dillon [Sun, 27 May 2007 18:37:25 +0000 (18:37 +0000)]
The proper root device for a vkernel fs is vkd0s0a, not vkd0a.
Also fix kern/vfs_conf.c to properly interpret 's0'.

16 years agoAdd ifmedia(4) reference.
Sascha Wildner [Sun, 27 May 2007 17:30:01 +0000 (17:30 +0000)]
Add ifmedia(4) reference.

16 years agoAdd a bus_set_resource(9) manual page.
Sascha Wildner [Sun, 27 May 2007 16:07:41 +0000 (16:07 +0000)]
Add a bus_set_resource(9) manual page.

Obtained-from: FreeBSD

16 years agoFor rum(4) and ural(4):
Sepherosa Ziehau [Sun, 27 May 2007 10:53:29 +0000 (10:53 +0000)]
For rum(4) and ural(4):
- Use crit section to protect external interfaces, callouts, USB
  task and USB operation callback functions.
- Avoid holding ifnet.if_serializer across various USB operations,
  since current USB stack does not aware of lwkt serializer.
- In various callout, USB task and USB operation callback functions,
  hold ifnet.if_serializer around ieee80211 functions.

16 years agoApply if_rum.c rev 1.11's resource alloc/free fixes and cleanup to ural(4)
Sepherosa Ziehau [Sun, 27 May 2007 02:45:48 +0000 (02:45 +0000)]
Apply if_rum.c rev 1.11's resource alloc/free fixes and cleanup to ural(4)

16 years agoWelcome our new bce(4) driver to various manpages & files.
Sascha Wildner [Sat, 26 May 2007 22:54:29 +0000 (22:54 +0000)]
Welcome our new bce(4) driver to various manpages & files.

16 years agoNuke commented out compat shim.
Sepherosa Ziehau [Sat, 26 May 2007 22:07:18 +0000 (22:07 +0000)]
Nuke commented out compat shim.

16 years agoAdd the kernel support function allocsysid().
Matthew Dillon [Sat, 26 May 2007 20:31:38 +0000 (20:31 +0000)]
Add the kernel support function allocsysid().

16 years agoAdd support for Broadcom NetXtreme II GigE. Jumbo buffer support
Sepherosa Ziehau [Sat, 26 May 2007 08:50:49 +0000 (08:50 +0000)]
Add support for Broadcom NetXtreme II GigE.  Jumbo buffer support
is missing currently, which will be added later.

Thank David Christensen <davidch@broadcom.com> for sending us two
sample NICs.
Thank dillon@ for providing a blazing fast machine and environment
to test the driver.
Also thank Walter <wa1ter@myrealbox.com> very much, who contacted
Broadcom for me :)

Obtained-from: FreeBSD (w/ modification)

16 years agoAlthough our linker supports pie, our elf loader doesn't.
Hasso Tepper [Fri, 25 May 2007 19:05:12 +0000 (19:05 +0000)]
Although our linker supports pie, our elf loader doesn't.

16 years agoAdd a -c file option to the vkernel to specify CD images. The first -c or -r
Matthew Dillon [Fri, 25 May 2007 02:21:19 +0000 (02:21 +0000)]
Add a -c file option to the vkernel to specify CD images.  The first -c or -r
option will be the boot device.

Add a new virtual CDRom device, vcd.  Basically its works the same as VKD
but we open the device in read-only mode and use a block size of 2048 instead
of 512.

Install the console as a real device and change the console major to be
the same as the syscons major so a default init is able to start up a getty.

16 years agoUpdate documentation.
Matthew Dillon [Fri, 25 May 2007 00:59:06 +0000 (00:59 +0000)]
Update documentation.

Nudged in the back by: Sascha Wildner <saw@online.de>,  Ouch!

16 years agoAdd lwkt_sleep() to formalize a shortcut numerous bits of code have been
Matthew Dillon [Thu, 24 May 2007 20:51:22 +0000 (20:51 +0000)]
Add lwkt_sleep() to formalize a shortcut numerous bits of code have been
using for a while, which is to directly deschedule oneself and switch away.
This method of blocking requires a direct lwkt_schedule() call to reschedule
the thread and is primarily used by the message port abstraction.

Change the psignal code to check TDF_SINTR in the thread flags instead
of checking MSGPORTF_WAITING in the thread's private message port.

The lwkt_waitmsg() and lwkt_waitport() functions use the same msgport
backend function (mp_waitport).  Separate the backend into two functions,
mp_waitport and mp_waitmsg, and allow tsleep flags to be passed in instead
of flagging interruptability in the lwkt_msg flags.

Optimize the lwkt_waitmsg() backends - in the fully synchronous critical
path case no critical sections or spinlocks are required at all.

16 years agoDo an even better job discerning between blocked threads and blocked
Matthew Dillon [Thu, 24 May 2007 20:32:02 +0000 (20:32 +0000)]
Do an even better job discerning between blocked threads and blocked
processes.

16 years agoProperly detect interruptable LWKT sleeps and display as 'S' instead of 'D'.
Matthew Dillon [Thu, 24 May 2007 20:28:15 +0000 (20:28 +0000)]
Properly detect interruptable LWKT sleeps and display as 'S' instead of 'D'.

Properly detect uninterruptable LWKT sleeps and display as 'B' instead of 'D'.

Properly display the wmesg for LWKT sleeps.  Note that not all LWKT sleeps
have a wmesg (maybe we should give them one).

16 years agoLWKT message ports contain a number of function pointers which abstract
Matthew Dillon [Thu, 24 May 2007 05:51:29 +0000 (05:51 +0000)]
LWKT message ports contain a number of function pointers which abstract
their backend operation.

* Add a new function, mp_getport(), which takes over the functionality
  of lwkt_getport().

* Formalize the default backend and rename it the 'thread' port backend, used
  when a message port will only be drained by a single thread.  This backend
  is able to use critical sections and IPI messages to handle races.

* Fix a small timing window in the thread port backend where replying a
  synchronous message request from a different cpu may fail to wake up
  the originator who is waiting for the message completion.

* Abstract-out the message port initialization code and clean up related
  code pollution.

* Add a new backend called the 'spin' port backend.  This backend can be
  used if a message port might be drained by several different threads.
  For example, this would allow us to use a message port as part of a
  file pointer / file descriptor construct.

* Add a boot-time tunable, lwkt.use_spin_port (defaults to off) which
  forces spin ports to be used instead of thread ports for the per-thread
  message port.  This is used only for debugging.

16 years agoFix the kinfo run/sleep state for pure kernel threads. This effects /bin/ps
Matthew Dillon [Thu, 24 May 2007 05:45:45 +0000 (05:45 +0000)]
Fix the kinfo run/sleep state for pure kernel threads.  This effects /bin/ps
and so forth.  A pure kernel thread can deschedule itself without having
to set td_wchan[], so use its presence on the LWKT run queue to determine
whether it is running or not.

16 years agoThe dump device must be opened before ioctls can be performed on it.
Matthew Dillon [Wed, 23 May 2007 17:09:33 +0000 (17:09 +0000)]
The dump device must be opened before ioctls can be performed on it.
Fix a crash related to the setting of dumpdev in early boot (in
/boot/loader.conf).

Reported-by: "Simon 'corecode' Schubert" <corecode@fs.ei.tum.de>
16 years agoRaise the values of several debug options to cover some more code.
Sascha Wildner [Wed, 23 May 2007 17:07:55 +0000 (17:07 +0000)]
Raise the values of several debug options to cover some more code.

16 years ago* Greatly reduce the complexity of the LWKT messaging and port abstraction.
Matthew Dillon [Wed, 23 May 2007 08:57:10 +0000 (08:57 +0000)]
* Greatly reduce the complexity of the LWKT messaging and port abstraction.
  Significantly reduce the overhead of the subsystem.

* The message abort algorithm has been rewritten.  It now sends a
  separate message to issue the abort instead of trying to requeue
  the original message.  This also means the TAILQ embedded in the
  lwkt_msg structure can be used by unrelated code during processing
  of the message.

* Numerous MSGF_ flags have been removed, and all the LWKT msg/port
  algorithms have been rewritten and simplified.  The message structure
  is now only touched by the current owner in all situations.

* Numerous structural fields have been removed.  In particular, the
  fields used for message abort sequencing have been simplified and
  we do not try to embed a 'command' field in the base LWKT message
  any more.

* Clean up the netmsg abstraction, which is used all over the network stack.
  Instead of trying to overload fields in lwkt_msg we now simply extend
  the base lwkt_msg into struct netmsg.  The function dispatch now takes
  a netmsg and returns void (before we had to return EASYNC), and we no
  longer need weird casts.

  Accept/connect message aborts are now greatly simplified.

16 years agoICMP extensions for MPLS support for traceroute(8).
Hasso Tepper [Wed, 23 May 2007 06:38:22 +0000 (06:38 +0000)]
ICMP extensions for MPLS support for traceroute(8).

Obtained-from: NetBSD with some fixes

16 years agoSimplify the lwkt_msg structure by removing two unused fields and a number
Matthew Dillon [Wed, 23 May 2007 02:09:41 +0000 (02:09 +0000)]
Simplify the lwkt_msg structure by removing two unused fields and a number
of obsolete preprocessor defines.

16 years agoRemove unused define.
Matthew Dillon [Tue, 22 May 2007 21:28:56 +0000 (21:28 +0000)]
Remove unused define.

16 years agoFix section numbers.
Sascha Wildner [Tue, 22 May 2007 16:57:41 +0000 (16:57 +0000)]
Fix section numbers.

16 years agoComment out empty section.
Sascha Wildner [Tue, 22 May 2007 14:04:23 +0000 (14:04 +0000)]
Comment out empty section.

16 years agoRemove DIOCWLABEL operation. Doing it destroyed the purpose of having
Matthew Dillon [Mon, 21 May 2007 15:53:29 +0000 (15:53 +0000)]
Remove DIOCWLABEL operation.  Doing it destroyed the purpose of having
write protected areas in the first place.  This also solves an issue
bootstrapping from older versions of DragonFly since the ioctl has moved
to a different header file.

Users can write-enable the label area with disklabel -W/-N if the issue
comes up.

Note: In DragonFly 1.9 and later, the MBR and disklabel areas are only
write protected when accessed via a slice or partition.  Access to these
areas via the raw disk (e.g. ad0) is no long write-protected.

Reported-by: Hasso Tepper <hasso@estpak.ee>,
     YONETANI Tomokazu <qhwt+dfly@les.ath.cx>

16 years agoHandle disklabels with the disk management layer instead of rolling our own
Matthew Dillon [Mon, 21 May 2007 04:22:23 +0000 (04:22 +0000)]
Handle disklabels with the disk management layer instead of rolling our own
in the floppy driver.

Retain the floppy driver's format switching features via special fd0.<size>
devices.  Also fix a bug in FD_SOPTS where the floppy type table was being
permanently overwritten.

floppy device numbering has changed, update MAKEDEV appropriately.

16 years agoFix a bug in recent commits. When creating a virgin disk label for devices
Matthew Dillon [Mon, 21 May 2007 04:21:05 +0000 (04:21 +0000)]
Fix a bug in recent commits.  When creating a virgin disk label for devices
in DSO_COMPATPARTA mode, the generated 'a' partition was not sized properly.

16 years agoUse 0x%08x for all minor numbers, not just those > 255.
Matthew Dillon [Mon, 21 May 2007 01:40:01 +0000 (01:40 +0000)]
Use 0x%08x for all minor numbers, not just those > 255.

16 years agoRevert sc1 to testing getuid() like it says it does in the output.
Matthew Dillon [Sun, 20 May 2007 23:22:17 +0000 (23:22 +0000)]
Revert sc1 to testing getuid() like it says it does in the output.

16 years agoContinue untangling the disklabel.
Matthew Dillon [Sun, 20 May 2007 23:21:37 +0000 (23:21 +0000)]
Continue untangling the disklabel.

* Remove numerous #include <sys/disklabel.h> lines that are no longer used.

* Move DIOCWLABEL from sys/disklabel.h to sys/diskslice.h

* Modify ffsinfo, fsirand, growfs, and newfs_msdos to use DIOCGPART instead
  of DIOCGDINFO to obtain disk geometry information.  Add defaults where
  necessary to allow these programs to run on files instead of devices.

  Also, change ffsinfo to output to stdout by default.

16 years agoRemove the fragment size, block size, and cpg fields from the disklabel
Matthew Dillon [Sun, 20 May 2007 20:40:06 +0000 (20:40 +0000)]
Remove the fragment size, block size, and cpg fields from the disklabel
program.  disklabel no longer displays these fields and will zero them out
when writing the label back.  newfs and fsck no longer attempt to retrieve
this information from the disklabel.

Replace the obsolete cylinder range and alignment comments with a comment
that displays the size of a partition in megabytes.

16 years agoMore disklabel disentanglement - use DIOCGPART instead of DIOCGDLABEL.
Matthew Dillon [Sun, 20 May 2007 20:29:01 +0000 (20:29 +0000)]
More disklabel disentanglement - use DIOCGPART instead of DIOCGDLABEL.
Replace the alternate superblock search code, which depends on information
from the disk label, with a hard coded check.  No big loss, the user can
still look for other alternate superblocks with the -b option.

16 years agoRemove all dependancies newfs had on accessing the disklabel. Use
Matthew Dillon [Sun, 20 May 2007 19:29:21 +0000 (19:29 +0000)]
Remove all dependancies newfs had on accessing the disklabel.  Use
getdisktabbyname() instead of getdiskbyname() and use DIOCGPART instead
of DIOCGDINFO to get the geometry information.  Also make the -v option
work properly with regular files.

NOTE: newfs will no longer retrieve the fs fragment and block size fields
from the disklabel, so non-default operation must be specified with options.
newfs will also no longer attempt to update the disklabel.

16 years agoWhen a traditional bsd disklabel is present, try to reserve SBSIZE bytes
Matthew Dillon [Sun, 20 May 2007 19:23:33 +0000 (19:23 +0000)]
When a traditional bsd disklabel is present, try to reserve SBSIZE bytes
of total space, regardless of the sector size.  newfs presumes no more then
SBSIZE bytes of space at the beginning of the block device are reserved.

16 years agoMerge fixes to debugging messages from FreeBSD:
YONETANI Tomokazu [Sun, 20 May 2007 07:43:24 +0000 (07:43 +0000)]
Merge fixes to debugging messages from FreeBSD:

rev 1.11
Replace all the ifdef debugging spaghetti with a single ifdef and
a macro so that it is easier to read the flow of the code.

revs 1.12-1.13
We already have these.

revs 1.36-1.37
Add debugging to rman_manage_region() as well.  This is useful since we
manage subregions in ACPI.

rev 1.39
Fix a debugging printf.  The order of start/end was inconsistant with
all the other start/end debugs, causing momentary confusion when the
output was examined.

16 years agoCleanup diskerr() output a bit - don't say it was trying to write when
Matthew Dillon [Sun, 20 May 2007 04:41:58 +0000 (04:41 +0000)]
Cleanup diskerr() output a bit - don't say it was trying to write when
the BUF/BIO command is no longer set.

The device name was being misreported by dsname().  Fix it up.

16 years agoQuickly update UPDATING with 1.8 -> 1.9+ documentation.
Matthew Dillon [Sun, 20 May 2007 01:07:30 +0000 (01:07 +0000)]
Quickly update UPDATING with 1.8 -> 1.9+ documentation.

16 years agoDisklabel operations are no longer legal on the raw disk, use DIOCGPART to
Matthew Dillon [Sat, 19 May 2007 21:43:32 +0000 (21:43 +0000)]
Disklabel operations are no longer legal on the raw disk, use DIOCGPART to
get the geometry.

16 years agoInclude geometry data in DIOCGPART so fdisk can use it instead of trying
Matthew Dillon [Sat, 19 May 2007 21:37:01 +0000 (21:37 +0000)]
Include geometry data in DIOCGPART so fdisk can use it instead of trying
to read a faked disklabel.

Change MAKEDEV to create 'compatibility slice' devices, e.g. da0s0a,
da0s0b, etc.  Previously the compatibility slice devices were e.g. da0a, da0b,
and there was no 'whole slice' device for the compatibility slice at all,
meaning one couldn't disklabel it.  Now there is, e.g. da0s0.

16 years agoFix device recognition, /dev/vn0 now uses WHOLE_SLICE_PART, not partition 'c'.
Matthew Dillon [Sat, 19 May 2007 20:31:16 +0000 (20:31 +0000)]
Fix device recognition, /dev/vn0 now uses WHOLE_SLICE_PART, not partition 'c'.

16 years agoFix a one-character allocated string buffer overflow that was introduced
Matthew Dillon [Sat, 19 May 2007 19:33:02 +0000 (19:33 +0000)]
Fix a one-character allocated string buffer overflow that was introduced
in the last commit.  Space for the '/' separator was not being accounted
for.

Reported-by: "Sepherosa Ziehau" <sepherosa@gmail.com>
16 years agoMiscellaneous mdoc fixes.
Sascha Wildner [Sat, 19 May 2007 17:32:13 +0000 (17:32 +0000)]
Miscellaneous mdoc fixes.

16 years agoKeep the ds_skip_* fields in struct diskslice properly synchronized.
Matthew Dillon [Sat, 19 May 2007 09:46:18 +0000 (09:46 +0000)]
Keep the ds_skip_* fields in struct diskslice properly synchronized.
ds_skip_bsdlabel is inclusive of bsd_skip_platform but was being improperly
set to 0 even when an mbr reserved sector existed.  The fields were not
being properly reset for a slice whos disklabel is destroyed.

Defer reading the disklabel on a slice until a partition on the slice
is opened or a disklabel related DIOC ioctl is performed on the slice.
In particular, we do not attempt to read the disklabel when opening the
whole-disk-slice for the whole disk or the whole-slice-partition for a slice.

Previously the code attempted to scan all available BSD slices for
disklabels.

When writing to a raw slice, do not snoop or do reserved-sector checks
unless a disklabel has been loaded for the slice.  Typically a disklabel
will only be loaded in two situations: (1) if filesystems are mounted from
that slice or (2) the disklabel program has performed ioctls on the
whole-slice-partition to set a disklabel.  Now writing to raw slices works
almost the same as writing to the whole-disk-slice, with no interpretation.

Remove all remaining references to the LABELSECTOR constant.  Instead,
use the ds_skip_* fields to determine the sector where the disklabel
starts within a slice.  These changes significantly cleaned up the
snoop and reserved sector checking code in dscheck().

16 years agoContinue untangling the disklabel. Clean up dumpdev handling by having
Matthew Dillon [Sat, 19 May 2007 07:05:26 +0000 (07:05 +0000)]
Continue untangling the disklabel.  Clean up dumpdev handling by having
it use DIOCGPART instead of trying to access the disklabel directly, and
replace references to LABELSECTOR with partinfo.skip_bsdlabel.

16 years agoMake savecore work wagain by using the new 64 bit dumplo (_dumplo64).
Matthew Dillon [Sat, 19 May 2007 06:54:29 +0000 (06:54 +0000)]
Make savecore work wagain by using the new 64 bit dumplo (_dumplo64).

16 years agoTemporary hack until we can get rid of the disklabel dependancies.
Matthew Dillon [Sat, 19 May 2007 06:39:39 +0000 (06:39 +0000)]
Temporary hack until we can get rid of the disklabel dependancies.
DIOCGDINFO and DIOCWDINFO can only operate on the slice, not on the
partition.  Figure out the name of the slice and temporarily open a
descriptor to read and update the label.

16 years ago- Turn on VLAN_MTU for 905B typed cards.
Sepherosa Ziehau [Sat, 19 May 2007 06:21:43 +0000 (06:21 +0000)]
- Turn on VLAN_MTU for 905B typed cards.
- Adjust SIOCSIFCAP logic, after turning on VLAN_MTU.

Tested-with: 3c905C-TX, 3c575C, 3c905-TX

#
# Non-905B cards were claimed to work with VLAN_MTU, but
# it turns out my 3c905-TX can't hear packets, whose size
# are > 1514 (excluding CRC).
#
# I conducted the following two 'ping' tests:
#
# 192.168.4.2 vlan iface, whose parent device is a 3c905-TX
# based xl(4)
# 192.168.4.1 vlan iface, whose parent device is a 3c575
# based xl(4)
#
# TEST1:
# On 192.168.4.1
# Run 'tcpdump -e -ni xl1' when 'ping -s 1468 192.168.4.2':
# 14:09:06.049912 00:10:5a:9f:bc:d5 > 00:01:02:e3:dd:b5,
# ethertype 802.1Q (0x8100), length 1514: vlan 11, p 0,
# ethertype IPv4, 192.168.4.2 > 192.168.4.1: ICMP echo reply,
# id 1283, seq 4352, length 1476
# 14:09:07.069522 00:01:02:e3:dd:b5 > 00:10:5a:9f:bc:d5,
# ethertype 802.1Q (0x8100), length 1514: vlan 11, p 0,
# ethertype IPv4, 192.168.4.1 > 192.168.4.2: ICMP echo request,
# id 1283, seq 4608, length 1476
#
# Above test shows 3c905 still works when packets size is 1514.
#
#
# TEST2:
# Run 'tcpdump -e -ni xl1' when 'ping -s 1469 192.168.4.2':
# 14:12:07.119839 00:01:02:e3:dd:b5 > 00:10:5a:9f:bc:d5,
# ethertype 802.1Q (0x8100), length 1515: vlan 11, p 0,
# ethertype IPv4, 192.168.4.1 > 192.168.4.2: ICMP echo request,
# id 2563, seq 2048, length 1477
# 14:12:08.140366 00:01:02:e3:dd:b5 > 00:10:5a:9f:bc:d5,
# ethertype 802.1Q (0x8100), length 1515: vlan 11, p 0,
# ethertype IPv4, 192.168.4.1 > 192.168.4.2: ICMP echo request,
# id 2563, seq 2304, length 1477
#
# Tcpdump is also run on 192.168.4.2 during the second test,
# nothing pops up at all.
#
# Above test shows 3c905 does NOT work when packets size is 1515,
# i.e. > 1514
#

16 years agoImplement raw extensions for WHOLE_DISK_SLICE device accesses for acd0.
Matthew Dillon [Sat, 19 May 2007 02:39:05 +0000 (02:39 +0000)]
Implement raw extensions for WHOLE_DISK_SLICE device accesses for acd0.
Disallow special accesses on devices that do not support the extensions.

Implement direct track reading via /dev/acd0 or /dev/acd0t* (use
MAKEDEV acd0t to create per-track devices).

Fix a few bugs with the minor device numbers generated by MAKEDEV for
/dev/acd*.  /dev/acd0a and /dev/acd0c were improperly specifying the
WHOLE_DISK_SLICE instead of the compatibility slice.

Change all mountroot operations that were trying to access disks via
RAW_PART to instead access them via WHOLE_SLICE_PART (removing more
dependancies on the old disklabel structure).

Replace the unconditional sector sanity check in dsopen() with better
sanity checks in dscheck().  The checks are not made for special
WHOLE_DISK_SLICE accesses, allowing weird sector sizes to feed through to
the device.

16 years agoUse the WHOLE_DISK_SLICE instead of the compatibility slice to
Matthew Dillon [Sat, 19 May 2007 01:31:46 +0000 (01:31 +0000)]
Use the WHOLE_DISK_SLICE instead of the compatibility slice to
access CD tracks.

16 years agoContinue untangling the disklabel.
Matthew Dillon [Sat, 19 May 2007 00:52:02 +0000 (00:52 +0000)]
Continue untangling the disklabel.

* Move dk*() inline functions and other related stuff not directly related
  to the BSD disklabel out of sys/disklabel.h and into sys/diskslice.h.
  Add additional functions to sys/diskslice.h

* Extend the slice and partition fields in the device minor number.  We
  now support up to 128 slices and up to 256 partitions.

* Implement new minor device numbers for 'raw slices', such as ad0s1.
  Previously raw slices used the same minor number as partition c within
  the slice.  e.g. ad0s1 and ad0s1c had the same device number.
  This made it impossible to distinguish between the two.

  The 'whole disk' device's minor number has also changed.  Our new whole-slice
  and whole-disk devices specify a partition number of (DKMAXPARTITIONS - 1)
  (aka 255).

* Completely disable disklabel related operations on the raw disk, e.g.
  da0, and on partitions, e.g. da0s1a.  Only allow disklabel
  operations on whole slices, e.g. da0s1.

  NOTE!! For compatibility while booting drivers which set DSO_COMPATLABEL,
  the compat disklabel may be read, but not written, via the whole-disk
  device.  e.g. acd0.

  NOTE!! For compatibility we have no choice but to continue to snoop
  read/write operations on raw slices (e.g. da0s1) because the
  disklabel program and the kernel still depend on the snooping to modify
  the in-core version of the disklabel to the on-disk version.

  No snooping will occur on the whole-disk device (e.g. da0).

  No snooping will occur on raw slices (e.g. da0s1) if the disk is
  unlabeled and no in-core label was set.  Note that disklabel -r -w
  DOES set an in-core label before writing to a raw-slice, so it is still
  ok.

* dsopen() no longer attempts to scan the MBR or slice table when the
  whole-disk device (e.g. da0) is opened, and no longer attempts to read
  the disklabel when the whole-slice device is opened (e.g. da0s1).  The
  disklabel is only read when a partition is explicitly opened or the
  label is explicitly read via an ioctl.

* The virgin disklabel is stored in the struct diskslice for
  WHOLE_DISK_SLICE (slice 1).

16 years agoUpdate # comments and documentation for disktab(5).
Matthew Dillon [Fri, 18 May 2007 17:14:14 +0000 (17:14 +0000)]
Update # comments and documentation for disktab(5).

16 years agoCleanup shutdown(2) usage and make it consistent. The implementation in rsh
Matthew Dillon [Fri, 18 May 2007 17:05:13 +0000 (17:05 +0000)]
Cleanup shutdown(2) usage and make it consistent.  The implementation in rsh
was particularly amusing.

Submitted-by: "Nuno Antunes" <nuno.antunes@gmail.com>
16 years agoFinish moving boot/i386 to boot/pc32 (it was left half done), remove
Matthew Dillon [Fri, 18 May 2007 07:41:43 +0000 (07:41 +0000)]
Finish moving boot/i386 to boot/pc32 (it was left half done), remove
boot/i386, and cleanup boot/pc32.

16 years agouse_mcd.h, use_scd.h no longer exist.
Matthew Dillon [Fri, 18 May 2007 03:12:02 +0000 (03:12 +0000)]
use_mcd.h, use_scd.h no longer exist.

16 years agoRemove the NATA config file generation rules. Add a rule to the check:
Matthew Dillon [Fri, 18 May 2007 02:13:04 +0000 (02:13 +0000)]
Remove the NATA config file generation rules.  Add a rule to the check:
target to check that the NATA config file exists instead.

16 years agoAdd back PCI_MAP_FIXUP, it was mistakenly removed.
Matthew Dillon [Fri, 18 May 2007 02:07:57 +0000 (02:07 +0000)]
Add back PCI_MAP_FIXUP, it was mistakenly removed.

Reported-by: Sascha
16 years agoFix buildworld, getdiskbyname() has moved to <disktab.h>
Matthew Dillon [Thu, 17 May 2007 23:53:44 +0000 (23:53 +0000)]
Fix buildworld, getdiskbyname() has moved to <disktab.h>

16 years agoAdd getdisktabbyname() to libc. This will soon replace getdiskbyname().
Matthew Dillon [Thu, 17 May 2007 23:50:00 +0000 (23:50 +0000)]
Add getdisktabbyname() to libc.  This will soon replace getdiskbyname().
Move _PATH_DISKTAB to <disktab.h>, remove #define DISKTAB entirely.

16 years agoRemove libdisk from the Makefile.
Matthew Dillon [Thu, 17 May 2007 21:09:47 +0000 (21:09 +0000)]
Remove libdisk from the Makefile.

16 years agoRemove #include <sys/disklabel.h> from various source files which no longer
Matthew Dillon [Thu, 17 May 2007 21:08:50 +0000 (21:08 +0000)]
Remove #include <sys/disklabel.h> from various source files which no longer
need it.

16 years agoUse DIOCGPART instead of DIOCGDINFO to remove references to the disklabel
Matthew Dillon [Thu, 17 May 2007 21:07:13 +0000 (21:07 +0000)]
Use DIOCGPART instead of DIOCGDINFO to remove references to the disklabel
from linux_ioctl_BLKGETSIZE(), and rename the function to
linux_ioctl_BLKGETSIZE32().

16 years agoSynchronize the NATA kernel build.
Matthew Dillon [Thu, 17 May 2007 21:06:01 +0000 (21:06 +0000)]
Synchronize the NATA kernel build.

16 years agoRemove libdisk from the build.
Matthew Dillon [Thu, 17 May 2007 20:43:03 +0000 (20:43 +0000)]
Remove libdisk from the build.

16 years agoRemove mcd(4) and scd(4) remains.
Sascha Wildner [Thu, 17 May 2007 19:26:06 +0000 (19:26 +0000)]
Remove mcd(4) and scd(4) remains.

16 years agoRemove support for mcd and scd - these were old proprietary ISA cdrom
Matthew Dillon [Thu, 17 May 2007 17:55:17 +0000 (17:55 +0000)]
Remove support for mcd and scd - these were old proprietary ISA cdrom
interfaces that haven't been in the build for ages.

16 years agoRemove the roll-your-own disklabel from the ATA CD driver. Use the
Matthew Dillon [Thu, 17 May 2007 17:44:27 +0000 (17:44 +0000)]
Remove the roll-your-own disklabel from the ATA CD driver.  Use the
disk management layer instead.

16 years agoFix typo.
Sascha Wildner [Thu, 17 May 2007 16:36:31 +0000 (16:36 +0000)]
Fix typo.

16 years agoInclude <diskslice.h> for DIOCGPART. This fixes the LINT build.
Sascha Wildner [Thu, 17 May 2007 15:05:27 +0000 (15:05 +0000)]
Include <diskslice.h> for DIOCGPART. This fixes the LINT build.

16 years agoNext round of fixing all kinds of spelling mistakes.
Sascha Wildner [Thu, 17 May 2007 08:19:03 +0000 (08:19 +0000)]
Next round of fixing all kinds of spelling mistakes.

16 years agoKill references to the recently removed diskpart(8).
Sascha Wildner [Thu, 17 May 2007 06:12:05 +0000 (06:12 +0000)]
Kill references to the recently removed diskpart(8).

16 years agoRemove the roll-your-own disklabel from CCD. Use the kernel disk manager
Matthew Dillon [Thu, 17 May 2007 03:20:13 +0000 (03:20 +0000)]
Remove the roll-your-own disklabel from CCD.  Use the kernel disk manager
for disklabel support instead.

Make CCD a real disk device rather then a fake one.  NOTE: All /dev/ccd*
devices have changed and must be remade

Introduce DSO_COMPATMBR.  This forces an MBR sector to be reserved in front
of a disklabel even when the target disk does not have slices.  It is used
by the CCD and VN devices to keep the disklabel aligned the same way it has
been historically.

Implement 64 bit block addressing for CCD.

Implement a new filesystem type "ccd", and require that the devices backing
the CCD use that filesystem type for safety.

Fix a bug in DIOCGPART where the partinfo->media_blocks was not being
set properly for partitions.

16 years agoAdd dev_drefs() - return the number of references on a cdev_t
Matthew Dillon [Thu, 17 May 2007 03:02:00 +0000 (03:02 +0000)]
Add dev_drefs() - return the number of references on a cdev_t

16 years agoPort 16 byte SCSI command support from FreeBSD. This adds support for
Matthew Dillon [Wed, 16 May 2007 20:59:38 +0000 (20:59 +0000)]
Port 16 byte SCSI command support from FreeBSD.  This adds support for
detecting and performing I/O on disks greater then 2TB (with more
then 2^32 blocks).

Remove KKASSERT from dual user/kernel compiled file - reported by Sascha

Obtained-from: FreeBSD / Kenneth D. Merry did the original FreeBSD work.

16 years agoE2BIG -> EFBIG
Sepherosa Ziehau [Wed, 16 May 2007 14:37:55 +0000 (14:37 +0000)]
E2BIG -> EFBIG

16 years agoE2BIG -> EFBIG
Sepherosa Ziehau [Wed, 16 May 2007 14:24:40 +0000 (14:24 +0000)]
E2BIG -> EFBIG

16 years agoContinue untangling the disklabel. Add sector index reservation fields
Matthew Dillon [Wed, 16 May 2007 05:20:26 +0000 (05:20 +0000)]
Continue untangling the disklabel.  Add sector index reservation fields
to the diskslice and partinfo structures.  These fields will replace the
hardcoded LABELSECTOR constant and also help manage reserved areas in
the disklabel.

16 years agoSupport 64 bit file sizes and 64 bit sector numbers.
Matthew Dillon [Tue, 15 May 2007 22:45:10 +0000 (22:45 +0000)]
Support 64 bit file sizes and 64 bit sector numbers.

16 years ago* The diskslice abstraction now stores offsets/sizes as 64 bit quantities.
Matthew Dillon [Tue, 15 May 2007 22:44:21 +0000 (22:44 +0000)]
* The diskslice abstraction now stores offsets/sizes as 64 bit quantities.
  (NOTE: DOS partition tables and standard disklabels can't handle 64 bit
  sector numbers yet).  For future pluggable disklabel/partitioning schemes.

* The kernel panic / kernel core API is now 64 bits.

* The VN device now uses 64 bit sector numbers and can handle block devices
  up to what is supported by the filesystem (typically 8TB).  This change
  was made primarily so we can test future disklabel / partition table
  support.

* Pass 64 bit LBAs to various block devices and to the SCSI layer.

* Check for and assert 32 bit overflow conditions in various places, instead
  of wrapping.

16 years agoThe normal ATA driver is capable of handling 48 bit block addressing, but
Matthew Dillon [Tue, 15 May 2007 20:29:16 +0000 (20:29 +0000)]
The normal ATA driver is capable of handling 48 bit block addressing, but
the blockaddr field in the ad_request structure was only 32 bits.  Expand it
to 64 bits.  Note that NATA didn't have this problem.

16 years agoAdd a new command, /sbin/diskinfo, which uses the revamped DIOCGPART
Matthew Dillon [Tue, 15 May 2007 17:53:11 +0000 (17:53 +0000)]
Add a new command, /sbin/diskinfo, which uses the revamped DIOCGPART
ioctl to extract information from storage devices.  As an added bonus,
the physical byte offset relative to the base of the raw device
for the beginning of a slice or partition can be displayed.  Great for
debugging.

16 years agoContinue untangling the disklabel. Reorganize struct partinfo and the
Matthew Dillon [Tue, 15 May 2007 17:51:04 +0000 (17:51 +0000)]
Continue untangling the disklabel.  Reorganize struct partinfo and the
DIOCGPART ioctl to extract the required information directly, and fix
the DIOCGPART ioctl direction so userland can use it.

This removes numerous disklabel references, particularly from the filesystem
code which was doing silly indirections just to figure out the sector size.

NOTE: The absolute byte offset of the slice or partition (relative to the
base of the raw disk) is also made available, but is not currently used
by the kernel.

16 years ago- Fix a typo which may leave promisc/allmulti mode mis-configured.
Sepherosa Ziehau [Tue, 15 May 2007 12:58:45 +0000 (12:58 +0000)]
- Fix a typo which may leave promisc/allmulti mode mis-configured.
- Clean up bge_ioctl() a little bit:
  o  Nuke unnecessay local variable 'flags', use 'mask' instead.
  o  Move 'mii' declaration near its usage.
  o  Nuke redundant 'error' resetting.
- Minor style changes.

16 years agoContinue untangling the disklabel. Use the generic disk_info structure
Matthew Dillon [Tue, 15 May 2007 05:37:39 +0000 (05:37 +0000)]
Continue untangling the disklabel.  Use the generic disk_info structure
to hold template information instead of the disklabel structure.

This removes all references to the disklabel structure from the MBR code
and leaves mostly opaque references in the slice code.

16 years agoContinue untangling the disklabel. Have most disk device drivers fill out
Matthew Dillon [Tue, 15 May 2007 00:01:04 +0000 (00:01 +0000)]
Continue untangling the disklabel.  Have most disk device drivers fill out
and install a generic disk_info structure instead of filling out random
fields in the disklabel.

The generic disk_info structure uses a 64 bit integer to represent
the media size in bytes or total sector count.

16 years agoRemove diskpart(8) manual page.
Sascha Wildner [Mon, 14 May 2007 21:26:56 +0000 (21:26 +0000)]
Remove diskpart(8) manual page.

16 years agoStart untangling the disklabel from various bits of code with the goal of
Matthew Dillon [Mon, 14 May 2007 20:02:45 +0000 (20:02 +0000)]
Start untangling the disklabel from various bits of code with the goal of
introducing support for a new 64 bit disklabel.

Remove the D_* flags for disklabel.d_flags.  These sorts of flags just do
not belong in the disk image.

Relabel the partition sub-structure in disktab.h, and remove other ancient
compatibility defines in disklabel.h.

16 years agoRemove the ancient diskpart program.
Matthew Dillon [Mon, 14 May 2007 19:28:40 +0000 (19:28 +0000)]
Remove the ancient diskpart program.

16 years agoLink to pkgsrc(7) instead of packages(7).
Sascha Wildner [Mon, 14 May 2007 14:28:47 +0000 (14:28 +0000)]
Link to pkgsrc(7) instead of packages(7).

16 years agoUse M_DONTWAIT for mcluster allocation on em_init() path to prevent system
Sepherosa Ziehau [Mon, 14 May 2007 12:31:41 +0000 (12:31 +0000)]
Use M_DONTWAIT for mcluster allocation on em_init() path to prevent system
hanging, if user configures RX descriptors to the maximum allowable value,
but kern.ipc.nmbclusters tunable is forgotten to be adjusted accordingly.

System-Hanging-Experienced-by: hasso@ :P
# This commit can be reverted once object cache limit can grow automaticly.

16 years agoAdd NetBSD's pkgsrc(7) manpage.
Sascha Wildner [Mon, 14 May 2007 11:31:23 +0000 (11:31 +0000)]
Add NetBSD's pkgsrc(7) manpage.