aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/mlx4
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/mlx4')
-rw-r--r--drivers/net/mlx4/fw.c28
-rw-r--r--drivers/net/mlx4/fw.h6
-rw-r--r--drivers/net/mlx4/main.c7
-rw-r--r--drivers/net/mlx4/mcg.c17
4 files changed, 54 insertions, 4 deletions
diff --git a/drivers/net/mlx4/fw.c b/drivers/net/mlx4/fw.c
index d82f2751d2c7..2b5006b9be67 100644
--- a/drivers/net/mlx4/fw.c
+++ b/drivers/net/mlx4/fw.c
@@ -101,6 +101,34 @@ static void dump_dev_cap_flags(struct mlx4_dev *dev, u32 flags)
101 mlx4_dbg(dev, " %s\n", fname[i]); 101 mlx4_dbg(dev, " %s\n", fname[i]);
102} 102}
103 103
104int mlx4_MOD_STAT_CFG(struct mlx4_dev *dev, struct mlx4_mod_stat_cfg *cfg)
105{
106 struct mlx4_cmd_mailbox *mailbox;
107 u32 *inbox;
108 int err = 0;
109
110#define MOD_STAT_CFG_IN_SIZE 0x100
111
112#define MOD_STAT_CFG_PG_SZ_M_OFFSET 0x002
113#define MOD_STAT_CFG_PG_SZ_OFFSET 0x003
114
115 mailbox = mlx4_alloc_cmd_mailbox(dev);
116 if (IS_ERR(mailbox))
117 return PTR_ERR(mailbox);
118 inbox = mailbox->buf;
119
120 memset(inbox, 0, MOD_STAT_CFG_IN_SIZE);
121
122 MLX4_PUT(inbox, cfg->log_pg_sz, MOD_STAT_CFG_PG_SZ_OFFSET);
123 MLX4_PUT(inbox, cfg->log_pg_sz_m, MOD_STAT_CFG_PG_SZ_M_OFFSET);
124
125 err = mlx4_cmd(dev, mailbox->dma, 0, 0, MLX4_CMD_MOD_STAT_CFG,
126 MLX4_CMD_TIME_CLASS_A);
127
128 mlx4_free_cmd_mailbox(dev, mailbox);
129 return err;
130}
131
104int mlx4_QUERY_DEV_CAP(struct mlx4_dev *dev, struct mlx4_dev_cap *dev_cap) 132int mlx4_QUERY_DEV_CAP(struct mlx4_dev *dev, struct mlx4_dev_cap *dev_cap)
105{ 133{
106 struct mlx4_cmd_mailbox *mailbox; 134 struct mlx4_cmd_mailbox *mailbox;
diff --git a/drivers/net/mlx4/fw.h b/drivers/net/mlx4/fw.h
index 306cb9b0242d..a0e046c149b7 100644
--- a/drivers/net/mlx4/fw.h
+++ b/drivers/net/mlx4/fw.h
@@ -38,6 +38,11 @@
38#include "mlx4.h" 38#include "mlx4.h"
39#include "icm.h" 39#include "icm.h"
40 40
41struct mlx4_mod_stat_cfg {
42 u8 log_pg_sz;
43 u8 log_pg_sz_m;
44};
45
41struct mlx4_dev_cap { 46struct mlx4_dev_cap {
42 int max_srq_sz; 47 int max_srq_sz;
43 int max_qp_sz; 48 int max_qp_sz;
@@ -162,5 +167,6 @@ int mlx4_SET_ICM_SIZE(struct mlx4_dev *dev, u64 icm_size, u64 *aux_pages);
162int mlx4_MAP_ICM_AUX(struct mlx4_dev *dev, struct mlx4_icm *icm); 167int mlx4_MAP_ICM_AUX(struct mlx4_dev *dev, struct mlx4_icm *icm);
163int mlx4_UNMAP_ICM_AUX(struct mlx4_dev *dev); 168int mlx4_UNMAP_ICM_AUX(struct mlx4_dev *dev);
164int mlx4_NOP(struct mlx4_dev *dev); 169int mlx4_NOP(struct mlx4_dev *dev);
170int mlx4_MOD_STAT_CFG(struct mlx4_dev *dev, struct mlx4_mod_stat_cfg *cfg);
165 171
166#endif /* MLX4_FW_H */ 172#endif /* MLX4_FW_H */
diff --git a/drivers/net/mlx4/main.c b/drivers/net/mlx4/main.c
index a6aa49fc1d68..d3736013fe9b 100644
--- a/drivers/net/mlx4/main.c
+++ b/drivers/net/mlx4/main.c
@@ -485,6 +485,7 @@ static int mlx4_init_hca(struct mlx4_dev *dev)
485 struct mlx4_priv *priv = mlx4_priv(dev); 485 struct mlx4_priv *priv = mlx4_priv(dev);
486 struct mlx4_adapter adapter; 486 struct mlx4_adapter adapter;
487 struct mlx4_dev_cap dev_cap; 487 struct mlx4_dev_cap dev_cap;
488 struct mlx4_mod_stat_cfg mlx4_cfg;
488 struct mlx4_profile profile; 489 struct mlx4_profile profile;
489 struct mlx4_init_hca_param init_hca; 490 struct mlx4_init_hca_param init_hca;
490 u64 icm_size; 491 u64 icm_size;
@@ -502,6 +503,12 @@ static int mlx4_init_hca(struct mlx4_dev *dev)
502 return err; 503 return err;
503 } 504 }
504 505
506 mlx4_cfg.log_pg_sz_m = 1;
507 mlx4_cfg.log_pg_sz = 0;
508 err = mlx4_MOD_STAT_CFG(dev, &mlx4_cfg);
509 if (err)
510 mlx4_warn(dev, "Failed to override log_pg_sz parameter\n");
511
505 err = mlx4_dev_cap(dev, &dev_cap); 512 err = mlx4_dev_cap(dev, &dev_cap);
506 if (err) { 513 if (err) {
507 mlx4_err(dev, "QUERY_DEV_CAP command failed, aborting.\n"); 514 mlx4_err(dev, "QUERY_DEV_CAP command failed, aborting.\n");
diff --git a/drivers/net/mlx4/mcg.c b/drivers/net/mlx4/mcg.c
index 57f7f1f0d4ec..b4b57870ddfd 100644
--- a/drivers/net/mlx4/mcg.c
+++ b/drivers/net/mlx4/mcg.c
@@ -38,6 +38,9 @@
38 38
39#include "mlx4.h" 39#include "mlx4.h"
40 40
41#define MGM_QPN_MASK 0x00FFFFFF
42#define MGM_BLCK_LB_BIT 30
43
41struct mlx4_mgm { 44struct mlx4_mgm {
42 __be32 next_gid_index; 45 __be32 next_gid_index;
43 __be32 members_count; 46 __be32 members_count;
@@ -153,7 +156,8 @@ static int find_mgm(struct mlx4_dev *dev,
153 return err; 156 return err;
154} 157}
155 158
156int mlx4_multicast_attach(struct mlx4_dev *dev, struct mlx4_qp *qp, u8 gid[16]) 159int mlx4_multicast_attach(struct mlx4_dev *dev, struct mlx4_qp *qp, u8 gid[16],
160 int block_mcast_loopback)
157{ 161{
158 struct mlx4_priv *priv = mlx4_priv(dev); 162 struct mlx4_priv *priv = mlx4_priv(dev);
159 struct mlx4_cmd_mailbox *mailbox; 163 struct mlx4_cmd_mailbox *mailbox;
@@ -202,13 +206,18 @@ int mlx4_multicast_attach(struct mlx4_dev *dev, struct mlx4_qp *qp, u8 gid[16])
202 } 206 }
203 207
204 for (i = 0; i < members_count; ++i) 208 for (i = 0; i < members_count; ++i)
205 if (mgm->qp[i] == cpu_to_be32(qp->qpn)) { 209 if ((be32_to_cpu(mgm->qp[i]) & MGM_QPN_MASK) == qp->qpn) {
206 mlx4_dbg(dev, "QP %06x already a member of MGM\n", qp->qpn); 210 mlx4_dbg(dev, "QP %06x already a member of MGM\n", qp->qpn);
207 err = 0; 211 err = 0;
208 goto out; 212 goto out;
209 } 213 }
210 214
211 mgm->qp[members_count++] = cpu_to_be32(qp->qpn); 215 if (block_mcast_loopback)
216 mgm->qp[members_count++] = cpu_to_be32((qp->qpn & MGM_QPN_MASK) |
217 (1 << MGM_BLCK_LB_BIT));
218 else
219 mgm->qp[members_count++] = cpu_to_be32(qp->qpn & MGM_QPN_MASK);
220
212 mgm->members_count = cpu_to_be32(members_count); 221 mgm->members_count = cpu_to_be32(members_count);
213 222
214 err = mlx4_WRITE_MCG(dev, index, mailbox); 223 err = mlx4_WRITE_MCG(dev, index, mailbox);
@@ -283,7 +292,7 @@ int mlx4_multicast_detach(struct mlx4_dev *dev, struct mlx4_qp *qp, u8 gid[16])
283 292
284 members_count = be32_to_cpu(mgm->members_count); 293 members_count = be32_to_cpu(mgm->members_count);
285 for (loc = -1, i = 0; i < members_count; ++i) 294 for (loc = -1, i = 0; i < members_count; ++i)
286 if (mgm->qp[i] == cpu_to_be32(qp->qpn)) 295 if ((be32_to_cpu(mgm->qp[i]) & MGM_QPN_MASK) == qp->qpn)
287 loc = i; 296 loc = i;
288 297
289 if (loc == -1) { 298 if (loc == -1) {