diff options
author | parav.pandit@emulex.com <parav.pandit@emulex.com> | 2012-06-26 23:56:12 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2012-06-27 18:42:24 -0400 |
commit | e440cf2ca0a1b075c64016240d46c3aa9d877bbf (patch) | |
tree | b1f184779750ce985f8a2372a2d24a4fea50714b /net/packet | |
parent | 22911fc581f6a241e2897a7a8603e97344a6ec82 (diff) |
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/packet')
-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 8a10d5b3c832..ceaca7c134a0 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, | |||
531 | unsigned int mbits = 0, msec = 0, div = 0, tmo = 0; | 531 | unsigned int mbits = 0, msec = 0, div = 0, tmo = 0; |
532 | struct ethtool_cmd ecmd; | 532 | struct ethtool_cmd ecmd; |
533 | int err; | 533 | int err; |
534 | u32 speed; | ||
534 | 535 | ||
535 | rtnl_lock(); | 536 | rtnl_lock(); |
536 | dev = __dev_get_by_index(sock_net(&po->sk), po->ifindex); | 537 | 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, | |||
539 | return DEFAULT_PRB_RETIRE_TOV; | 540 | return DEFAULT_PRB_RETIRE_TOV; |
540 | } | 541 | } |
541 | err = __ethtool_get_settings(dev, &ecmd); | 542 | err = __ethtool_get_settings(dev, &ecmd); |
543 | speed = ethtool_cmd_speed(&ecmd); | ||
542 | rtnl_unlock(); | 544 | rtnl_unlock(); |
543 | if (!err) { | 545 | if (!err) { |
544 | switch (ecmd.speed) { | ||
545 | case SPEED_10000: | ||
546 | msec = 1; | ||
547 | div = 10000/1000; | ||
548 | break; | ||
549 | case SPEED_1000: | ||
550 | msec = 1; | ||
551 | div = 1000/1000; | ||
552 | break; | ||
553 | /* | 546 | /* |
554 | * If the link speed is so slow you don't really | 547 | * If the link speed is so slow you don't really |
555 | * need to worry about perf anyways | 548 | * need to worry about perf anyways |
556 | */ | 549 | */ |
557 | case SPEED_100: | 550 | if (speed < SPEED_1000 || speed == SPEED_UNKNOWN) { |
558 | case SPEED_10: | ||
559 | default: | ||
560 | return DEFAULT_PRB_RETIRE_TOV; | 551 | return DEFAULT_PRB_RETIRE_TOV; |
552 | } else { | ||
553 | msec = 1; | ||
554 | div = speed / 1000; | ||
561 | } | 555 | } |
562 | } | 556 | } |
563 | 557 | ||