|
53 | 53 | #define MLX4_FLAG2_V_IGNORE_FCS_MASK BIT(1) |
54 | 54 | #define MLX4_FLAG2_V_USER_MTU_MASK BIT(5) |
55 | 55 | #define MLX4_FLAG_V_MTU_MASK BIT(0) |
| 56 | +#define MLX4_FLAG_V_PPRX_MASK BIT(1) |
| 57 | +#define MLX4_FLAG_V_PPTX_MASK BIT(2) |
56 | 58 | #define MLX4_IGNORE_FCS_MASK 0x1 |
57 | 59 | #define MLX4_TC_MAX_NUMBER 8 |
58 | 60 |
|
@@ -1305,12 +1307,32 @@ mlx4_en_set_port_user_mtu(struct mlx4_dev *dev, int slave, int port, |
1305 | 1307 | gen_context->user_mtu = cpu_to_be16(master->max_user_mtu[port]); |
1306 | 1308 | } |
1307 | 1309 |
|
| 1310 | +static void |
| 1311 | +mlx4_en_set_port_global_pause(struct mlx4_dev *dev, int slave, |
| 1312 | + struct mlx4_set_port_general_context *gen_context) |
| 1313 | +{ |
| 1314 | + struct mlx4_priv *priv = mlx4_priv(dev); |
| 1315 | + struct mlx4_mfunc_master_ctx *master = &priv->mfunc.master; |
| 1316 | + |
| 1317 | + /* Slave cannot change Global Pause configuration */ |
| 1318 | + if (slave != mlx4_master_func_num(dev) && |
| 1319 | + (gen_context->pptx != master->pptx || |
| 1320 | + gen_context->pprx != master->pprx)) { |
| 1321 | + gen_context->pptx = master->pptx; |
| 1322 | + gen_context->pprx = master->pprx; |
| 1323 | + mlx4_warn(dev, "denying Global Pause change for slave:%d\n", |
| 1324 | + slave); |
| 1325 | + } else { |
| 1326 | + master->pptx = gen_context->pptx; |
| 1327 | + master->pprx = gen_context->pprx; |
| 1328 | + } |
| 1329 | +} |
| 1330 | + |
1308 | 1331 | static int mlx4_common_set_port(struct mlx4_dev *dev, int slave, u32 in_mod, |
1309 | 1332 | u8 op_mod, struct mlx4_cmd_mailbox *inbox) |
1310 | 1333 | { |
1311 | 1334 | struct mlx4_priv *priv = mlx4_priv(dev); |
1312 | 1335 | struct mlx4_port_info *port_info; |
1313 | | - struct mlx4_mfunc_master_ctx *master = &priv->mfunc.master; |
1314 | 1336 | struct mlx4_set_port_rqp_calc_context *qpn_context; |
1315 | 1337 | struct mlx4_set_port_general_context *gen_context; |
1316 | 1338 | struct mlx4_roce_gid_entry *gid_entry_tbl, *gid_entry_mbox, *gid_entry_mb1; |
@@ -1372,19 +1394,11 @@ static int mlx4_common_set_port(struct mlx4_dev *dev, int slave, u32 in_mod, |
1372 | 1394 | mlx4_en_set_port_user_mtu(dev, slave, port, |
1373 | 1395 | gen_context); |
1374 | 1396 |
|
1375 | | - /* Slave cannot change Global Pause configuration */ |
1376 | | - if (slave != mlx4_master_func_num(dev) && |
1377 | | - ((gen_context->pptx != master->pptx) || |
1378 | | - (gen_context->pprx != master->pprx))) { |
1379 | | - gen_context->pptx = master->pptx; |
1380 | | - gen_context->pprx = master->pprx; |
1381 | | - mlx4_warn(dev, |
1382 | | - "denying Global Pause change for slave:%d\n", |
1383 | | - slave); |
1384 | | - } else { |
1385 | | - master->pptx = gen_context->pptx; |
1386 | | - master->pprx = gen_context->pprx; |
1387 | | - } |
| 1397 | + if (gen_context->flags & |
| 1398 | + (MLX4_FLAG_V_PPRX_MASK || MLX4_FLAG_V_PPTX_MASK)) |
| 1399 | + mlx4_en_set_port_global_pause(dev, slave, |
| 1400 | + gen_context); |
| 1401 | + |
1388 | 1402 | break; |
1389 | 1403 | case MLX4_SET_PORT_GID_TABLE: |
1390 | 1404 | /* change to MULTIPLE entries: number of guest's gids |
|
0 commit comments