summaryrefslogtreecommitdiff
path: root/datapath/vport.c
diff options
context:
space:
mode:
authorBen Pfaff <blp@nicira.com>2011-01-23 20:01:30 -0800
committerBen Pfaff <blp@nicira.com>2011-01-27 21:08:37 -0800
commitc283069c71adc49c182a1ac569a05e2dca949eda (patch)
tree5ce28e813049fdb4eedeaefd1dbee931115b7fa9 /datapath/vport.c
parent4c738a8da5c73229ce0d4ab6f88d081886291f03 (diff)
downloadopenvswitch-c283069c71adc49c182a1ac569a05e2dca949eda.tar.gz
datapath: Change vport type from string to integer enumeration.
I plan to make the vport type part of the standard header stuck on each Netlink message related to a vport. As such, it is more convenient to use an integer than a string. In addition, by being fundamentally different from strings, using an integer may reduce the confusion we've had in the past over the differences in userspace and kernel names for network device and vport types. Signed-off-by: Ben Pfaff <blp@nicira.com> Acked-by: Jesse Gross <jesse@nicira.com>
Diffstat (limited to 'datapath/vport.c')
-rw-r--r--datapath/vport.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/datapath/vport.c b/datapath/vport.c
index acb480bb3..2d18f285b 100644
--- a/datapath/vport.c
+++ b/datapath/vport.c
@@ -569,7 +569,7 @@ struct vport *vport_add(const struct vport_parms *parms)
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);
@@ -722,9 +722,9 @@ const char *vport_get_name(const struct vport *vport)
* @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;
}