[ofw][patch][MLX4] added events for Registry handling error flow
Leonid Keller
leonid at mellanox.co.il
Tue Nov 17 06:40:07 PST 2009
Applied in 2584.
________________________________
From: ofw-bounces at lists.openfabrics.org
[mailto:ofw-bounces at lists.openfabrics.org] On Behalf Of Leonid Keller
Sent: Monday, November 16, 2009 10:46 AM
To: ofw_list
Subject: [ofw][patch][MLX4] added events for Registry handling
error flow
Index: V:/svn/winib/trunk/hw/mlx4/kernel/bus/core/ev_log.mc
===================================================================
--- V:/svn/winib/trunk/hw/mlx4/kernel/bus/core/ev_log.mc
(revision 5057)
+++ V:/svn/winib/trunk/hw/mlx4/kernel/bus/core/ev_log.mc
(revision 5058)
@@ -75,7 +75,10 @@
HW revision %t%6%n
FW version %t%7.%8.%9%n
HCA guid %t%10%11%n
- HCA location %t'%12'
+ HCA location %t'%12'%n
+ port number %t%13%n
+ port1 type %t%14%n
+ port2 type %t%15.
.
MessageId=0x0007 Facility=MLX4 Severity=Error
SymbolicName=EVENT_MLX4_ERROR_MAP_FA
@@ -142,5 +145,14 @@
HCA restart finished. Notifying the clients ...
.
+MessageId=0x0010 Facility=MLX4 Severity=Warning
SymbolicName=EVENT_MLX4_WARN_REG_ACTION
+Language=English
+%2 failed on %3 with status %4.
+.
+MessageId=0x0011 Facility=MLX4 Severity=Warning
SymbolicName=EVENT_MLX4_WARN_REG_OPEN_DEV_KEY
+Language=English
+WdfDeviceOpenRegistryKey failed on opening SW (=driver) key for
mlx4_bus with status %2.
+.
+
Index: V:/svn/winib/trunk/hw/mlx4/kernel/bus/drv/drv.c
===================================================================
--- V:/svn/winib/trunk/hw/mlx4/kernel/bus/drv/drv.c (revision
5057)
+++ V:/svn/winib/trunk/hw/mlx4/kernel/bus/drv/drv.c (revision
5058)
@@ -275,7 +275,7 @@
return status;
}
-BOOLEAN __read_setup_params(PUNICODE_STRING puvalue)
+BOOLEAN __read_setup_params(struct pci_dev *pdev,
PUNICODE_STRING puvalue)
{
NTSTATUS status;
WDFKEY hParamsKey = NULL;
@@ -287,6 +287,8 @@
{
MLX4_PRINT( TRACE_LEVEL_WARNING ,MLX4_DBG_DEV ,
("WdfRegistryOpenKey(\\Registry\\Machine\\SOFTWARE\\Mellanox) Failed
status = 0x%x\n", status));
+ WriteEventLogEntryData( pdev->p_self_do,
(ULONG)EVENT_MLX4_WARN_REG_ACTION, 0, 0, 3,
+ L"%s", L"WdfRegistryOpenKey", L"%s", KeyName.Buffer, L"%#x",
status );
return FALSE;
}
@@ -295,6 +297,8 @@
{
MLX4_PRINT( TRACE_LEVEL_ERROR ,MLX4_DBG_DEV ,
("WdfRegistryQueryUnicodeString(PortType) Failed status =
0x%x\n", status));
+ WriteEventLogEntryData( pdev->p_self_do,
(ULONG)EVENT_MLX4_WARN_REG_ACTION, 0, 0, 3,
+ L"%s", L"WdfRegistryQueryUnicodeString", L"%s",
PortType.Buffer, L"%#x", status );
WdfRegistryClose(hParamsKey);
return FALSE;
}
@@ -310,6 +314,8 @@
WDFKEY hKey = NULL;
WDFKEY hParamsKey = NULL;
BOOLEAN bRet = FALSE;
+ PFDO_DEVICE_DATA p_fdo = FdoGetData(Device);
+ struct pci_dev *pdev = &p_fdo->pci_dev;
DECLARE_CONST_UNICODE_STRING(Parameters, L"Parameters");
DECLARE_CONST_UNICODE_STRING(PortType, L"PortType");
@@ -329,21 +335,27 @@
if( !NT_SUCCESS( status ) ) {
MLX4_PRINT( TRACE_LEVEL_ERROR ,MLX4_DBG_DEV ,
("WdfDeviceOpenRegistryKey(\\Registry\\Machine\\Control\\Class\\...)
Failed status = 0x%x\n", status));
+ WriteEventLogEntryData( pdev->p_self_do,
(ULONG)EVENT_MLX4_WARN_REG_OPEN_DEV_KEY, 0, 0, 1,
+ L"%#x", status );
goto err;
}
status = WdfRegistryOpenKey(hKey, &Parameters,
STANDARD_RIGHTS_ALL, WDF_NO_OBJECT_ATTRIBUTES, &hParamsKey);
if( !NT_SUCCESS( status ) ) {
MLX4_PRINT( TRACE_LEVEL_ERROR ,MLX4_DBG_DEV
,("WdfRegistryOpenKey(Prameters) Failed status = 0x%x\n", status));
+ WriteEventLogEntryData( pdev->p_self_do,
(ULONG)EVENT_MLX4_WARN_REG_ACTION, 0, 0, 3,
+ L"%s", L"WdfRegistryOpenKey", L"%s", Parameters.Buffer,
L"%#x", status );
goto err;
}
- bRet = __read_setup_params(&uvalue);
+ bRet = __read_setup_params(pdev, &uvalue);
if (bRet == TRUE)
{
status = WdfRegistryAssignValue(hParamsKey, &PortType,
REG_SZ,uvalue.Length,uvalue.Buffer);
if( !NT_SUCCESS( status ) ) {
MLX4_PRINT( TRACE_LEVEL_ERROR ,MLX4_DBG_DEV
,("WdfRegistryAssignValue(PortType) Failed status = 0x%x\n", status));
+ WriteEventLogEntryData( pdev->p_self_do,
(ULONG)EVENT_MLX4_WARN_REG_ACTION, 0, 0, 3,
+ L"%s", L"WdfRegistryAssignValue", L"%s", PortType.Buffer,
L"%#x", status );
goto err;
}
uvalue.Length = 0;
@@ -368,6 +380,10 @@
dev_params->mod_port_type[1] = MLX4_PORT_TYPE_ETH;
}
}
+ else {
+ WriteEventLogEntryData( pdev->p_self_do,
(ULONG)EVENT_MLX4_WARN_REG_ACTION, 0, 0, 3,
+ L"%s", L"WdfRegistryQueryUnicodeString", L"%s",
PortType.Buffer, L"%#x", status );
+ }
err:
if (hKey != NULL)
@@ -523,7 +539,7 @@
memset ( &props, 0, sizeof( props) );
p_ibdev = pdev->ib_dev;
(p_ibdev->query_device)( p_ibdev, &props );
- WriteEventLogEntryData( pdev->p_self_do,
(ULONG)EVENT_MLX4_INFO_DEV_STARTED, 0, 0, 11,
+ WriteEventLogEntryData( pdev->p_self_do,
(ULONG)EVENT_MLX4_INFO_DEV_STARTED, 0, 0, 14,
L"%04x", (ULONG)pdev->ven_id,
L"%04x", (ULONG)pdev->dev_id,
L"%04x", (ULONG)pdev->sub_vendor_id,
@@ -534,7 +550,10 @@
L"%d", (int) (mdev->caps.fw_ver & 0xffff),
L"%08x", *(PULONG)((PUCHAR)&p_ibdev->node_guid + 0),
L"%08x", *(PULONG)((PUCHAR)&p_ibdev->node_guid + 4),
- L"%s", pdev->location
+ L"%s", pdev->location,
+ L"%d", mdev->caps.num_ports,
+ L"%s", mdev->caps.port_type[1] == MLX4_PORT_TYPE_IB ? L"IB"
: L"ETH",
+ L"%s", mdev->caps.port_type[2] == MLX4_PORT_TYPE_IB ? L"IB"
: L"ETH"
);
}
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openfabrics.org/pipermail/ofw/attachments/20091117/71acbddb/attachment.html>
More information about the ofw
mailing list