]> err.no Git - linux-2.6/commitdiff
mlx4_core: Get the maximum message size from reported device capabilities
authorDotan Barak <dotanb@dev.mellanox.co.il>
Tue, 26 Jun 2007 12:55:28 +0000 (15:55 +0300)
committerRoland Dreier <rolandd@cisco.com>
Tue, 10 Jul 2007 03:12:26 +0000 (20:12 -0700)
Get the maximum message size from the device capabilities returned
from the QUERY_DEV_CAP firmware command, rather than hard-coding 2 GB.

Signed-off-by: Dotan Barak <dotanb@dev.mellanox.co.il>
Signed-off-by: Michael S. Tsirkin <mst@dev.mellanox.co.il>
Signed-off-by: Roland Dreier <rolandd@cisco.com>
drivers/infiniband/hw/mlx4/main.c
drivers/net/mlx4/fw.c
drivers/net/mlx4/fw.h
drivers/net/mlx4/main.c
include/linux/mlx4/device.h

index c591616dccde7ca0e2632e2b77f4a7e366a2062d..2fc8ccebaac13a9d72fd919dee0a2f7fc6c0de6d 100644 (file)
@@ -169,7 +169,7 @@ static int mlx4_ib_query_port(struct ib_device *ibdev, u8 port,
        props->phys_state       = out_mad->data[33] >> 4;
        props->port_cap_flags   = be32_to_cpup((__be32 *) (out_mad->data + 20));
        props->gid_tbl_len      = to_mdev(ibdev)->dev->caps.gid_table_len[port];
-       props->max_msg_sz       = 0x80000000;
+       props->max_msg_sz       = to_mdev(ibdev)->dev->caps.max_msg_sz;
        props->pkey_tbl_len     = to_mdev(ibdev)->dev->caps.pkey_table_len[port];
        props->bad_pkey_cntr    = be16_to_cpup((__be16 *) (out_mad->data + 46));
        props->qkey_viol_cntr   = be16_to_cpup((__be16 *) (out_mad->data + 48));
index d2b065351e4511fda36c5e4bd101c15e2fd647b6..c45cbe43a0c483830891e109beb306d11dc51d2a 100644 (file)
@@ -138,6 +138,7 @@ int mlx4_QUERY_DEV_CAP(struct mlx4_dev *dev, struct mlx4_dev_cap *dev_cap)
 #define QUERY_DEV_CAP_ACK_DELAY_OFFSET         0x35
 #define QUERY_DEV_CAP_MTU_WIDTH_OFFSET         0x36
 #define QUERY_DEV_CAP_VL_PORT_OFFSET           0x37
+#define QUERY_DEV_CAP_MAX_MSG_SZ_OFFSET                0x38
 #define QUERY_DEV_CAP_MAX_GID_OFFSET           0x3b
 #define QUERY_DEV_CAP_RATE_SUPPORT_OFFSET      0x3c
 #define QUERY_DEV_CAP_MAX_PKEY_OFFSET          0x3f
@@ -220,6 +221,8 @@ int mlx4_QUERY_DEV_CAP(struct mlx4_dev *dev, struct mlx4_dev_cap *dev_cap)
        dev_cap->local_ca_ack_delay = field & 0x1f;
        MLX4_GET(field, outbox, QUERY_DEV_CAP_VL_PORT_OFFSET);
        dev_cap->num_ports = field & 0xf;
+       MLX4_GET(field, outbox, QUERY_DEV_CAP_MAX_MSG_SZ_OFFSET);
+       dev_cap->max_msg_sz = 1 << (field & 0x1f);
        MLX4_GET(stat_rate, outbox, QUERY_DEV_CAP_RATE_SUPPORT_OFFSET);
        dev_cap->stat_rate_support = stat_rate;
        MLX4_GET(dev_cap->flags, outbox, QUERY_DEV_CAP_FLAGS_OFFSET);
index 296254ac27c14b0a5fbfa0f3789e149e91336e80..7e1dd9e25cfbabb9fa995d51c2c1fbf149518de6 100644 (file)
@@ -60,6 +60,7 @@ struct mlx4_dev_cap {
        int max_rdma_global;
        int local_ca_ack_delay;
        int num_ports;
+       u32 max_msg_sz;
        int max_mtu[MLX4_MAX_PORTS + 1];
        int max_port_width[MLX4_MAX_PORTS + 1];
        int max_vl[MLX4_MAX_PORTS + 1];
index c3da2a2f543127c7b89a34af0b1279923b4a3496..a4f2e0475a719e249358a54f5cd2c892ad5c12e0 100644 (file)
@@ -154,6 +154,7 @@ static int __devinit mlx4_dev_cap(struct mlx4_dev *dev, struct mlx4_dev_cap *dev
        dev->caps.reserved_uars      = dev_cap->reserved_uars;
        dev->caps.reserved_pds       = dev_cap->reserved_pds;
        dev->caps.mtt_entry_sz       = MLX4_MTT_ENTRY_PER_SEG * dev_cap->mtt_entry_sz;
+       dev->caps.max_msg_sz         = dev_cap->max_msg_sz;
        dev->caps.page_size_cap      = ~(u32) (dev_cap->min_page_sz - 1);
        dev->caps.flags              = dev_cap->flags;
        dev->caps.stat_rate_support  = dev_cap->stat_rate_support;
index b372f5910fc154247e1f1a08b812e606309139e3..8209387ee854e5972ad47b3ac19423aa87c6f20b 100644 (file)
@@ -172,6 +172,7 @@ struct mlx4_caps {
        int                     num_pds;
        int                     reserved_pds;
        int                     mtt_entry_sz;
+       u32                     max_msg_sz;
        u32                     page_size_cap;
        u32                     flags;
        u16                     stat_rate_support;