From d5de5b0d7ec2c3bf0eb1243145bd31efbf3078fd Mon Sep 17 00:00:00 2001 From: Thomas Graf Date: Tue, 30 Apr 2013 08:47:42 -0700 Subject: [PATCH] datapath: Remove unneeded ovs_netdev_get_ifindex() The only user is get_dpifindex(), no need to redirect via the port operations. Signed-off-by: Thomas Graf Signed-off-by: Jesse Gross --- datapath/datapath.c | 3 ++- datapath/vport-internal_dev.c | 1 - datapath/vport-netdev.c | 7 ------- datapath/vport-netdev.h | 1 - datapath/vport.h | 3 +-- 5 files changed, 3 insertions(+), 12 deletions(-) diff --git a/datapath/datapath.c b/datapath/datapath.c index 3cb58b0ee..cf901d258 100644 --- a/datapath/datapath.c +++ b/datapath/datapath.c @@ -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; diff --git a/datapath/vport-internal_dev.c b/datapath/vport-internal_dev.c index b425d7679..1e8c3043c 100644 --- a/datapath/vport-internal_dev.c +++ b/datapath/vport-internal_dev.c @@ -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, }; diff --git a/datapath/vport-netdev.c b/datapath/vport-netdev.c index 808ec34e2..455807906 100644 --- a/datapath/vport-netdev.c +++ b/datapath/vport-netdev.c @@ -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, }; diff --git a/datapath/vport-netdev.h b/datapath/vport-netdev.h index 6478079b3..a3cb3a32c 100644 --- a/datapath/vport-netdev.h +++ b/datapath/vport-netdev.h @@ -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 */ diff --git a/datapath/vport.h b/datapath/vport.h index 5c213e909..7233e4f47 100644 --- a/datapath/vport.h +++ b/datapath/vport.h @@ -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 *); }; -- 2.43.0