Commit Graph

110 Commits

Author SHA1 Message Date
Justin T. Gibbs
5e58295a1f Apply the ad* => ada* IDE device name transition to the Xen block
front driver.

Submitted by:	Bei Guan <gbtju85@gmail.com>
Reviewed by:	gibbs
MFC after:	1 week
2013-05-31 04:43:19 +00:00
Justin T. Gibbs
818fe953ac Correct panic on detach of Xen PV network interfaces.
dev/xen/netfront:
    In netif_free(), properly stop the interface and drain any pending
    timers prior to disconnecting from the backend device.

    Remove all media and detach our interface object from the system
    prior to deleting it.

PR:		kern/176471
Submitted by:	Roger Pau Monne <roger.pau@citrix.com>
Reviewed by:	gibbs
MFC after:	1 week
2013-05-22 17:13:03 +00:00
Gabor Kovesdan
a8b5c2a0aa - Correct spelling in comments
Submitted by:	Christoph Mallon <christoph.mallon@gmx.de> (via private mail)
2013-04-17 11:56:11 +00:00
Gabor Kovesdan
a2098fea6d - Correct mispellings of the word necessary
Submitted by:	Christoph Mallon <christoph.mallon@gmx.de> (via private mail)
2013-04-17 11:42:40 +00:00
Sofian Brabez
61bfd86762 Use DEVMETHOD_END macro defined in sys/bus.h instead of {0, 0} sentinel on device_method_t arrays
Reviewed by:	cognet
Approved by:	cognet
2013-01-30 18:01:20 +00:00
Marius Strobl
f4131300c4 Remove files not connected to the build. It's confusing enough that
we still have two not quite the same evtchn.c left over.

MFC after:	3 day
2013-01-03 15:31:23 +00:00
Marius Strobl
6f9767ac27 - Replace partially incorrect function names in panic(9) strings with
__func__ and add some missing ones.
- Remove a stale comment.
- Remove unused NUM_ELEMENTS macro.
- Remove extra empty lines.
- Use DEVMETHOD_END.
- Use NULL rather than 0 for pointers.

MFC after:	3 days
2013-01-03 13:44:25 +00:00
Marius Strobl
dcceabd344 - Fix !SMP build.
- Replace incorrect function names in printf(9) strings with __func__.
- Make xctrl_shutdown_reasons table const.
- Use nitems() rather than rolling an own version.
- Use DEVMETHOD_END.
- Use NULL rather than 0 for pointers.

MFC after:	3 days
2013-01-03 13:42:45 +00:00
Gleb Smirnoff
c6499eccad Mechanically substitute flags from historic mbuf allocator with
malloc(9) flags in sys/dev.
2012-12-04 09:32:43 +00:00
Dimitry Andric
9c715a0979 Redo r242889, now using the method from projects/amd64_xen_pv r240747.
Reminded by:	kib
MFC after:	3 days
2012-11-12 22:28:32 +00:00
Roman Divacky
985518b80a Fix a typo. 2012-11-11 10:45:21 +00:00
Roman Divacky
f9a866956b Change the XNB_ASSERT from a statement expression to do-while(0) as its
result is never used.
2012-11-11 10:42:34 +00:00
Konstantin Belousov
5050aa86cf Remove the support for using non-mpsafe filesystem modules.
In particular, do not lock Giant conditionally when calling into the
filesystem module, remove the VFS_LOCK_GIANT() and related
macros. Stop handling buffers belonging to non-mpsafe filesystems.

The VFS_VERSION is bumped to indicate the interface change which does
not result in the interface signatures changes.

Conducted and reviewed by:	attilio
Tested by:	pho
2012-10-22 17:50:54 +00:00
Eitan Adler
0af1b47258 s/ is is / is /g
s/ a a / a /g

Approved by:	cperciva
MFC after:	3 days
2012-09-14 22:00:03 +00:00
Kenneth D. Merry
c3fb2891f0 Fix a bug which causes a panic in daopen(). The panic is caused by
a da(4) instance going away while GEOM is still probing it.

In this case, the GEOM disk class instance has been created by
disk_create(), and the taste of the disk is queued in the GEOM
event queue.

