On Mon, Jul 18, 2011 at 08:42:25AM +0000, Tziporet Koren wrote:

> CX3 is using libmlx4 and not libmthca.
> Vlad sent a patch on 1/19/11:
> http://www.spinics.net/lists/linux-rdma/msg07237.html

> Is contain adding several device IDs including CX3

Why is that test even in libmlx4?

Maybe this is a better choice:

diff --git a/src/mlx4.c b/src/mlx4.c
index 1295c53..bc8ee72 100644
--- a/src/mlx4.c
+++ b/src/mlx4.c
@@ -53,21 +53,6 @@
 #define PCI_VENDOR_ID_MELLANOX                 0x15b3
 #endif
 
-#define HCA(v, d) \
-       { .vendor = PCI_VENDOR_ID_##v,                  \
-         .device = d }
-
-struct {
-       unsigned                vendor;
-       unsigned                device;
-} hca_table[] = {
-       HCA(MELLANOX, 0x6340),  /* MT25408 "Hermon" SDR */
-       HCA(MELLANOX, 0x634a),  /* MT25408 "Hermon" DDR */
-       HCA(MELLANOX, 0x6354),  /* MT25408 "Hermon" QDR */
-       HCA(MELLANOX, 0x6732),  /* MT25408 "Hermon" DDR PCIe gen2 */
-       HCA(MELLANOX, 0x673c),  /* MT25408 "Hermon" QDR PCIe gen2 */
-};
-
 static struct ibv_context_ops mlx4_ctx_ops = {
        .query_device  = mlx4_query_device,
        .query_port    = mlx4_query_port,
@@ -183,27 +168,7 @@ static struct ibv_device *mlx4_driver_init(const char 
*uverbs_sys_path,
 {
        char                    value[8];
        struct mlx4_device    *dev;
-       unsigned                vendor, device;
-       int                     i;
-
-       if (ibv_read_sysfs_file(uverbs_sys_path, "device/vendor",
-                               value, sizeof value) < 0)
-               return NULL;
-       sscanf(value, "%i", &vendor);
-
-       if (ibv_read_sysfs_file(uverbs_sys_path, "device/device",
-                               value, sizeof value) < 0)
-               return NULL;
-       sscanf(value, "%i", &device);
-
-       for (i = 0; i < sizeof hca_table / sizeof hca_table[0]; ++i)
-               if (vendor == hca_table[i].vendor &&
-                   device == hca_table[i].device)
-                       goto found;
-
-       return NULL;
 
-found:
        if (abi_version < MLX4_UVERBS_MIN_ABI_VERSION ||
            abi_version > MLX4_UVERBS_MAX_ABI_VERSION) {
                fprintf(stderr, PFX "Fatal: ABI version %d of %s is not 
supported "
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to