return err;
}
-static void vport_del_all(void)
-{
- int i;
-
- rtnl_lock();
- vport_lock();
-
- for (i = 0; i < VPORT_HASH_BUCKETS; i++) {
- struct hlist_head *bucket = &dev_table[i];
- struct vport *vport;
- struct hlist_node *node, *next;
-
- hlist_for_each_entry_safe(vport, node, next, bucket, hash_node)
- vport_del(vport);
- }
-
- vport_unlock();
- rtnl_unlock();
-}
-
/**
* vport_exit - shutdown vport subsystem
*
{
int i;
- vport_del_all();
-
for (i = 0; i < n_vport_types; i++) {
if (vport_ops_list[i]->exit)
vport_ops_list[i]->exit();
ASSERT_VPORT();
for (i = 0; i < n_vport_types; i++) {
- if (!strcmp(vport_ops_list[i]->type, parms->type)) {
+ if (vport_ops_list[i]->type == parms->type) {
vport = vport_ops_list[i]->create(parms);
if (IS_ERR(vport)) {
err = PTR_ERR(vport);
spin_unlock_bh(&vport->stats_lock);
return 0;
- } else if (vport->ops->set_stats)
- return vport->ops->set_stats(vport, stats);
- else
+ } else
return -EOPNOTSUPP;
}
* @vport: vport from which to retrieve the type.
*
* Retrieves the type of the given device. Either RTNL lock or rcu_read_lock
- * must be held for the entire duration that the type is in use.
+ * must be held.
*/
-const char *vport_get_type(const struct vport *vport)
+enum odp_vport_type vport_get_type(const struct vport *vport)
{
return vport->ops->type;
}