|
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [win-pv-devel] [PATCH xenvif 2/2] Allow advertised 'wire' speed to be overridden by a registry value...
...and change the default to 100G.
This patch adds code to check for a new 'MacSpeed' XENVIF parameter
(sampled at initialization time), defaulting to a wire speed of 100G if
it is not present (rather than the 1G default prior to this patch).
Signed-off-by: Paul Durrant <paul.durrant@xxxxxxxxxx>
---
src/xenvif/mac.c | 20 +++++++++++++++++++-
1 file changed, 19 insertions(+), 1 deletion(-)
diff --git a/src/xenvif/mac.c b/src/xenvif/mac.c
index 06a9a18..0b17a54 100644
--- a/src/xenvif/mac.c
+++ b/src/xenvif/mac.c
@@ -35,6 +35,7 @@
#include <ethernet.h>
#include "pdo.h"
+#include "registry.h"
#include "frontend.h"
#include "mac.h"
#include "thread.h"
@@ -52,6 +53,7 @@ struct _XENVIF_MAC {
EX_SPIN_LOCK Lock;
BOOLEAN Connected;
BOOLEAN Enabled;
+ ULONG Speed;
ULONG MaximumFrameSize;
ETHERNET_ADDRESS PermanentAddress;
ETHERNET_ADDRESS CurrentAddress;
@@ -207,6 +209,8 @@ MacInitialize(
OUT PXENVIF_MAC *Mac
)
{
+ HANDLE ParametersKey;
+ ULONG MacSpeed;
NTSTATUS status;
*Mac = __MacAllocate(sizeof (XENVIF_MAC));
@@ -215,6 +219,18 @@ MacInitialize(
if (*Mac == NULL)
goto fail1;
+ ParametersKey = DriverGetParametersKey();
+
+ (*Mac)->Speed = 100;
+
+ if (ParametersKey != NULL) {
+ status = RegistryQueryDwordValue(ParametersKey,
+ "MacSpeed",
+ &MacSpeed);
+ if (NT_SUCCESS(status))
+ (*Mac)->Speed = MacSpeed;
+ }
+
InitializeListHead(&(*Mac)->MulticastList);
FdoGetDebugInterface(PdoGetFdo(FrontendGetPdo(Frontend)),
@@ -667,6 +683,8 @@ MacTeardown(
Mac->Lock = 0;
+ Mac->Speed = 0;
+
ASSERT(IsZeroMemory(Mac, sizeof (XENVIF_MAC)));
__MacFree(Mac);
}
@@ -691,7 +709,7 @@ __MacGetSpeed(
"speed",
&Buffer);
if (!NT_SUCCESS(status)) {
- Speed = 1;
+ Speed = Mac->Speed;
Unit = "G";
} else {
Speed = _strtoui64(Buffer, &Unit, 10);
--
2.5.3
_______________________________________________
win-pv-devel mailing list
win-pv-devel@xxxxxxxxxxxxxxxxxxxx
https://lists.xenproject.org/mailman/listinfo/win-pv-devel
|
![]() |
Lists.xenproject.org is hosted with RackSpace, monitoring our |