datapath: Remove unneeded ovs_netdev_get_ifindex()
authorThomas Graf <tgraf@suug.ch>
Tue, 30 Apr 2013 15:47:42 +0000 (08:47 -0700)
committerJesse Gross <jesse@nicira.com>
Tue, 30 Apr 2013 15:51:40 +0000 (08:51 -0700)
The only user is get_dpifindex(), no need to redirect via the port
operations.

Signed-off-by: Thomas Graf <tgraf@suug.ch>
Signed-off-by: Jesse Gross <jesse@nicira.com>
datapath/datapath.c
datapath/vport-internal_dev.c
datapath/vport-netdev.c
datapath/vport-netdev.h
datapath/vport.h

index 3cb58b0..cf901d2 100644 (file)
@@ -60,6 +60,7 @@
 #include "vlan.h"
 #include "tunnel.h"
 #include "vport-internal_dev.h"
+#include "vport-netdev.h"
 
 #if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,18) || \
     LINUX_VERSION_CODE >= KERNEL_VERSION(3,9,0)
@@ -159,7 +160,7 @@ static int get_dpifindex(struct datapath *dp)
 
        local = ovs_vport_rcu(dp, OVSP_LOCAL);
        if (local)
-               ifindex = local->ops->get_ifindex(local);
+               ifindex = netdev_vport_priv(local)->dev->ifindex;
        else
                ifindex = 0;
 
index b425d76..1e8c304 100644 (file)
@@ -298,7 +298,6 @@ const struct vport_ops ovs_internal_vport_ops = {
        .create         = internal_dev_create,
        .destroy        = internal_dev_destroy,
        .get_name       = ovs_netdev_get_name,
-       .get_ifindex    = ovs_netdev_get_ifindex,
        .send           = internal_dev_recv,
 };
 
index 808ec34..4558079 100644 (file)
@@ -227,12 +227,6 @@ const char *ovs_netdev_get_name(const struct vport *vport)
        return netdev_vport->dev->name;
 }
 
-int ovs_netdev_get_ifindex(const struct vport *vport)
-{
-       const struct netdev_vport *netdev_vport = netdev_vport_priv(vport);
-       return netdev_vport->dev->ifindex;
-}
-
 /* Must be called with rcu_read_lock. */
 static void netdev_port_receive(struct vport *vport, struct sk_buff *skb)
 {
@@ -400,7 +394,6 @@ const struct vport_ops ovs_netdev_vport_ops = {
        .create         = netdev_create,
        .destroy        = netdev_destroy,
        .get_name       = ovs_netdev_get_name,
-       .get_ifindex    = ovs_netdev_get_ifindex,
        .send           = netdev_send,
 };
 
index 6478079..a3cb3a3 100644 (file)
@@ -40,6 +40,5 @@ netdev_vport_priv(const struct vport *vport)
 
 const char *ovs_netdev_get_name(const struct vport *);
 const char *ovs_netdev_get_config(const struct vport *);
-int ovs_netdev_get_ifindex(const struct vport *);
 
 #endif /* vport_netdev.h */
index 5c213e9..7233e4f 100644 (file)
@@ -139,7 +139,6 @@ struct vport_parms {
  * have any configuration.
  * @get_name: Get the device's name.
  * @get_config: Get the device's configuration.
- * @get_ifindex: Get the system interface index associated with the device.
  * May be null if the device does not have an ifindex.
  * @send: Send a packet on the device.  Returns the length of the packet sent.
  */
@@ -161,7 +160,7 @@ struct vport_ops {
        /* Called with rcu_read_lock or ovs_mutex. */
        const char *(*get_name)(const struct vport *);
        void (*get_config)(const struct vport *, void *);
-       int (*get_ifindex)(const struct vport *);
+
        int (*send)(struct vport *, struct sk_buff *);
 };