]> git.openfabrics.org - ~shefty/rdma-win.git/commitdiff
[MLX4] fix compilation bug in the previous patch
authorleonidk <leonidk@ad392aa1-c5ef-ae45-8dd8-e69d62a5ef86>
Mon, 26 Oct 2009 10:31:27 +0000 (10:31 +0000)
committerleonidk <leonidk@ad392aa1-c5ef-ae45-8dd8-e69d62a5ef86>
Mon, 26 Oct 2009 10:31:27 +0000 (10:31 +0000)
git-svn-id: svn://openib.tc.cornell.edu/gen1@2516 ad392aa1-c5ef-ae45-8dd8-e69d62a5ef86

trunk/hw/mlx4/kernel/bus/net/main.c
trunk/hw/mlx4/kernel/inc/l2w.h

index 28266700e4fcdaac6f3edaf76878c9b1c5adb337..c1bf19193c0b97d70ba4db61747da089ec56eb8f 100644 (file)
@@ -877,24 +877,16 @@ err_uar_table_free:
 
 static void __devinit mlx4_enable_msi_x(struct mlx4_dev *dev)
 {
-       int i, n_cpus;
-       u64 cpus;
-
-       /* calculate the number of processors */
-       cpus = (u64)KeQueryActiveProcessors();
-       for (i=0,n_cpus=0; i<(sizeof(KAFFINITY)<<3); i++) {
-               if ((1I64<<i) & cpus)
-                       n_cpus++;
-       }
+       int n_cpus = num_possible_cpus();
 
        /* decide on the mode */
        if (dev->pdev->n_msi_vectors_alloc >= (n_cpus+2))
                dev->flags |= MLX4_FLAG_MSI_X;
 
        MLX4_PRINT(TRACE_LEVEL_WARNING ,MLX4_DBG_LOW ,
-               ("Interrupt mode '%s', n_vectors %d, n_cpus %d, Affinity %#I64x\n",
+               ("Interrupt mode '%s', n_vectors %d, n_cpus %d\n",
                (dev->flags & MLX4_FLAG_MSI_X) ? "MSI-X" : "Legacy", 
-               dev->pdev->n_msi_vectors_alloc, n_cpus, cpus));
+               dev->pdev->n_msi_vectors_alloc, n_cpus));
 
 }
 
index 68634345b01203a76acd56754d5caefdf4aacf77..b2f6fbb36a160a3821ca19a260147a87068c912c 100644 (file)
 
 // various
 #define __always_inline                                inline
-#define num_possible_cpus      KeQueryMaximumProcessorCount
+
+#if (WINVER < _WIN32_WINNT_WIN6)
+#define num_possible_cpus() KeNumberProcessors
+#else
+#define num_possible_cpus()    KeQueryMaximumProcessorCount()
+#endif
+
 
 ////////////////////////////////////////////////////////
 //