[mlx4] Use t-first interrupts by default. (mlnx: 2836)
authortzachid <tzachid@ad392aa1-c5ef-ae45-8dd8-e69d62a5ef86>
Tue, 22 Jul 2008 06:30:21 +0000 (06:30 +0000)
committertzachid <tzachid@ad392aa1-c5ef-ae45-8dd8-e69d62a5ef86>
Tue, 22 Jul 2008 06:30:21 +0000 (06:30 +0000)
git-svn-id: svn://openib.tc.cornell.edu/gen1/trunk@1429 ad392aa1-c5ef-ae45-8dd8-e69d62a5ef86

hw/mlx4/kernel/bus/drv/drv.c
hw/mlx4/kernel/bus/drv/mlx4_bus.inf
hw/mlx4/kernel/bus/net/fw.c
hw/mlx4/kernel/bus/net/mlx4.h

index 456ef25..5e8c80c 100644 (file)
@@ -873,9 +873,6 @@ __read_registry(WDFDRIVER *hDriver)
        // "log maximum number of memory translation table segments per HCA"\r
        DECLARE_CONST_UNICODE_STRING(numMtt, L"LogNumMtt");     \r
 \r
-       // "Enable Quality of Service support in the HCA if > 0, (default 1)"\r
-       DECLARE_CONST_UNICODE_STRING(enableQoS, L"EnableQoS");  \r
-\r
        // "Maximum number of MACs per ETH port (1-127, default 1"\r
        DECLARE_CONST_UNICODE_STRING(numMac, L"NumMac");        \r
 \r
@@ -885,9 +882,15 @@ __read_registry(WDFDRIVER *hDriver)
        // "Enable steering by VLAN priority on ETH ports (0/1, default 0)"\r
        DECLARE_CONST_UNICODE_STRING(usePrio, L"UsePrio");      \r
 \r
+       // "Enable Quality of Service support in the HCA if > 0, (default 1)"\r
+       DECLARE_CONST_UNICODE_STRING(enableQoS, L"EnableQoS");  \r
+\r
        // "Block multicast loopback packets if > 0 (default 1)"\r
        DECLARE_CONST_UNICODE_STRING(BlockMcastLB, L"BlockMcastLoopBack");      \r
 \r
+       // "Measure the interrupt from the first packet (default 1)"\r
+       DECLARE_CONST_UNICODE_STRING(InterruptFromFirstPacket, L"InterruptFromFirstPacket");    \r
+\r
        // "Ports L2 type (ib/eth/auto, entry per port, comma seperated, default ib for all)"\r
        DECLARE_CONST_UNICODE_STRING(PortType, L"PortType");\r
 \r
@@ -944,12 +947,6 @@ __read_registry(WDFDRIVER *hDriver)
                if (NT_SUCCESS (status)) \r
                        g.mod_num_mtt = value;\r
 \r
-               status = WdfRegistryQueryULong(hKey, &enableQoS, &value);\r
-               if (NT_SUCCESS (status)) \r
-                       g.mod_enable_qos = value;\r
-               else\r
-                       g.mod_enable_qos = 1;\r
-\r
                status = WdfRegistryQueryULong(hKey, &numMac, &value);\r
                if (NT_SUCCESS (status)) \r
                        g.mod_num_mac = value;\r
@@ -968,12 +965,25 @@ __read_registry(WDFDRIVER *hDriver)
                else\r
                        g.mod_use_prio = 0;\r
 \r
+               status = WdfRegistryQueryULong(hKey, &enableQoS, &value);\r
+               if (NT_SUCCESS (status)) \r
+                       g.mod_enable_qos = value;\r
+               else\r
+                       g.mod_enable_qos = 1;\r
+\r
+\r
                status = WdfRegistryQueryULong(hKey, &BlockMcastLB, &value);\r
                if (NT_SUCCESS (status)) \r
                        g.mod_mlx4_blck_lb = value;\r
                else\r
                        g.mod_mlx4_blck_lb = 1;\r
 \r
+               status = WdfRegistryQueryULong(hKey, &InterruptFromFirstPacket, &value);\r
+               if (NT_SUCCESS (status)) \r
+                       g.mod_interrupt_from_first = value;\r
+               else\r
+                       g.mod_interrupt_from_first = 1;\r
+\r
                uvalue.Buffer = uvalue_data;\r
                uvalue.MaximumLength = MAX_UVALUE;\r
                uvalue.Length = 0;\r
index 1dd32ed..be5495d 100644 (file)
@@ -150,14 +150,15 @@ HKR,"Parameters","LogNumMcg",%REG_DWORD%,0x0000000D
 HKR,"Parameters","LogNumMpt",%REG_DWORD%,0x00000012\r
 HKR,"Parameters","LogNumMtt",%REG_DWORD%,0x00000014\r
 HKR,"Parameters","EnableQoS",%REG_DWORD%,0x00000001\r
+HKR,"Parameters","BlockMcastLoopBack",%REG_DWORD%,0x00000000\r
+HKR,"Parameters","InterruptFromFirstPacket",%REG_DWORD%,0x00000001\r
+\r
 HKR,"Parameters","NumMac",%REG_DWORD%,0x00000001\r
 HKR,"Parameters","NumVlan",%REG_DWORD%,0x00000000\r
 HKR,"Parameters","UsePrio",%REG_DWORD%,0x00000000\r
 HKR,"Parameters","PortType",%REG_SZ%,"ib,ib"\r
 \r
 \r
-HKR,"Parameters","BlockMcastLoopBack",%REG_DWORD%,0x00000000\r
-\r
 HKLM,"System\CurrentControlSet\Control\WMI\GlobalLogger\E51BB6E2-914A-4e21-93C0-192F4801BBFF","Flags",%REG_DWORD%,0xffff\r
 HKLM,"System\CurrentControlSet\Control\WMI\GlobalLogger\E51BB6E2-914A-4e21-93C0-192F4801BBFF","Level",%REG_DWORD%,0x3\r
 \r
index daad154..b18c9b7 100644 (file)
@@ -712,6 +712,12 @@ int mlx4_INIT_HCA(struct mlx4_dev *dev, struct mlx4_init_hca_param *param)
 #else
 #error Host endianness not defined
 #endif
+
+       if (g.mod_interrupt_from_first) {
+               // Bit 30,31 tell the moderation method, 0 default, 1 from first packet
+               *(inbox + INIT_HCA_FLAGS_OFFSET / 4) |= cpu_to_be32(1 << 30);
+       }
+
        /* Check port for UD address vector: */
        *(inbox + INIT_HCA_FLAGS_OFFSET / 4) |= cpu_to_be32(1);
 
index 76af035..9ece1bf 100644 (file)
@@ -88,7 +88,8 @@ typedef struct _GLOBALS {
        int mod_enable_qos;
        int mod_mlx4_blck_lb;
        enum mlx4_port_type mod_port_type[MLX4_MAX_PORTS];
-       
+       int mod_interrupt_from_first;
+
 } GLOBALS;
 #pragma warning(default:4201) // nameless struct/union