Skip to content

Commit

Permalink
openvswitch: Remove unneeded ovs_netdev_get_ifindex()
Browse files Browse the repository at this point in the history
The only user is get_dpifindex(), no need to redirect via the port
operations.

Signed-off-by: Thomas Graf <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
  • Loading branch information
tgraf authored and davem330 committed Apr 30, 2013
1 parent 0c77215 commit cff63a5
Show file tree
Hide file tree
Showing 5 changed files with 2 additions and 12 deletions.
3 changes: 2 additions & 1 deletion net/openvswitch/datapath.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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;

Expand Down
1 change: 0 additions & 1 deletion net/openvswitch/vport-internal_dev.c
Original file line number Diff line number Diff line change
Expand Up @@ -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,
};

Expand Down
7 changes: 0 additions & 7 deletions net/openvswitch/vport-netdev.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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,
};
1 change: 0 additions & 1 deletion net/openvswitch/vport-netdev.h
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
2 changes: 0 additions & 2 deletions net/openvswitch/vport.h
Original file line number Diff line number Diff line change
Expand Up @@ -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.
*/
Expand All @@ -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 *);
};
Expand Down

0 comments on commit cff63a5

Please sign in to comment.