Re: [net-next 01/10] net: Rename ndo_add_vxlan_port to ndo_add_udp_tunnel_port.
From: Andy Zhou <hidden>
Date: 2014-07-24 20:28:06
On Wed, Jul 23, 2014 at 11:40 PM, Or Gerlitz [off-list ref] wrote:
On Tue, Jul 22, 2014 at 1:19 PM, Andy Zhou [off-list ref] wrote:quoted
Rename ndo_add_vxlan_port() API provided by net_device_ops to ndo_add_udp_tunnel_port(). Generalized the API in preparation for up coming NICs and device drivers that may support offloading more UDP tunnels protocols besides VxLAN. There is no behavioral changes with this patch.[..]quoted
--- a/drivers/net/vxlan.c +++ b/drivers/net/vxlan.c@@ -650,9 +650,11 @@ static void vxlan_notify_add_rx_port(struct vxlan_sock *vs) rcu_read_lock(); for_each_netdev_rcu(net, dev) { - if (dev->netdev_ops->ndo_add_vxlan_port) - dev->netdev_ops->ndo_add_vxlan_port(dev, sa_family, - port); + if (!dev->netdev_ops->ndo_add_udp_tunnel_port) + continue; + + dev->netdev_ops->ndo_add_udp_tunnel_port(dev, sa_family, port, + UDP_TUNNEL_TYPE_VXLAN); } rcu_read_unlock(); }Such changes should be done in a manner which is as minimal as possible and not introduce further cleanups or style modifications, here the existing code say if(ndo X is supported by dev Y) call it Please stick to this and just replace the ndo name in this patchquoted
@@ -668,9 +670,10 @@ static void vxlan_notify_del_rx_port(struct vxlan_sock *vs) rcu_read_lock(); for_each_netdev_rcu(net, dev) { - if (dev->netdev_ops->ndo_del_vxlan_port) - dev->netdev_ops->ndo_del_vxlan_port(dev, sa_family, - port); + if (!dev->netdev_ops->ndo_del_udp_tunnel_port) + continue; + dev->netdev_ops->ndo_del_udp_tunnel_port(dev, sa_family, port, + UDP_TUNNEL_TYPE_VXLAN); } rcu_read_unlock();same here
O.K. I will revert them back.