2
0
mirror of https://github.com/openvswitch/ovs synced 2025-09-05 08:45:23 +00:00

datapath: Drop datapath index and port number from Ethtool output.

I introduced this a long time ago as an efficient way for userspace to find
out whether and where an internal device was attached, but I've always
considered it an ugly kluge.  Now that ODP_VPORT_QUERY can fetch a vport's
info regardless of datapath, it is no longer necessary.  This commit
stops using Ethtool for this purpose and drops the feature.

Signed-off-by: Ben Pfaff <blp@nicira.com>
Acked-by: Jesse Gross <jesse@nicira.com>
This commit is contained in:
Ben Pfaff
2010-12-29 14:20:16 -08:00
parent 51d4d59822
commit 9fe3b9a2ee
5 changed files with 86 additions and 61 deletions

View File

@@ -47,6 +47,7 @@
#include <unistd.h>
#include "coverage.h"
#include "dpif-linux.h"
#include "dynamic-string.h"
#include "fatal-signal.h"
#include "hash.h"
@@ -1105,22 +1106,8 @@ netdev_linux_update_is_pseudo(struct netdev_dev_linux *netdev_dev)
const char *type = netdev_dev_get_type(&netdev_dev->netdev_dev);
netdev_dev->is_tap = !strcmp(type, "tap");
netdev_dev->is_internal = false;
if (!netdev_dev->is_tap) {
struct ethtool_drvinfo drvinfo;
int error;
memset(&drvinfo, 0, sizeof drvinfo);
error = netdev_linux_do_ethtool(name,
(struct ethtool_cmd *)&drvinfo,
ETHTOOL_GDRVINFO,
"ETHTOOL_GDRVINFO");
if (!error && !strcmp(drvinfo.driver, "openvswitch")) {
netdev_dev->is_internal = true;
}
}
netdev_dev->is_internal = (!netdev_dev->is_tap
&& dpif_linux_is_internal_device(name));
netdev_dev->cache_valid |= VALID_IS_PSEUDO;
}
}