While that event is queued, the da(4) instance goes away.  When the
open call comes into the da(4) driver, it dereferences the freed
(but non-NULL) peripheral pointer provided by GEOM, which results
in a panic.

The solution is to add a callback to the GEOM disk code that is
called when all of its resources are cleaned up.  This is
implemented inside GEOM by adding an optional callback that is
called when all consumers have detached from a provider, and the
provider is about to be deleted.

scsi_cd.c,
scsi_da.c:	In the register routine for the cd(4) and da(4)
		routines, acquire a reference to the CAM peripheral
		instance just before we call disk_create().

		Use the new GEOM disk d_gone() callback to register
		a callback (dadiskgonecb()/cddiskgonecb()) that
		decrements the peripheral reference count once GEOM
		has finished cleaning up its resources.

		In the cd(4) driver, clean up open and close
		behavior slightly.  GEOM makes sure we only get one
		open() and one close call, so there is no need to
		set an open flag and decrement the reference count
		if we are not the first open.

		In the cd(4) driver, use cam_periph_release_locked()
		in a couple of error scenarios to avoid extra mutex
		calls.

geom.h:		Add a new, optional, providergone callback that
		is called when a provider is about to be deleted.

geom_disk.h:	Add a new d_gone() callback to the GEOM disk
		interface.

		Bump the DISK_VERSION to version 2.  This probably
		should have been done after a couple of previous
		changes, especially the addition of the d_getattr()
		callback.

geom_disk.c:	Add a providergone callback for the disk class,
		g_disk_providergone(), that calls the user's
		d_gone() callback if it exists.

		Bump the DISK_VERSION to 2.

geom_subr.c:	In g_destroy_provider(), call the providergone
		callback if it has been provided.

		In g_new_geomf(), propagate the class's
		providergone callback to the new geom instance.

blkfront.c:	Callers of disk_create() are supposed to pass in
		DISK_VERSION, not an explicit disk API version
		number.  Update the blkfront driver to do that.

disk.9:		Update the disk(9) man page to include information
		on the new d_gone() callback, as well as the
		previously added d_getattr() callback, d_descr
		field, and HBA PCI ID fields.

MFC after:	5 days
2012-06-24 04:29:03 +00:00
Fabien Thomas
8f4f27ffd2 Allow booting XENHVM kernel without Xen hypervisor.
MFC after:	3 days
2012-06-20 15:45:50 +00:00
Sergey Kandaurov
e84459d04b Free ballooned pages with the corresponding malloc type.
MFC after:	1 week
2012-04-06 08:13:29 +00:00
Justin T. Gibbs
0d17232400 Correct failure to attach the PV block front device on Citrix
XenServer configurations that advertise the multi-page ring extension,
but only allow a single page of ring space.

sys/dev/xen/blkfront/blkfront.c:
	If only one page of ring space is being used, do not publish
	in the XenStore the number of pages in use (1), via either
	of the supported multi-page ring extension schemes.

	Single page operation is the same with or without the
	ring-page extension being negotiated.   Relying on the
	legacy behavior avoids an incompatible difference in how
	the two ring-page extension schemes that are out in the
	wild, deal with the base case of a single page.  The
	Amazon/Red Hat drivers use the same XenStore variable as
	if the extension was not negotiated.  The Citrix drivers
	assume the new ring reference XenStore variables will be
	available

Reported by:	Oliver Schonefeld <schonefeld@ids-mannheim.de>
MFC after:	3 days
2012-03-25 14:20:43 +00:00
Scott Long
6ac6f295b0 Final pass at having devices use their bus parent for dma tags. The
remaining drivers that haven't been converted have various problems or
complexities that will be dealt with later.  This list includes:

hptrr, hptmv, hpt27xx - device aggregation across multiple parents
drm - want to talk to the maintainer first
tsec, sec - Openfirmware devices, not sure if changes are warranted
fatm - Done except for unused testing code
usb - want to talk to the maintainer first
ce, cp, ctau, cx - Significant driver changes needed to convey parent info

There are also devices tucked into architecture subtrees that I'll leave
for the respective maintainers to deal with.
2012-03-12 19:29:35 +00:00
Justin T. Gibbs
45cbfcdabc Fix regression in the handling of blkback close events for
devices that are unplugged via QEMU.

