From: Eugenia Emantayev Date: Tue, 8 Jul 2014 08:25:19 +0000 (+0300) Subject: net/mlx4_en: Fix set port ratelimit for 40GE X-Git-Tag: omap-for-v3.17/fixes-against-rc2~149^2~203^2~5 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=523ece889eeee84a381e16086b81e07a76cff8b6;p=pandora-kernel.git net/mlx4_en: Fix set port ratelimit for 40GE In 40GE we can't use the default bw units for set ratelimit (100 Mbps) since the max is 255*100 Mbps = 25 Gbps (not suited for 40GE), thus we need 1 Gbps units. But for 10GE 1 Gbps units might be too bruit so we use the following solution. For user set ratelimit <= 25 Gbps: use 100 Mbps units * user_ratelimit (* 10). For user set ratelimit > 25 Gbps: use 1 Gbps units * user_ratelimit. For user set unlimited ratelimit (0 Gbps): use 1 Gbps units * MAX_RATELIMIT_DEFAULT (57) Note: any value > 58 will damage the FW ratelimit computation, so we allow a max and any higher value will be pulled down to 57. Signed-off-by: Sagi Grimberg Signed-off-by: Eugenia Emantayev Signed-off-by: Amir Vadai Signed-off-by: David S. Miller --- Reading git-diff-tree failed