Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

openvswitch: 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 <tgraf@suug.ch>
Signed-off-by: David S. Miller <davem@davemloft.net>

authored by

Thomas Graf and committed by
David S. Miller
cff63a52 0c772159

+2 -12
+2 -1
net/openvswitch/datapath.c
··· 56 56 #include "datapath.h" 57 57 #include "flow.h" 58 58 #include "vport-internal_dev.h" 59 + #include "vport-netdev.h" 59 60 60 61 61 62 #define REHASH_FLOW_INTERVAL (10 * 60 * HZ) ··· 152 151 153 152 local = ovs_vport_rcu(dp, OVSP_LOCAL); 154 153 if (local) 155 - ifindex = local->ops->get_ifindex(local); 154 + ifindex = netdev_vport_priv(local)->dev->ifindex; 156 155 else 157 156 ifindex = 0; 158 157
-1
net/openvswitch/vport-internal_dev.c
··· 232 232 .create = internal_dev_create, 233 233 .destroy = internal_dev_destroy, 234 234 .get_name = ovs_netdev_get_name, 235 - .get_ifindex = ovs_netdev_get_ifindex, 236 235 .send = internal_dev_recv, 237 236 }; 238 237
-7
net/openvswitch/vport-netdev.c
··· 150 150 return netdev_vport->dev->name; 151 151 } 152 152 153 - int ovs_netdev_get_ifindex(const struct vport *vport) 154 - { 155 - const struct netdev_vport *netdev_vport = netdev_vport_priv(vport); 156 - return netdev_vport->dev->ifindex; 157 - } 158 - 159 153 static unsigned int packet_length(const struct sk_buff *skb) 160 154 { 161 155 unsigned int length = skb->len - ETH_HLEN; ··· 200 206 .create = netdev_create, 201 207 .destroy = netdev_destroy, 202 208 .get_name = ovs_netdev_get_name, 203 - .get_ifindex = ovs_netdev_get_ifindex, 204 209 .send = netdev_send, 205 210 };
-1
net/openvswitch/vport-netdev.h
··· 40 40 41 41 const char *ovs_netdev_get_name(const struct vport *); 42 42 const char *ovs_netdev_get_config(const struct vport *); 43 - int ovs_netdev_get_ifindex(const struct vport *); 44 43 45 44 #endif /* vport_netdev.h */
-2
net/openvswitch/vport.h
··· 124 124 * have any configuration. 125 125 * @get_name: Get the device's name. 126 126 * @get_config: Get the device's configuration. 127 - * @get_ifindex: Get the system interface index associated with the device. 128 127 * May be null if the device does not have an ifindex. 129 128 * @send: Send a packet on the device. Returns the length of the packet sent. 130 129 */ ··· 140 141 /* Called with rcu_read_lock or ovs_mutex. */ 141 142 const char *(*get_name)(const struct vport *); 142 143 void (*get_config)(const struct vport *, void *); 143 - int (*get_ifindex)(const struct vport *); 144 144 145 145 int (*send)(struct vport *, struct sk_buff *); 146 146 };