Paul Durrant [Fri, 27 Feb 2015 17:47:04 +0000 (17:47 +0000)]
Release lower bus interface before passing removal IRP to PDO
If the PDO is surprised removed then the FDO tries to retain its
reference to the PDO's bus interface byond its destruction. This will
cause an assertion failure in checked builds of XENBUS and may cause
memory corruption.
Signed-off-by: Paul Durrant <paul.durrant@citrix.com>
Paul Durrant [Mon, 26 Jan 2015 16:15:24 +0000 (16:15 +0000)]
Fix type mismatch
The size of PWCHAR and the size of ULONG are the same for 32-bit
installations so this bug only affects 64-bit installations, but the
symptom is a crash on PDO destruction due to a corrupted heap.
Signed-off-by: Paul Durrant <paul.durrant@citrix.com>
Owen Smith [Mon, 19 Jan 2015 16:23:39 +0000 (16:23 +0000)]
Use correct location when multi-queues are not used.
When the backend does not support multi-queues, or the frontend has
explicitly disallowed multi-queues, the frontend needs to write
event-channel and ring-references to the non-queued (old) locations,
not under device/vif/<id>/queue-<index>
Paul Durrant [Mon, 12 Jan 2015 17:35:43 +0000 (17:35 +0000)]
Reflect interface versions in PDO description
For convenience add a string containing the latest versions of all the
interfaces exported by the driver into the PDO description. This can be
seen in Device Manager as the 'Bus reported device description' detail.
Signed-off-by: Paul Durrant <paul.durrant@citrix.com>
Owen Smith [Thu, 18 Dec 2014 14:28:22 +0000 (14:28 +0000)]
Update to VIF Interface v2
Renames XENVIF_TRANSMITTER_PACKET to XENVIF_TRANSMITTER_PACKET_V1 and
adds XENVIF_TRANSMITTER_PACKET_V2 for future patches.
VIF v2 will be implemented in another patch.
Signed-off-by: Owen Smith <owen.smith@citrix.com> Signed-off-by: Paul Durrant <paul.durrant@citrix.com>
Owen Smith [Thu, 18 Dec 2014 14:28:21 +0000 (14:28 +0000)]
Remove notifier object
Fold event channels into transmitter/receiver ring objects.
Receiver ring object takes over single event channel case and passes
notifications to transmitter object, tagged with ring index (so that
only the specified ring is executed).
Split notifications are handled independently by each ring object.
Signed-off-by: Owen Smith <owen.smith@citrix.com> Signed-off-by: Paul Durrant <paul.durrant@citrix.com>
Owen Smith [Thu, 18 Dec 2014 14:28:18 +0000 (14:28 +0000)]
Make interface exposure explicit
Add pass-through query for XenBus's Cache interface and
account for interface versions when determining the revision(s).
Do not pass through any other queries, as the revision is not
accounted for.
Paul Durrant [Fri, 19 Dec 2014 11:59:05 +0000 (11:59 +0000)]
Squash buffer overlow error messages in transmit
Occasionally packets are too fragmented to fit into the maximum number of
requests allowed by the netif protocol. In this case the packet preparation
function will fail with STATUS_BUFFER_OVERFLOW and the alternative copy-
coalesce prepation function will be called. These error messages are
therefore un-interesting (since the number of packets directly granted vs.
those that were copied is available in the statistics dump initiated by the
debug VIRQ).
This patch squashes the error messages to avoid filling logs.
Signed-off-by: Paul Durrant <paul.durrant@citrix.com>
Paul Durrant [Fri, 7 Nov 2014 16:46:24 +0000 (16:46 +0000)]
Avoid incorrecly extending checksum accumulator
It was noticed that checksums were occasionally being incorrectly verified.
The reason for this turned out to be that the value passed to
ChecksumVerify as a USHORT was being extended to ULONG prior to being
inverted, thus leaving bits 16-31 set and thus an overflow from the lower
bits was not being correctly folded.
Signed-off-by: Ben Chalmers <ben.chalmers@citrix.com> Signed-off-by: Paul Durrant <paul.durrant@citrix.com>
Paul Durrant [Mon, 22 Sep 2014 11:02:44 +0000 (12:02 +0100)]
Cope with unexpected initial backend states
If the OS is booted via iSCSI, then the backend will already be in the
Connected state when the xenvif driver loads. The backend is stable
in this state, so __FrontendPrepare() eventually times out waiting for
the backend state to change.
Fix by leading the backend through the Closing and Closed states if we
find it initially in the Connected (or Closing) states.
Signed-off-by: Michael Brown <mbrown@fensystems.co.uk>
Forward ported.
Signed-off-by: Paul Durrant <paul.durrant@citrix.com>
Paul Durrant [Thu, 14 Aug 2014 10:34:22 +0000 (11:34 +0100)]
Update branding
Remove the use of the 'XenServer' product name except where it is
still appropriate.
Remove use of 'Citrix' from all places except source file
copyrights.
Allow company and product name to be set at build time.
Signed-off-by: Paul Durrant <paul.durrant@citrix.com>
Paul Durrant [Thu, 14 Aug 2014 10:12:36 +0000 (11:12 +0100)]
Implement new API version scheme
This patch changes the way APIs work in an incompatible way. (See README.md
for details).
The patch also includes a *lot* of code tidying and movement and as such
is not really suitable for review as a patch; the resulting code should
itself be reviewed.
Given the scale of the change, the major version number has been revised to
8 and other version numbers reset to zero.
Signed-off-by: Paul Durrant <paul.durrant@citrix.com>
Ben Chalmers [Thu, 31 Jul 2014 07:43:43 +0000 (08:43 +0100)]
Merge pull request #34 from pauldu/ca-140184
[CA-140184]
Revert previous commits that add use of XENBUS's CACHE interface to XENVIF (and then modify cache lifecycle to avoid a crash during hibernation).
The reversions undid a couple of other fixes which are re-applied by the third patch.
> Change Cache lifecycle to match ring lifecycle.
> Ensure caches are destroyed when device transitions to D3 to prevent
> assertion failure in xenbus.
>
> Signed-off-by: Owen Smith <owen.smith@citrix.com>
Signed-off-by: Paul Durrant <paul.durrant@citrix.com>
Paul Durrant [Wed, 28 May 2014 16:56:06 +0000 (17:56 +0100)]
Avoid duplicate entries in the IP address table
Duplicates are useless and actually cause problems overflowing xenstore's
quota. Also, we should not bother looking at the MIB address table unless
the frontend is CONNECTED or ENABLED since our NetLuid is not necessarily
valid unless we are in one of those states.
Signed-off-by: Paul Durrant <paul.durrant@citrix.com>
Paul Durrant [Thu, 24 Apr 2014 16:57:53 +0000 (17:57 +0100)]
Track eject request state in PDO
Tracking the state of the eject request in the frontend was sub-optimal
as:
a) The lifetime of the frontend is not quite the same as the PDO.
b) It was possible for the FDO scan to race with eject and make it
look like the device had just disappeared.
Signed-off-by: Paul Durrant <paul.durrant@citrix.com>
Paul Durrant [Mon, 14 Apr 2014 12:15:04 +0000 (13:15 +0100)]
Remove IP helper linkage (and hence dependency on netio.sys)
The linkage dependency on netio.sys prevents SDV from working. Since we need
the IP helper functionality there's no choice other than to remove the
linkage and replace it with run-time function lookup. Alas this is not as
simple as using MmGetSystemRoutineAddress() as that only works for kernel and
hal functions. We need to actually parse the netio.sys module export table
directly and then create thunks to jump into the code.
Signed-off-by: Paul Durrant <paul.durrant@citrix.com>
Paul Durrant [Fri, 31 Jan 2014 17:44:53 +0000 (17:44 +0000)]
Add a magic number to the frontend structure that can be checked
for in the mib callback. There's a suspicion that the callback may be
occuring after xenvif has unloaded.
Signed-off-by: Paul Durrant <paul.durrant@citrix.com>
Paul Durrant [Mon, 23 Dec 2013 15:46:32 +0000 (15:46 +0000)]
Alias is now a fully qualified hardware registry key
There is no need to try to find the device and instance from the alias
software key as it is trivial to parse it out of the hardware key. This
means less work here and more work in the xennet co-installer, which is
the right place for it.
Signed-off-by: Paul Durrant <paul.durrant@citrix.com>
Paul Durrant [Thu, 19 Dec 2013 16:11:00 +0000 (16:11 +0000)]
CA-122017: Bail from DumpAddressTable if we get an error
Also wrap the address table update in a transaction and
abort it if we bail. This should mean that, if we get an
EQUOTA, we abort the transaction and we go back to our
old pre-EQUOTA state.
Signed-off-by: Paul Durrant <paul.durrant@citrix.com>
Paul Durrant [Thu, 19 Dec 2013 10:06:22 +0000 (10:06 +0000)]
Add receiver watchdog that will move things along if the backend fails to
send receive events. Also tighten up the transmit watchdog - 30s seems a
bit too long.
Signed-off-by: Paul Durrant <paul.durrant@citrix.com>
Paul Durrant [Fri, 13 Dec 2013 09:32:05 +0000 (09:32 +0000)]
Useful code added while debugging WHQL issues:
- Tidied up receiver xenstore feature advertisement
- Added registry options to turn off GSO at the transmitter
- Added an 'always copy' option to the transmtter
- Added AH option parsing for IPv6
- Added code to drop oversize non-GSO packets at receiver
- Added some more error DbgPrints
- Added large packet stats to the receiver
Signed-off-by: Paul Durrant <paul.durrant@citrix.com>
Paul Durrant [Mon, 9 Dec 2013 17:03:03 +0000 (17:03 +0000)]
XOP-440 checksum corner cases.
Windows seems to take RFC 2460 a bit too far and replace zero TCP checksum
values with 0xFFFF. Thus we need to treat IPv6 TCP packets with an embedded
checksum of 0xFFFF as actually containing checksum 0.
I've also added code to allow IPv4 UDP packets with a checksum value of 0 to
be accepted, as this is the 'no checksum' option that only exists for IPv4
UDP. For IPv6 UDP we again translate 0xFFFF to 0 but insist on the checksum
matching after this translation.
When we calculate checksum for IPv6 UDP packets, I've also made sure we
insert 0xFFFF rather than 0 before passing the packet up the stack.
Signed-off-by: Paul Durrant <paul.durrant@citrix.com>
Paul Durrant [Mon, 25 Nov 2013 17:20:24 +0000 (17:20 +0000)]
Two small refinements:
- Add fragment flag to packet info and have the parser set it.
ASSERT on this in the transmit patch if the stack tries to offload
checksum for a fragment.
- Add registry values to allow actual IPv4 or IPv6 TSO to be disabled at
the backend.
Signed-off-by: Paul Durrant <paul.durrant@citrix.com>