sys/dev/xen/blkback/blkback.c:
	Toolstack initiated closures change the frontend's state
	to Closing.  The backend must change to Closing as well,
	even if we can't actually close yet, in order for the
	frontend to notice and start the closing process.

MFC after:	3 days
2012-02-17 22:33:46 +00:00
Justin T. Gibbs
443cc4d407 Fix a bug in the calculation of the maximum I/O request size.
The previous code did not limit the I/O request size based on
the maximum number of segments supported by the back-end.  In
current practice, since the only back-end supporting chained
requests is the FreeBSD implementation, this limit was never
exceeded.

sys/dev/xen/blkfront/block.h:
	Add two macros, XBF_SEGS_TO_SIZE() and XBF_SIZE_TO_SEGS(),
	to centralize the logic of reserving a segment to deal with
	non-page-aligned I/Os.

sys/dev/xen/blkfront/blkfront.c:
	o When negotiating transfer parameters, limit the
	  max_request_size we use and publish, if it is greater
	  than the maximum, unaligned, I/O we can support with
	  the number of segments advertised by the backend.
	o Don't unilaterally reduce the I/O size published to
	  the disk layer by a single page.  max_request_size
	  is already properly limited in the transfer parameter
	  negotiation code.
	o Fix typos in printf strings:
		"max_requests_segments" -> "max_request_segments"
		"specificed" -> "specified"

MFC after:	1 day
2012-02-16 21:58:47 +00:00
Justin T. Gibbs
e6fe91b5e4 Fix typo in a printf string: "specificed" -> "specified".
MFC after:	1 day
2012-02-16 21:49:28 +00:00
Justin T. Gibbs
8b8bfa3567 Enhance documentation, improve interoperability, and fix defects in
FreeBSD's front and back Xen blkif interface drivers.

sys/dev/xen/blkfront/block.h:
sys/dev/xen/blkfront/blkfront.c:
sys/dev/xen/blkback/blkback.c:
	Replace FreeBSD specific multi-page ring impelementation with
	support for both the Citrix and Amazon/RedHat versions of this
	extension.

sys/dev/xen/blkfront/blkfront.c:
	o Add a per-instance sysctl tree that exposes all negotiated
	  transport parameters (ring pages, max number of requests,
	  max request size, max number of segments).
	o In blkfront_vdevice_to_unit() add a missing return statement
	  so that we properly identify the unit number for high numbered
	  xvd devices.

sys/dev/xen/blkback/blkback.c:
	o Add static dtrace probes for several events in this driver.
	o Defer connection shutdown processing until the front-end
	  enters the closed state.  This avoids prematurely tearing
	  down the connection when buggy front-ends transition to the
	  closing state, even though the device is open and they
	  veto the close request from the tool stack.
	o Add nodes for maximum request size and the number of active
	  ring pages to the exising, per-instance, sysctl tree.
	o Miscelaneous style cleanup.

sys/xen/interface/io/blkif.h:
	o Add extensive documentation of the XenStore nodes used to
	  implement the blkif interface.
	o Document the startup sequence between a front and back driver.
	o Add structures and documenatation for the "discard" feature
	  (AKA Trim).
	o Cleanup some definitions related to FreeBSD's request
	  number/size/segment-limit extension.

sys/dev/xen/blkfront/blkfront.c:
sys/dev/xen/blkback/blkback.c:
sys/xen/xenbus/xenbusvar.h:
	Add the convenience function xenbus_get_otherend_state() and
	use it to simplify some logic in both block-front and block-back.

MFC after:	1 day
2012-02-15 06:45:49 +00:00
Kenneth D. Merry
048a50f354 Fix the netback driver build for i386.
netback.c:	Add missing VM includes.

xen/xenvar.h,
xen/xenpmap.h:	Move some XENHVM macros from <machine/xen/xenpmap.h> to
		<machine/xen/xenvar.h> on i386 to match the amd64 headers.

conf/files:	Add netback to the build.

