diff options
author | parav.pandit@emulex.com <parav.pandit@emulex.com> | 2012-06-27 03:56:12 +0000 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2012-06-27 15:42:24 -0700 |
commit | e440cf2ca0a1b075c64016240d46c3aa9d877bbf (patch) | |
tree | b1f184779750ce985f8a2372a2d24a4fea50714b /net | |
parent | 22911fc581f6a241e2897a7a8603e97344a6ec82 (diff) | |
download | op-kernel-dev-e440cf2ca0a1b075c64016240d46c3aa9d877bbf.zip op-kernel-dev-e440cf2ca0a1b075c64016240d46c3aa9d877bbf.tar.gz |
net: added support for 40GbE link.
1. removed code replication for tov calculation for 1G, 10G and
made is common for speed > 1G (1G, 10G, 40G, 100G).
2. defines values for #4 different 40G Phys (KR4, LF4, SR4, CR4)
Signed-off-by: Parav Pandit <parav.pandit@emulex.com>
Reviewed-by: Ben Hutchings <bhutchings@solarflare.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net')
-rw-r--r-- | net/packet/af_packet.c | 18 |
1 files changed, 6 insertions, 12 deletions
diff --git a/net/packet/af_packet.c b/net/packet/af_packet.c index 8a10d5b..ceaca7c 100644 --- a/net/packet/af_packet.c +++ b/net/packet/af_packet.c @@ -531,6 +531,7 @@ static int prb_calc_retire_blk_tmo(struct packet_sock *po, unsigned int mbits = 0, msec = 0, div = 0, tmo = 0; struct ethtool_cmd ecmd; int err; + u32 speed; rtnl_lock(); dev = __dev_get_by_index(sock_net(&po->sk), po->ifindex); @@ -539,25 +540,18 @@ static int prb_calc_retire_blk_tmo(struct packet_sock *po, return DEFAULT_PRB_RETIRE_TOV; } err = __ethtool_get_settings(dev, &ecmd); + speed = ethtool_cmd_speed(&ecmd); rtnl_unlock(); if (!err) { - switch (ecmd.speed) { - case SPEED_10000: - msec = 1; - div = 10000/1000; - break; - case SPEED_1000: - msec = 1; - div = 1000/1000; - break; /* * If the link speed is so slow you don't really * need to worry about perf anyways */ - case SPEED_100: - case SPEED_10: - default: + if (speed < SPEED_1000 || speed == SPEED_UNKNOWN) { return DEFAULT_PRB_RETIRE_TOV; + } else { + msec = 1; + div = speed / 1000; } } |