aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorOren Duer <oren@mellanox.co.il>2012-04-29 10:04:24 -0400
committerRoland Dreier <roland@purestorage.com>2012-05-08 14:48:09 -0400
commitc0c1d3d761c32ece93b1c99d200591415e3cbf7c (patch)
treebd1099c23f115a3720f002e9fe27b832d34cf9e4
parentd48b97b403d23f6df0b990cee652bdf9a52337a3 (diff)
IB/mlx4: Put priority bits in WQE of IBoE MLX QP
Otherwise CM packets going over MLX QP1 get fixed scheduling priority 0. We want CM packets to get the same scheduling priority, and therefore map to the same SQ (Schedule Queue) and eventually TC (Traffic Class), as the application requested for the actual QP used for the connection. Signed-off-by: Oren Duer <oren@mellanox.co.il> Signed-off-by: Or Gerlitz <ogerlitz@mellanox.com> Signed-off-by: Roland Dreier <roland@purestorage.com>
-rw-r--r--drivers/infiniband/hw/mlx4/qp.c6
-rw-r--r--include/linux/mlx4/qp.h3
2 files changed, 5 insertions, 4 deletions
diff --git a/drivers/infiniband/hw/mlx4/qp.c b/drivers/infiniband/hw/mlx4/qp.c
index 3a7848966627..6da2e9755091 100644
--- a/drivers/infiniband/hw/mlx4/qp.c
+++ b/drivers/infiniband/hw/mlx4/qp.c
@@ -1424,6 +1424,9 @@ static int build_mlx_header(struct mlx4_ib_sqp *sqp, struct ib_send_wr *wr,
1424 1424
1425 if (is_eth) { 1425 if (is_eth) {
1426 u8 *smac; 1426 u8 *smac;
1427 u16 pcp = (be32_to_cpu(ah->av.ib.sl_tclass_flowlabel) >> 29) << 13;
1428
1429 mlx->sched_prio = cpu_to_be16(pcp);
1427 1430
1428 memcpy(sqp->ud_header.eth.dmac_h, ah->av.eth.mac, 6); 1431 memcpy(sqp->ud_header.eth.dmac_h, ah->av.eth.mac, 6);
1429 /* FIXME: cache smac value? */ 1432 /* FIXME: cache smac value? */
@@ -1434,10 +1437,7 @@ static int build_mlx_header(struct mlx4_ib_sqp *sqp, struct ib_send_wr *wr,
1434 if (!is_vlan) { 1437 if (!is_vlan) {
1435 sqp->ud_header.eth.type = cpu_to_be16(MLX4_IB_IBOE_ETHERTYPE); 1438 sqp->ud_header.eth.type = cpu_to_be16(MLX4_IB_IBOE_ETHERTYPE);
1436 } else { 1439 } else {
1437 u16 pcp;
1438
1439 sqp->ud_header.vlan.type = cpu_to_be16(MLX4_IB_IBOE_ETHERTYPE); 1440 sqp->ud_header.vlan.type = cpu_to_be16(MLX4_IB_IBOE_ETHERTYPE);
1440 pcp = (be32_to_cpu(ah->av.ib.sl_tclass_flowlabel) >> 29) << 13;
1441 sqp->ud_header.vlan.tag = cpu_to_be16(vlan | pcp); 1441 sqp->ud_header.vlan.tag = cpu_to_be16(vlan | pcp);
1442 } 1442 }
1443 } else { 1443 } else {
diff --git a/include/linux/mlx4/qp.h b/include/linux/mlx4/qp.h
index 091f9e7dc8b9..bb57d5c58df2 100644
--- a/include/linux/mlx4/qp.h
+++ b/include/linux/mlx4/qp.h
@@ -233,7 +233,8 @@ struct mlx4_wqe_mlx_seg {
233 u8 owner; 233 u8 owner;
234 u8 reserved1[2]; 234 u8 reserved1[2];
235 u8 opcode; 235 u8 opcode;
236 u8 reserved2[3]; 236 __be16 sched_prio;
237 u8 reserved2;
237 u8 size; 238 u8 size;
238 /* 239 /*
239 * [17] VL15 240 * [17] VL15