Submitted by:	jhb
MFC after:	3 days
2012-02-02 17:54:35 +00:00
Kenneth D. Merry
7e949c467c Xen netback driver rewrite.
share/man/man4/Makefile,
share/man/man4/xnb.4,
sys/dev/xen/netback/netback.c,
sys/dev/xen/netback/netback_unit_tests.c:

	Rewrote the netback driver for xen to attach properly via newbus
	and work properly in both HVM and PVM mode (only HVM is tested).
	Works with the in-tree FreeBSD netfront driver or the Windows
	netfront driver from SuSE.  Has not been extensively tested with
	a Linux netfront driver.  Does not implement LRO, TSO, or
	polling.  Includes unit tests that may be run through sysctl
	after compiling with XNB_DEBUG defined.

sys/dev/xen/blkback/blkback.c,
sys/xen/interface/io/netif.h:

	Comment elaboration.

sys/kern/uipc_mbuf.c:

	Fix page fault in kernel mode when calling m_print() on a
	null mbuf.  Since m_print() is only used for debugging, there
	are no performance concerns for extra error checking code.

sys/kern/subr_scanf.c:

	Add the "hh" and "ll" width specifiers from C99 to scanf().
	A few callers were already using "ll" even though scanf()
	was handling it as "l".

Submitted by:	Alan Somers <alans@spectralogic.com>
Submitted by:	John Suykerbuyk <johns@spectralogic.com>
Sponsored by:	Spectra Logic
MFC after:	1 week
Reviewed by:	ken
2012-01-26 16:35:09 +00:00
Colin Percival
206d503b92 Make XENHVM work on i386. The __ffs() function counts bits starting from
zero, unlike ffs(3), which starts counting from 1.
2012-01-16 02:38:45 +00:00
Kevin Lo
5bbe0c5357 ether_ifattach() sets if_mtu to ETHERMTU, don't bother set it again
Reviewed by:	yongari
2012-01-07 09:41:57 +00:00
Andriy Gapon
9976156f12 kern cons: introduce infrastructure for console grabbing by kernel
At the moment grab and ungrab methods of all console drivers are no-ops.

Current intended meaning of the calls is that the kernel takes control of
console input.  In the future the semantics may be extended to mean that
the calling thread takes full ownership of the console (e.g. console
output from other threads could be suspended).

Inspired by:	bde
MFC after:	2 months
2011-12-17 15:08:43 +00:00
Ed Schouten
75da3c1a9b Replace inline static' by static inline'.
If I interpret the C standard correctly, the storage specifier should be
placed before the inline keyword. While at it, replace __inline by
inline in the files affected.
2011-12-13 14:06:01 +00:00
Marius Strobl
4b7ec27007 - There's no need to overwrite the default device method with the default
one. Interestingly, these are actually the default for quite some time
  (bus_generic_driver_added(9) since r52045 and bus_generic_print_child(9)
  since r52045) but even recently added device drivers do this unnecessarily.
  Discussed with: jhb, marcel
- While at it, use DEVMETHOD_END.
  Discussed with: jhb
- Also while at it, use __FBSDID.
2011-11-22 21:28:20 +00:00
Ed Schouten
6472ac3d8a Mark all SYSCTL_NODEs static that have no corresponding SYSCTL_DECLs.
The SYSCTL_NODE macro defines a list that stores all child-elements of
that node. If there's no SYSCTL_DECL macro anywhere else, there's no
reason why it shouldn't be static.
2011-11-07 15:43:11 +00:00
Ed Schouten
d745c852be Mark MALLOC_DEFINEs static that have no corresponding MALLOC_DECLAREs.
This means that their use is restricted to a single C file.
2011-11-07 06:44:47 +00:00
Alan Cox
703dec68bf Eliminate vestiges of page coloring in VM_ALLOC_NOOBJ calls to
vm_page_alloc().  While I'm here, for the sake of consistency, always
specify the allocation class, such as VM_ALLOC_NORMAL, as the first of
the flags.
2011-10-27 16:39:17 +00:00
Justin T. Gibbs
578e4bf777 Update netfront so that it queries and honors published
back-end features.

