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

Commit b3c594ab authored by Ganesh Goudar's avatar Ganesh Goudar Committed by David S. Miller
Browse files

cxgb4: fix the wrong conversion of Mbps to Kbps



fix the wrong conversion where 1 Mbps was converted to
1024 Kbps.

Signed-off-by: default avatarGanesh Goudar <ganeshgr@chelsio.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent ccb02638
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -2886,13 +2886,13 @@ static int cxgb_set_tx_maxrate(struct net_device *dev, int index, u32 rate)
	}

	/* Convert from Mbps to Kbps */
	req_rate = rate << 10;
	req_rate = rate * 1000;

	/* Max rate is 100 Gbps */
	if (req_rate >= SCHED_MAX_RATE_KBPS) {
	if (req_rate > SCHED_MAX_RATE_KBPS) {
		dev_err(adap->pdev_dev,
			"Invalid rate %u Mbps, Max rate is %u Mbps\n",
			rate, SCHED_MAX_RATE_KBPS >> 10);
			rate, SCHED_MAX_RATE_KBPS / 1000);
		return -ERANGE;
	}