diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2012-03-21 13:33:42 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2012-03-21 13:33:42 -0400 |
commit | 0c2fe82a9b106f1c03719783134360586d718a69 (patch) | |
tree | ec1a18ca49f1e6724ef3a93727f5f73b7df61931 /drivers/infiniband/core/sysfs.c | |
parent | 5f0e685f316a1de6d3af8b23eaf46651faca32ab (diff) | |
parent | f0e88aeb19dac00ed2e09fd4d39ee65f32d5e968 (diff) |
Merge tag 'rdma-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/roland/infiniband
Pull InfiniBand/RDMA changes for the 3.4 merge window from Roland Dreier:
"Nothing big really stands out; by patch count lots of fixes to the
mlx4 driver plus some cleanups and fixes to the core and other
drivers."
* tag 'rdma-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/roland/infiniband: (28 commits)
mlx4_core: Scale size of MTT table with system RAM
mlx4_core: Allow dynamic MTU configuration for IB ports
IB/mlx4: Fix info returned when querying IBoE ports
IB/mlx4: Fix possible missed completion event
mlx4_core: Report thermal error events
mlx4_core: Fix one more static exported function
IB: Change CQE "csum_ok" field to a bit flag
RDMA/iwcm: Reject connect requests if cmid is not in LISTEN state
RDMA/cxgb3: Don't pass irq flags to flush_qp()
mlx4_core: Get rid of redundant ext_port_cap flags
RDMA/ucma: Fix AB-BA deadlock
IB/ehca: Fix ilog2() compile failure
IB: Use central enum for speed instead of hard-coded values
IB/iser: Post initial receive buffers before sending the final login request
IB/iser: Free IB connection resources in the proper place
IB/srp: Consolidate repetitive sysfs code
IB/srp: Use pr_fmt() and pr_err()/pr_warn()
IB/core: Fix SDR rates in sysfs
mlx4: Enforce device max FMR maps in FMR alloc
IB/mlx4: Set bad_wr for invalid send opcode
...
Diffstat (limited to 'drivers/infiniband/core/sysfs.c')
-rw-r--r-- | drivers/infiniband/core/sysfs.c | 27 |
1 files changed, 15 insertions, 12 deletions
diff --git a/drivers/infiniband/core/sysfs.c b/drivers/infiniband/core/sysfs.c index c61bca30fd2d..83b720ef6c34 100644 --- a/drivers/infiniband/core/sysfs.c +++ b/drivers/infiniband/core/sysfs.c | |||
@@ -179,33 +179,36 @@ static ssize_t rate_show(struct ib_port *p, struct port_attribute *unused, | |||
179 | { | 179 | { |
180 | struct ib_port_attr attr; | 180 | struct ib_port_attr attr; |
181 | char *speed = ""; | 181 | char *speed = ""; |
182 | int rate; | 182 | int rate = -1; /* in deci-Gb/sec */ |
183 | ssize_t ret; | 183 | ssize_t ret; |
184 | 184 | ||
185 | ret = ib_query_port(p->ibdev, p->port_num, &attr); | 185 | ret = ib_query_port(p->ibdev, p->port_num, &attr); |
186 | if (ret) | 186 | if (ret) |
187 | return ret; | 187 | return ret; |
188 | 188 | ||
189 | rate = (25 * attr.active_speed) / 10; | ||
190 | |||
191 | switch (attr.active_speed) { | 189 | switch (attr.active_speed) { |
192 | case 2: | 190 | case IB_SPEED_SDR: |
191 | rate = 25; | ||
192 | break; | ||
193 | case IB_SPEED_DDR: | ||
193 | speed = " DDR"; | 194 | speed = " DDR"; |
195 | rate = 50; | ||
194 | break; | 196 | break; |
195 | case 4: | 197 | case IB_SPEED_QDR: |
196 | speed = " QDR"; | 198 | speed = " QDR"; |
199 | rate = 100; | ||
197 | break; | 200 | break; |
198 | case 8: | 201 | case IB_SPEED_FDR10: |
199 | speed = " FDR10"; | 202 | speed = " FDR10"; |
200 | rate = 10; | 203 | rate = 100; |
201 | break; | 204 | break; |
202 | case 16: | 205 | case IB_SPEED_FDR: |
203 | speed = " FDR"; | 206 | speed = " FDR"; |
204 | rate = 14; | 207 | rate = 140; |
205 | break; | 208 | break; |
206 | case 32: | 209 | case IB_SPEED_EDR: |
207 | speed = " EDR"; | 210 | speed = " EDR"; |
208 | rate = 25; | 211 | rate = 250; |
209 | break; | 212 | break; |
210 | } | 213 | } |
211 | 214 | ||
@@ -214,7 +217,7 @@ static ssize_t rate_show(struct ib_port *p, struct port_attribute *unused, | |||
214 | return -EINVAL; | 217 | return -EINVAL; |
215 | 218 | ||
216 | return sprintf(buf, "%d%s Gb/sec (%dX%s)\n", | 219 | return sprintf(buf, "%d%s Gb/sec (%dX%s)\n", |
217 | rate, (attr.active_speed == 1) ? ".5" : "", | 220 | rate / 10, rate % 10 ? ".5" : "", |
218 | ib_width_enum_to_int(attr.active_width), speed); | 221 | ib_width_enum_to_int(attr.active_width), speed); |
219 | } | 222 | } |
220 | 223 | ||