summaryrefslogtreecommitdiff
path: root/link.c
diff options
context:
space:
mode:
authorDaniel Borkmann <dborkman@redhat.com>2013-07-11 17:21:09 +0200
committerDaniel Borkmann <dborkman@redhat.com>2013-07-11 17:21:09 +0200
commit4c139be17d5d26a1bba81c0775ca5c8fb3a6b181 (patch)
tree693ce5ee2e0d565f5b593d6a2cb89e6dfd2e70b2 /link.c
parentf1c783dc1c66b8868f011f327bf4e113a05f18f7 (diff)
link: allow future ethtool speed formats to be supported
In case some in the near future NICs with 40Gbit/s will appear. Allow ifpps to get the correct ethtool speed. Signed-off-by: Daniel Borkmann <dborkman@redhat.com>
Diffstat (limited to 'link.c')
-rw-r--r--link.c13
1 files changed, 2 insertions, 11 deletions
diff --git a/link.c b/link.c
index 95f0816..eb3ba18 100644
--- a/link.c
+++ b/link.c
@@ -99,18 +99,9 @@ u32 ethtool_bitrate(const char *ifname)
goto out;
}
- switch (ecmd.speed) {
- case SPEED_10:
- case SPEED_100:
- case SPEED_1000:
- case SPEED_2500:
- case SPEED_10000:
- bitrate = ecmd.speed;
- break;
- default:
+ bitrate = ethtool_cmd_speed(&ecmd);
+ if (bitrate == SPEED_UNKNOWN)
bitrate = 0;
- break;
- };
out:
close(sock);