]> rtime.felk.cvut.cz Git - linux-imx.git/commitdiff
openvswitch: Remove unneeded ovs_netdev_get_ifindex()
authorThomas Graf <tgraf@suug.ch>
Mon, 29 Apr 2013 13:06:41 +0000 (13:06 +0000)
committerDavid S. Miller <davem@davemloft.net>
Tue, 30 Apr 2013 04:19:11 +0000 (00:19 -0400)
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: David S. Miller <davem@davemloft.net>
net/openvswitch/datapath.c
net/openvswitch/vport-internal_dev.c
net/openvswitch/vport-netdev.c
net/openvswitch/vport-netdev.h
net/openvswitch/vport.h

index 74a5fe6feae3418453a490d3214e5887394abe6f..d12d6b8b5e8b1e4cd7d0f6504882fb47a866c52c 100644 (file)
@@ -56,6 +56,7 @@
 #include "datapath.h"
 #include "flow.h"
 #include "vport-internal_dev.h"
+#include "vport-netdev.h"
 
 
 #define REHASH_FLOW_INTERVAL (10 * 60 * HZ)
@@ -151,7 +152,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 73682de8dc69c49905f24548f32c624f6c1d333f..84e0a03791867449247cc0c161ab434f9a6e5c15 100644 (file)
@@ -232,7 +232,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 40a89ae8e19fd8556d4c51ac635bf029eddb634b..4f01c6d2ffa40dcdb92856d6b35782a43679ad66 100644 (file)
@@ -150,12 +150,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;
-}
-
 static unsigned int packet_length(const struct sk_buff *skb)
 {
        unsigned int length = skb->len - ETH_HLEN;
@@ -206,6 +200,5 @@ 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 6478079b3417fd460c9011048be234d62b3478c2..a3cb3a32cd77140369a448337120c79f8a040ab0 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 7ba08c30b853e597b6bce2157695a6f08f58a808..68a377bc0841e7bfd0a5b1200a4a3b938adc9251 100644 (file)
@@ -124,7 +124,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.
  */
@@ -141,7 +140,6 @@ 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 *);
 };