- if (vport->ops->flags & VPORT_F_GEN_STATS) {
- spin_lock_bh(&vport->stats_lock);
- vport->offset_stats = *stats;
- spin_unlock_bh(&vport->stats_lock);
-
- return 0;
- } else
- return -EOPNOTSUPP;
-}
-
-/**
- * vport_get_name - retrieve device name
- *
- * @vport: vport from which to retrieve the name.
- *
- * Retrieves the name of the given device. Either RTNL lock or rcu_read_lock
- * must be held for the entire duration that the name is in use.
- */
-const char *vport_get_name(const struct vport *vport)
-{
- return vport->ops->get_name(vport);
-}
-
-/**
- * vport_get_type - retrieve device type
- *
- * @vport: vport from which to retrieve the type.
- *
- * Retrieves the type of the given device.
- */
-enum ovs_vport_type vport_get_type(const struct vport *vport)
-{
- return vport->ops->type;
-}
-
-/**
- * vport_get_addr - retrieve device Ethernet address (for kernel callers)
- *
- * @vport: vport from which to retrieve the Ethernet address.
- *
- * Retrieves the Ethernet address of the given device. Either RTNL lock or
- * rcu_read_lock must be held for the entire duration that the Ethernet address
- * is in use.
- */
-const unsigned char *vport_get_addr(const struct vport *vport)
-{
- return vport->ops->get_addr(vport);
-}
-
-/**
- * vport_get_kobj - retrieve associated kobj
- *
- * @vport: vport from which to retrieve the associated kobj
- *
- * Retrieves the associated kobj or null if no kobj. The returned kobj is
- * valid for as long as the vport exists.
- */
-struct kobject *vport_get_kobj(const struct vport *vport)
-{
- if (vport->ops->get_kobj)
- return vport->ops->get_kobj(vport);
- else
- return NULL;
-}
-
-static int vport_call_get_stats(struct vport *vport, struct rtnl_link_stats64 *stats)
-{
- int err;
-
- rcu_read_lock();
- err = vport->ops->get_stats(vport, stats);
- rcu_read_unlock();
-
- return err;