Skip to content

Commit 5963423

Browse files
slavashwkostikbel
authored andcommitted
libibverbs: Extend support of NDR rates
NDR(106.25 Gbps) support exposed new data rates: 800 Gbps - NDR 8x. 1200 Gbps - NDR 12x. Utility methods were updated to support the new rates mentioned above: 1) Rate to mult - Convert the IB rate enum to a multiple of 2.5 Gbps. 2) Rate to mbps - Convert IB rate enum to the mbps value. In addition, speed_str() of ibv_devinfo was updated to consider the new NDR rate. Reference: IB Spec Release 1.5 PR: 285305 MFC after: 1 week Sponsored by: NVidia networking Change-Id: I77541e406f700585fbfeddc162d5a0e7b79a1c11 Signed-off-by: Slava Shwartsman <[email protected]>
1 parent b82d789 commit 5963423

File tree

3 files changed

+11
-0
lines changed

3 files changed

+11
-0
lines changed

contrib/ofed/libibverbs/examples/devinfo.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -145,6 +145,7 @@ static const char *speed_str(uint8_t speed)
145145
case 16: return "14.0 Gbps";
146146
case 32: return "25.0 Gbps";
147147
case 64: return "50.0 Gbps";
148+
case 128: return "100.0 Gbps";
148149
default: return "invalid speed";
149150
}
150151
}

contrib/ofed/libibverbs/verbs.c

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,8 @@ int __attribute__((const)) ibv_rate_to_mult(enum ibv_rate rate)
115115
case IBV_RATE_50_GBPS: return 20;
116116
case IBV_RATE_400_GBPS: return 160;
117117
case IBV_RATE_600_GBPS: return 240;
118+
case IBV_RATE_800_GBPS: return 320;
119+
case IBV_RATE_1200_GBPS: return 480;
118120
default: return -1;
119121
}
120122
}
@@ -135,6 +137,8 @@ enum ibv_rate __attribute__((const)) mult_to_ibv_rate(int mult)
135137
case 20: return IBV_RATE_50_GBPS;
136138
case 160: return IBV_RATE_400_GBPS;
137139
case 240: return IBV_RATE_600_GBPS;
140+
case 320: return IBV_RATE_800_GBPS;
141+
case 480: return IBV_RATE_1200_GBPS;
138142
default: return IBV_RATE_MAX;
139143
}
140144
}
@@ -163,6 +167,8 @@ int __attribute__((const)) ibv_rate_to_mbps(enum ibv_rate rate)
163167
case IBV_RATE_50_GBPS: return 53125;
164168
case IBV_RATE_400_GBPS: return 425000;
165169
case IBV_RATE_600_GBPS: return 637500;
170+
case IBV_RATE_800_GBPS: return 850000;
171+
case IBV_RATE_1200_GBPS: return 1275000;
166172
default: return -1;
167173
}
168174
}
@@ -191,6 +197,8 @@ enum ibv_rate __attribute__((const)) mbps_to_ibv_rate(int mbps)
191197
case 53125: return IBV_RATE_50_GBPS;
192198
case 425000: return IBV_RATE_400_GBPS;
193199
case 637500: return IBV_RATE_600_GBPS;
200+
case 850000: return IBV_RATE_800_GBPS;
201+
case 1275000: return IBV_RATE_1200_GBPS;
194202
default: return IBV_RATE_MAX;
195203
}
196204
}

contrib/ofed/libibverbs/verbs.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -595,6 +595,8 @@ enum ibv_rate {
595595
IBV_RATE_50_GBPS = 20,
596596
IBV_RATE_400_GBPS = 21,
597597
IBV_RATE_600_GBPS = 22,
598+
IBV_RATE_800_GBPS = 23,
599+
IBV_RATE_1200_GBPS = 24,
598600
};
599601

600602
/**

0 commit comments

Comments
 (0)