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;
}