Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit e36fb88a authored by Marcel Apfelbaum's avatar Marcel Apfelbaum Committed by Roland Dreier
Browse files

IPoIB: Handle extended rates in debugfs



Use new function ib_rate_to_mbps() to handle printing rate in debugfs,
so that we handle extended rates.

Signed-off-by: default avatarMarcel Apfelbaum <marcela@dev.mellanox.co.il>
Signed-off-by: default avatarRoland Dreier <roland@purestorage.com>
parent 71eeba16
Loading
Loading
Loading
Loading
+3 −4
Original line number Diff line number Diff line
@@ -212,16 +212,15 @@ static int ipoib_path_seq_show(struct seq_file *file, void *iter_ptr)
		   gid_buf, path.pathrec.dlid ? "yes" : "no");

	if (path.pathrec.dlid) {
		rate = ib_rate_to_mult(path.pathrec.rate) * 25;
		rate = ib_rate_to_mbps(path.pathrec.rate);

		seq_printf(file,
			   "  DLID:     0x%04x\n"
			   "  SL: %12d\n"
			   "  rate: %*d%s Gb/sec\n",
			   "  rate: %8d.%d Gb/sec\n",
			   be16_to_cpu(path.pathrec.dlid),
			   path.pathrec.sl,
			   10 - ((rate % 10) ? 2 : 0),
			   rate / 10, rate % 10 ? ".5" : "");
			   rate / 1000, rate % 1000);
	}

	seq_putc(file, '\n');