> -----Original Message----- > From: Alexander Duyck [mailto:alexander.du...@gmail.com] > Sent: Monday, November 23, 2015 10:38 PM > To: Singhai, Anjali; netdev@vger.kernel.org > Cc: je...@kernel.org; Patil, Kiran > Subject: Re: [PATCH v1 2/6] net: Add a generic udp_offload_get_port > function > > On 11/23/2015 01:02 PM, Anjali Singhai Jain wrote: > > The new function udp_offload_get_port replaces vxlan_get_rx_port(). > > This is a generic function that will help replay all udp tunnel ports > > irrespective of tunnel type. > > This way when new udp tunnels get added this function need not change. > > > > Note: Drivers besides i40e are compile tested with this change. > > > > Signed-off-by: Anjali Singhai Jain <anjali.sing...@intel.com> > > Signed-off-by: Kiran Patil <kiran.pa...@intel.com> > > --- > > [...] > > > diff --git a/net/ipv4/udp_offload.c b/net/ipv4/udp_offload.c index > > f938616..8597020 100644 > > --- a/net/ipv4/udp_offload.c > > +++ b/net/ipv4/udp_offload.c > > @@ -290,6 +290,33 @@ unlock: > > } > > EXPORT_SYMBOL(udp_del_offload); > > > > +void udp_offload_get_port(struct net_device *dev) { > > + struct udp_offload_priv __rcu **head; > > + struct udp_offload_priv *uo_priv; > > + struct udp_offload *uo; > > + > > + if (udp_offload_base) > > + head = &udp_offload_base; > > + else > > + return; > > + > > + spin_lock(&udp_offload_lock); > > + uo_priv = udp_deref_protected(*head); > > + for (; uo_priv != NULL; uo_priv = udp_deref_protected(*head)) { > > + /* call the right add port */ > > + uo = uo_priv->offload; > > + if (uo && dev->netdev_ops->ndo_add_udp_tunnel_port) > > + dev->netdev_ops->ndo_add_udp_tunnel_port(dev, > > + uo->family, > > + uo->port, > > + uo->tunnel_type); > > + head = &uo_priv->next; > > + } > > + spin_unlock(&udp_offload_lock); > > +} > > +EXPORT_SYMBOL(udp_offload_get_port); > > + > > struct sk_buff **udp_gro_receive(struct sk_buff **head, struct sk_buff > *skb, > > struct udphdr *uh) > > { > > > > So when I got to patch 5 I realized this approach is horribly broken for > IPv6 tunnels. The udp_offload_base is only populated if the family is > AF_INET. What do you guys plan to do to get support for AF_INET6? > > You probably ought to look at something like what ended up being done for > the IOAT stuff. What you end up needing is to support the drivers querying > for what ports are active, and receiving notifications of tunnel updates, and > the tunnel side that will register some functionality allowing the active > ports > for a given tunnel type to be queried. > > - Alex
Alex you are right about the IPv6 handling and I will update the patch series to help fix that. -- To unsubscribe from this list: send the line "unsubscribe netdev" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html