Skip to content

Commit a5a5d19

Browse files
mikijoyjgunthorpe
authored andcommitted
IB/core: Add new IB rates
Add the new rates that were added to Infiniband spec as part of HDR and 2x support. Signed-off-by: Michael Guralnik <michaelgur@mellanox.com> Reviewed-by: Majd Dibbiny <majd@mellanox.com> Signed-off-by: Leon Romanovsky <leonro@mellanox.com> Signed-off-by: Jason Gunthorpe <jgg@mellanox.com>
1 parent dbabf68 commit a5a5d19

File tree

3 files changed

+18
-2
lines changed

3 files changed

+18
-2
lines changed

drivers/infiniband/core/verbs.c

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -141,6 +141,10 @@ __attribute_const__ int ib_rate_to_mult(enum ib_rate rate)
141141
case IB_RATE_100_GBPS: return 40;
142142
case IB_RATE_200_GBPS: return 80;
143143
case IB_RATE_300_GBPS: return 120;
144+
case IB_RATE_28_GBPS: return 11;
145+
case IB_RATE_50_GBPS: return 20;
146+
case IB_RATE_400_GBPS: return 160;
147+
case IB_RATE_600_GBPS: return 240;
144148
default: return -1;
145149
}
146150
}
@@ -166,6 +170,10 @@ __attribute_const__ enum ib_rate mult_to_ib_rate(int mult)
166170
case 40: return IB_RATE_100_GBPS;
167171
case 80: return IB_RATE_200_GBPS;
168172
case 120: return IB_RATE_300_GBPS;
173+
case 11: return IB_RATE_28_GBPS;
174+
case 20: return IB_RATE_50_GBPS;
175+
case 160: return IB_RATE_400_GBPS;
176+
case 240: return IB_RATE_600_GBPS;
169177
default: return IB_RATE_PORT_CURRENT;
170178
}
171179
}
@@ -191,6 +199,10 @@ __attribute_const__ int ib_rate_to_mbps(enum ib_rate rate)
191199
case IB_RATE_100_GBPS: return 103125;
192200
case IB_RATE_200_GBPS: return 206250;
193201
case IB_RATE_300_GBPS: return 309375;
202+
case IB_RATE_28_GBPS: return 28125;
203+
case IB_RATE_50_GBPS: return 53125;
204+
case IB_RATE_400_GBPS: return 425000;
205+
case IB_RATE_600_GBPS: return 637500;
194206
default: return -1;
195207
}
196208
}

drivers/infiniband/hw/mlx5/qp.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2703,7 +2703,7 @@ static int ib_rate_to_mlx5(struct mlx5_ib_dev *dev, u8 rate)
27032703
if (rate == IB_RATE_PORT_CURRENT)
27042704
return 0;
27052705

2706-
if (rate < IB_RATE_2_5_GBPS || rate > IB_RATE_300_GBPS)
2706+
if (rate < IB_RATE_2_5_GBPS || rate > IB_RATE_600_GBPS)
27072707
return -EINVAL;
27082708

27092709
while (rate != IB_RATE_PORT_CURRENT &&

include/rdma/ib_verbs.h

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -732,7 +732,11 @@ enum ib_rate {
732732
IB_RATE_25_GBPS = 15,
733733
IB_RATE_100_GBPS = 16,
734734
IB_RATE_200_GBPS = 17,
735-
IB_RATE_300_GBPS = 18
735+
IB_RATE_300_GBPS = 18,
736+
IB_RATE_28_GBPS = 19,
737+
IB_RATE_50_GBPS = 20,
738+
IB_RATE_400_GBPS = 21,
739+
IB_RATE_600_GBPS = 22,
736740
};
737741

738742
/**

0 commit comments

Comments
 (0)