sys/dev/xen/netfront/netfront.c:
	o Add xn_query_features() which reads the XenStore and
	  records the TSO, LRO, and chained ring-request support
	  of the backend.
	o Rename xn_configure_lro() to xn_configure_features() and
	  use this routine to manage the setup of TSO, LRO, and
	  checksum offload.
	o In create_netdev(), initialize if_capabilities and
	  if_hwassist to the capabilities found on all backends.
	  Delegate configuration of if_capenable and the TSO flag
	  if if_hwassist to xn_configure_features().

Reported by:	Hugo Silva (fix inspired by patch provided)
Approved by:	re
MFC after:	1 week
2011-09-21 00:15:29 +00:00
Justin T. Gibbs
ffa06904b5 Modify the netfront driver so it can successfully attach to
PV devices with the ioemu attribute set.

sys/dev/xen/netfront/netfront.c:
	o If a mac address for the interface cannot be found
	  in the front-side XenStore tree, look for an entry
	  in the back-side tree.  With ioemu devices, the
	  emulator does not populate the front side tree and
	  neither does Xend.
	o Return an error rather than panic when an attach
	  attempt fails.

Reported by:	Janne Snabb (fix inspired by patch provided)
PR:		kern/154302
Approved by:	re
2011-09-21 00:13:04 +00:00
Justin T. Gibbs
cf9c09e1f3 Correct suspend/resume support in the Netfront driver.
Sponsored by: BQ Internet

sys/dev/xen/netfront/netfront.c:
	o Implement netfront_suspend(), a specialized suspend
	  handler for the netfront driver.  This routine simply
	  disables the carrier so the driver is idle during
	  system suspend processing.
	o Fix a leak when re-initializing LRO during a link reset.
	o In netif_release_tx_bufs(), when cleaning up the grant
	  references for our TX ring, use gnttab_end_foreign_access_ref
	  instead of attempting to grant the page again.
	o In netif_release_tx_bufs(), we do not track mbufs associated
	  with mbuf chains, but instead just free each mbuf directly.
	  Use m_free(), not m_freem(), to avoid double frees of mbufs.
	o Refactor some code to enhance clarity.

Approved by:	re
MFC after:	1 week
2011-09-21 00:08:25 +00:00
Justin T. Gibbs
06a630f65d Add suspend/resume support to the Xen blkfront driver.
Sponsored by: BQ Internet

sys/dev/xen/blkfront/block.h:
sys/dev/xen/blkfront/blkfront.c:
	Remove now unused blkif_vdev_t from the blkfront soft.

sys/dev/xen/blkfront/blkfront.c:
	o In blkfront_suspend(), indicate the desire to suspend
	  by changing the softc connected state to SUSPENDED, and
	  then wait for any I/O pending on the remote peer to
	  drain.  Cancel suspend processing if I/O does not
	  drain within 30 seconds.
	o Enable and update blkfront_resume().  Since I/O is
	  drained prior to the suspension of the VM, the complicated
	  recovery process performed by other Xen blkfront
	  implementations is avoided.  We simply tear down the
	  connection to our old peer, and then re-connect.
	o In blkif_initialize(), fix a resource leak and botched
	  return if we cannot allocate shadow memory for our
	  requests.
	o In blkfront_backend_changed(), correct our response to
	  the XenbusStateInitialised state.  This state indicates
	  that our backend peer has published sufficient data for
	  blkfront to publish ring information and other XenStore
	  data, not that a connection can occur.  Blkfront now
	  will only perform connection processing in response to
	  the XenbusStateConnected state.  This corrects an issue
	  where blkfront connected before the backend was ready
	  during resume processing.

Approved by:	re
MFC after:	1 week
2011-09-21 00:02:44 +00:00
Justin T. Gibbs
2ca7463bc7 Properly handle suspend/resume events in the Xen device
framework.

Sponsored by:	BQ Internet

sys/xen/xenbus/xenbusb.c:
	o In xenbusb_resume(), publish the state transition of the
	  resuming device into XenbusStateIntiailising so that the
	  remote peer can see it.  Recording the state locally is
	  not sufficient to trigger a re-connect sequence.
	o In xenbusb_resume(), defer new-bus resume processing until
	  after the remote peer's XenStore address has been updated.
	  The drivers may need to refer to this information during
	  resume processing.

