> If no one has a problem, I'll just go ahead with the following...
Roland, here's your patch fixed to work, this function is something...
you've missed a break in the SDR switch case.. I added it and tested
Or.
--
IB/core: Fix SDR rates in sysfs
Commit 71eeba16 ("IB: Add new InfiniBan
On 2/27/2012 7:23 PM, Roland Dreier wrote:
If no one has a problem, I'll just go ahead with the following...
it has one little bug, see below
--
switch (attr.active_speed) {
+ case 1:
+ /* SDR */
+ rate = 25;
missing break here, will send you now f
On 2/27/2012 7:23 PM, Roland Dreier wrote:
It doesn't really work if everything needs me to micromanage every
step... the original patch obviously made some ugly code uglier, Sean
pointed out an obvious way to make things cleaner. If no one has a
problem, I'll just go ahead with the following..
> Could you please let me know if you want a change in this patch, or this fix
> can go in using the current form for 3.4?
It doesn't really work if everything needs me to micromanage every step...
the original patch obviously made some ugly code uglier, Sean pointed out an
obvious way to make thi
On 1/11/2012 9:45 PM, Or Gerlitz wrote:
Yep, this function is surely not programming state of the art..
however, except for SDR, the above line doing rate = rate *
ib_width_enum_to_int(attr.active_width) would hold for all the speeds
and all the widths (1X, 4X, 12X), if we just set rate (possib
On Wed, Jan 11, 2012 at 9:30 PM, Hefty, Sean wrote:
> This function ends up like this, with my comments inline:
> rate = (25 * attr.active_speed) / 10;
> We set rate here, but [...] The above switch statement
> changes the value for 3 of the 5 cases, with 1 case not covered.
> rate
> @@ -213,12 +213,18 @@ static ssize_t rate_show(struct ib_port *p, struct
> port_attribute *unused,
> }
>
> rate *= ib_width_enum_to_int(attr.active_width);
> +
> if (rate < 0)
> return -EINVAL;
>
> - return sprintf(buf, "%d%s Gb/sec (%dX%s)\n",
> -
commit 71eeba16 "IB: Add new InfiniBand link speeds" introduced a bug
under which the rate for IB SDR/4X links was displayed as 8.5Gbs
instead of 10Gbs, fix that.
Signed-off-by: Or Gerlitz
---
drivers/infiniband/core/sysfs.c | 12 +---
1 files changed, 9 insertions(+), 3 deletions(-)