- err = netdev_vport_do_ioctl(ODP_VPORT_MTU_GET, &vport_mtu);
- if (err) {
- return err;
- }
-
- *mtup = vport_mtu.mtu;
- return 0;
-}
-
-int
-netdev_vport_get_stats(const struct netdev *netdev, struct netdev_stats *stats)
-{
- const char *name = netdev_get_name(netdev);
- struct odp_vport_stats_req ovsr;
- int err;
-
- ovs_strlcpy(ovsr.devname, name, sizeof ovsr.devname);
- err = netdev_vport_do_ioctl(ODP_VPORT_STATS_GET, &ovsr);
- if (err) {
- return err;
- }
-
- stats->rx_packets = ovsr.stats.rx_packets;
- stats->tx_packets = ovsr.stats.tx_packets;
- stats->rx_bytes = ovsr.stats.rx_bytes;
- stats->tx_bytes = ovsr.stats.tx_bytes;
- stats->rx_errors = ovsr.stats.rx_errors;
- stats->tx_errors = ovsr.stats.tx_errors;
- stats->rx_dropped = ovsr.stats.rx_dropped;
- stats->tx_dropped = ovsr.stats.tx_dropped;
- stats->multicast = ovsr.stats.multicast;
- stats->collisions = ovsr.stats.collisions;
- stats->rx_length_errors = ovsr.stats.rx_length_errors;
- stats->rx_over_errors = ovsr.stats.rx_over_errors;
- stats->rx_crc_errors = ovsr.stats.rx_crc_errors;
- stats->rx_frame_errors = ovsr.stats.rx_frame_errors;
- stats->rx_fifo_errors = ovsr.stats.rx_fifo_errors;
- stats->rx_missed_errors = ovsr.stats.rx_missed_errors;
- stats->tx_aborted_errors = ovsr.stats.tx_aborted_errors;
- stats->tx_carrier_errors = ovsr.stats.tx_carrier_errors;
- stats->tx_fifo_errors = ovsr.stats.tx_fifo_errors;
- stats->tx_heartbeat_errors = ovsr.stats.tx_heartbeat_errors;
- stats->tx_window_errors = ovsr.stats.tx_window_errors;
-
- return 0;
-}
-
-int
-netdev_vport_set_stats(struct netdev *netdev, const struct netdev_stats *stats)
-{
- struct odp_vport_stats_req ovsr;
- int err;
-
- ovs_strlcpy(ovsr.devname, netdev_get_name(netdev), sizeof ovsr.devname);
-
- ovsr.stats.rx_packets = stats->rx_packets;
- ovsr.stats.tx_packets = stats->tx_packets;
- ovsr.stats.rx_bytes = stats->rx_bytes;
- ovsr.stats.tx_bytes = stats->tx_bytes;
- ovsr.stats.rx_errors = stats->rx_errors;
- ovsr.stats.tx_errors = stats->tx_errors;
- ovsr.stats.rx_dropped = stats->rx_dropped;
- ovsr.stats.tx_dropped = stats->tx_dropped;
- ovsr.stats.multicast = stats->multicast;
- ovsr.stats.collisions = stats->collisions;
- ovsr.stats.rx_length_errors = stats->rx_length_errors;
- ovsr.stats.rx_over_errors = stats->rx_over_errors;
- ovsr.stats.rx_crc_errors = stats->rx_crc_errors;
- ovsr.stats.rx_frame_errors = stats->rx_frame_errors;
- ovsr.stats.rx_fifo_errors = stats->rx_fifo_errors;
- ovsr.stats.rx_missed_errors = stats->rx_missed_errors;
- ovsr.stats.tx_aborted_errors = stats->tx_aborted_errors;
- ovsr.stats.tx_carrier_errors = stats->tx_carrier_errors;
- ovsr.stats.tx_fifo_errors = stats->tx_fifo_errors;
- ovsr.stats.tx_heartbeat_errors = stats->tx_heartbeat_errors;
- ovsr.stats.tx_window_errors = stats->tx_window_errors;
-
- err = netdev_vport_do_ioctl(ODP_VPORT_STATS_SET, &ovsr);
-
- /* 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_status(const struct netdev *netdev, struct shash *sh)
-{
- const char *iface = netdev_vport_get_tnl_iface(netdev);
-
- if (iface) {