sys/xen/xenbus/xenbusb_back.c:
sys/xen/xenbus/xenbusb_front.c:
	Register xenbusb_resume() rather than bus_generic_resume()
	as the handler for device_resume events.

sys/xen/xenstore/xenstore.c:
	o Fix grammer in a comment.
	o In xs_suspend(), pass suspend events on to the child
	  devices (e.g. xenbusb_front/back, that are attached
	  to the XenStore.

Approved by:	re
MFC after:	1 week
2011-09-20 23:44:34 +00:00
Robert Watson
e53e8455f0 Add support for alternative break-to-debugger support on the Xen console.
This should help debug boot-time hangs experienced in 9.0-BETA.

MFC after:	3 weeks
Tested by:	sbruno
Approved by:	re (kib)
2011-09-02 17:36:01 +00:00
Attilio Rao
49f5aeaf41 MFC 2011-06-15 07:20:22 +00:00
Justin T. Gibbs
8a8a3387fd Several enhancements to the Xen block back driver.
sys/dev/xen/blkback/blkback.c:
	o Implement front-end request coalescing.  This greatly improves the
	  performance of front-end clients that are unaware of the dynamic
	  request-size/number of requests negotiation available in the
	  FreeBSD backend driver.  This required a large restructuring
	  in how this driver records in-flight transactions and how those
	  transactions are mapped into kernel KVA.  For example, the driver
	  now includes a mini "KVA manager" that allocates ranges of
	  contiguous KVA to patches of requests that are physically
	  contiguous in the backing store so that a single bio or UIO
	  segment can be used to represent the I/O.

	o Refuse to open any backend files or devices if the system
	  has yet to mount root.  This avoids a panic.

	o Properly handle "onlined" devices.  An "onlined" backend
	  device stays attached to its backing store across front-end
	  disconnections.  This feature is intended to reduce latency
	  when a front-end does a hand-off to another driver (e.g.
	  PV aware bootloader to OS kernel) or during a VM reboot.

	o Harden the driver against a pathological/buggy front-end
	  by carefully vetting front-end XenStore data such as the
	  front-end state.

	o Add sysctls that report the negotiated number of
	  segments per-request and the number of requests that
	  can be concurrently in flight.

Submitted by:	kdm
Reviewed by:	gibbs
Sponsored by:	Spectra Logic Corporation
MFC after:	1 week
2011-06-13 20:36:29 +00:00
Attilio Rao
a38f1f263b Remove pc_cpumask and pc_other_cpus usage from MI code.
Tested by:	pluknet
2011-06-13 13:28:31 +00:00
Justin T. Gibbs
283d6f7287 Monitor and emit events for XenStore changes to XenBus trees
of the devices we manage.  These changes can be due to writes
we make ourselves or due to changes made by the control domain.
The goal of these changes is to insure that all state transitions
can be detected regardless of their source and to allow common
device policies (e.g. "onlined" backend devices) to be centralized
in the XenBus bus code.

sys/xen/xenbus/xenbusvar.h:
sys/xen/xenbus/xenbus.c:
sys/xen/xenbus/xenbus_if.m:
	Add a new method for XenBus drivers "localend_changed".
	This method is invoked whenever a write is detected to
	a device's XenBus tree.  The default implementation of
	this method is a no-op.

sys/xen/xenbus/xenbus_if.m:
sys/dev/xen/netfront/netfront.c:
sys/dev/xen/blkfront/blkfront.c:
sys/dev/xen/blkback/blkback.c:
	Change the signature of the "otherend_changed" method.
	This notification cannot fail, so it should return void.

sys/xen/xenbus/xenbusb_back.c:
	Add "online" device handling to the XenBus Back Bus
	support code.  An online backend device remains active
	after a front-end detaches as a reconnect is expected
	to occur in the near future.

sys/xen/interface/io/xenbus.h:
	Add comment block further explaining the meaning and
	driver responsibilities associated with the XenBus
	Closed state.

sys/xen/xenbus/xenbusb.c:
sys/xen/xenbus/xenbusb.h:
sys/xen/xenbus/xenbusb_back.c:
sys/xen/xenbus/xenbusb_front.c:
sys/xen/xenbus/xenbusb_if.m:
	o Register a XenStore watch against the local XenBus tree
	  for all devices.
	o Cache the string length of the path to our local tree.
	o Allow the xenbus front and back drivers to hook/filter both
	  local and otherend watch processing.
	o Update the device ivar version of "state" when we detect
	  a XenStore update of that node.

sys/dev/xen/control/control.c:
sys/xen/xenbus/xenbus.c:
sys/xen/xenbus/xenbusb.c:
sys/xen/xenbus/xenbusb.h:
sys/xen/xenbus/xenbusvar.h:
sys/xen/xenstore/xenstorevar.h:
	Allow clients of the XenStore watch mechanism to attach
	a single uintptr_t worth of client data to the watch.
	This removes the need to carefully place client watch
	data within enclosing objects so that a cast or offsetof
	calculation can be used to convert from watch to enclosing
	object.

Sponsored by:	Spectra Logic Corporation
MFC after:	1 week
2011-06-11 04:59:01 +00:00
Attilio Rao
739e31f6d7 MFC 2011-05-13 15:20:57 +00:00
Alexander Motin
c4f9a10590 Fix msleep() usage in Xen balloon driver to not wake up on every HZ tick. 2011-05-13 03:40:16 +00:00
Attilio Rao
71a19bdc64 Commit the support for removing cpumask_t and replacing it directly with
cpuset_t objects.
That is going to offer the underlying support for a simple bump of
MAXCPU and then support for number of cpus > 32 (as it is today).

Right now, cpumask_t is an int, 32 bits on all our supported architecture.
cpumask_t on the other side is implemented as an array of longs, and
easilly extendible by definition.

The architectures touched by this commit are the following:
- amd64
- i386
- pc98
- arm
- ia64
- XEN

while the others are still missing.
Userland is believed to be fully converted with the changes contained
here.

Some technical notes:
- This commit may be considered an ABI nop for all the architectures
  different from amd64 and ia64 (and sparc64 in the future)
- per-cpu members, which are now converted to cpuset_t, needs to be
  accessed avoiding migration, because the size of cpuset_t should be
  considered unknown
- size of cpuset_t objects is different from kernel and userland (this is
  primirally done in order to leave some more space in userland to cope
  with KBI extensions). If you need to access kernel cpuset_t from the
  userland please refer to example in this patch on how to do that
  correctly (kgdb may be a good source, for example).
- Support for other architectures is going to be added soon
- Only MAXCPU for amd64 is bumped now

The patch has been tested by sbruno and Nicholas Esborn on opteron
4 x 12 pack CPUs. More testing on big SMP is expected to came soon.
pluknet tested the patch with his 8-ways on both amd64 and i386.

Tested by:	pluknet, sbruno, gianni, Nicholas Esborn
Reviewed by:	jeff, jhb, sbruno
2011-05-05 14:39:14 +00:00
Bjoern A. Zeeb
a0ae8f04e8 Make various (pseudo) interfaces compile without INET in the kernel
adding appropriate #ifdefs.  For module builds the framework needs
adjustments for at least carp.

Reviewed by:	gnn
Sponsored by:	The FreeBSD Foundation
Sponsored by:	iXsystems
MFC after:	4 days
2011-04-27 19:30:44 +00:00
Justin T. Gibbs
8577146eac Fix bug in the netfront driver that caused excessive packet drops during
receive processing.

Remove unnecessary restrictions on the mbuf chain length built during an
LRO receive.  This restriction was copied from the Linux netfront driver
where the LRO implementation cannot handle more than 18 discontinuities.
The FreeBSD implementation has no such restriction.

MFC after: 1 week
2011-01-29 02:36:45 +00:00
Matthew D Fleming
f4f04709ac Fix a few more SYSCTL_PROC() that were missing a CTLFLAG type specifier. 2011-01-19 00:57:58 +00:00
Robert Watson
2913e88c91 Make "options XENHVM" compile for i386, not just amd64 -- a largely
mechanical change.  This opens the door for using PV device drivers
under Xen HVM on i386, as well as more general harmonisation of i386
and amd64 Xen support in FreeBSD.

Reviewed by:    cperciva
MFC after:      3 weeks
2011-01-04 14:49:54 +00:00