[MTHCA] a way to specify the cpu affinity mask in order to improve IPoIB MCast latency.
authorleonidk <leonidk@ad392aa1-c5ef-ae45-8dd8-e69d62a5ef86>
Mon, 7 Apr 2008 11:19:29 +0000 (11:19 +0000)
committerleonidk <leonidk@ad392aa1-c5ef-ae45-8dd8-e69d62a5ef86>
Mon, 7 Apr 2008 11:19:29 +0000 (11:19 +0000)
Provided by: Slava Strebkov [slavas@voltaire.com]

git-svn-id: svn://openib.tc.cornell.edu/gen1/trunk@1047 ad392aa1-c5ef-ae45-8dd8-e69d62a5ef86

hw/mthca/kernel/hca_pnp.c
hw/mthca/kernel/mt_l2w.c

index 9e4a4c0..576b1c3 100644 (file)
@@ -678,6 +678,29 @@ __SetupHcaResources(
                if( pHcaRes->Type == CmResourceTypeInterrupt )\r
                {\r
                        p_ext->interruptInfo = *pHostRes;\r
+            if ( g_processor_affinity == 0xFFFFFFFF ) \r
+                       {\r
+                               /* \r
+                                * Calculate the mask of the last processor\r
+                                */\r
+                               KAFFINITY               n_active_processors_bitmask;\r
+                               uint32_t                last_processor_mask = 0 , tmp_processor_mask = 1;\r
+                               \r
+                               n_active_processors_bitmask = KeQueryActiveProcessors();\r
+                while ( tmp_processor_mask & n_active_processors_bitmask )\r
+                               {\r
+                                               last_processor_mask = tmp_processor_mask;\r
+                                               tmp_processor_mask = tmp_processor_mask << 1;\r
+                               }\r
+                               p_ext->interruptInfo.u.Interrupt.Affinity = last_processor_mask; \r
+                       }\r
+                       else if (g_processor_affinity != 0) \r
+                       {\r
+                               p_ext->interruptInfo.u.Interrupt.Affinity = g_processor_affinity;                               \r
+                       }\r
+                       HCA_PRINT( TRACE_LEVEL_INFORMATION, HCA_DBG_PNP,("Set Interrupt affinity to : 0x%08X\n",\r
+                                        (int)p_ext->interruptInfo.u.Interrupt.Affinity ));\r
+\r
                        continue;\r
                }\r
                \r
@@ -1767,3 +1790,4 @@ void reregister_hca( hca_dev_ext_t *p_ext )
        \r
 }\r
 \r
+\r
index f1b2f02..0979a74 100644 (file)
@@ -118,7 +118,7 @@ int request_irq(
                (BOOLEAN)((int_info->Flags == CM_RESOURCE_INTERRUPT_LATCHED) ? 
                Latched : LevelSensitive),                                                      /* interrupt type: LATCHED or LEVEL */
                (BOOLEAN)(int_info->ShareDisposition == CmResourceShareShared),         /* vector shared or not */
-               g_processor_affinity ? g_processor_affinity : (KAFFINITY)int_info->u.Interrupt.Affinity,        /* interrupt affinity */
+               (KAFFINITY)int_info->u.Interrupt.Affinity,      /* interrupt affinity */
                FALSE                                                                                                                   /* whether to save Float registers */
                );
 
@@ -130,3 +130,4 @@ int request_irq(
                return 0;
 }
 
+