2
0
mirror of https://github.com/openvswitch/ovs synced 2025-10-29 15:28:56 +00:00

netdev-vport: Remove set_stats() implementation.

The only user of netdev_set_stats() is bonding (for updating the
fake interface).  This interface is never a vport, so it seems
quite a bit cleaner to keep the relevant code in the netdev-linux
library where it's needed, instead of in netdev-vport, where it
adds needless complexity.

Signed-off-by: Ethan Jackson <ethan@nicira.com>
This commit is contained in:
Ethan Jackson
2012-11-30 16:12:03 -08:00
parent 552e20d02a
commit 2f31a8229e
3 changed files with 37 additions and 45 deletions

View File

@@ -377,21 +377,6 @@ netdev_stats_from_ovs_vport_stats(struct netdev_stats *dst,
dst->tx_window_errors = 0;
}
/* Copies 'src' into 'dst', performing format conversion in the process. */
static void
netdev_stats_to_ovs_vport_stats(struct ovs_vport_stats *dst,
const struct netdev_stats *src)
{
dst->rx_packets = src->rx_packets;
dst->tx_packets = src->tx_packets;
dst->rx_bytes = src->rx_bytes;
dst->tx_bytes = src->tx_bytes;
dst->rx_errors = src->rx_errors;
dst->tx_errors = src->tx_errors;
dst->rx_dropped = src->rx_dropped;
dst->tx_dropped = src->tx_dropped;
}
int
netdev_vport_get_stats(const struct netdev *netdev, struct netdev_stats *stats)
{
@@ -414,33 +399,6 @@ netdev_vport_get_stats(const struct netdev *netdev, struct netdev_stats *stats)
return 0;
}
int
netdev_vport_set_stats(struct netdev *netdev, const struct netdev_stats *stats)
{
struct ovs_vport_stats rtnl_stats;
struct dpif_linux_vport vport;
int err;
netdev_stats_to_ovs_vport_stats(&rtnl_stats, stats);
dpif_linux_vport_init(&vport);
vport.cmd = OVS_VPORT_CMD_SET;
vport.name = netdev_get_name(netdev);
vport.stats = &rtnl_stats;
err = dpif_linux_vport_transact(&vport, NULL, NULL);
/* If the vport layer doesn't know about the device, that doesn't mean it
* doesn't exist (after all were able to open it when netdev_open() was
* called), it just means that it isn't attached and we'll be getting
* stats a different way. */
if (err == ENODEV) {
err = EOPNOTSUPP;
}
return err;
}
static int
netdev_vport_get_drv_info(const struct netdev *netdev, struct smap *smap)
{
@@ -932,7 +890,7 @@ unparse_patch_config(const char *name OVS_UNUSED, const char *type OVS_UNUSED,
NULL, /* get_carrier_resets */ \
NULL, /* get_miimon */ \
netdev_vport_get_stats, \
netdev_vport_set_stats, \
NULL, /* set_stats */ \
\
NULL, /* get_features */ \
NULL, /* set_advertisements */ \