Merge tag 'amlogic-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/khilman...
[linux-2.6-microblaze.git] / include / net / udp_tunnel.h
index 94bb7a8..2ea453d 100644 (file)
@@ -200,11 +200,27 @@ enum udp_tunnel_nic_info_flags {
        UDP_TUNNEL_NIC_INFO_STATIC_IANA_VXLAN   = BIT(3),
 };
 
+struct udp_tunnel_nic;
+
+#define UDP_TUNNEL_NIC_MAX_SHARING_DEVICES     (U16_MAX / 2)
+
+struct udp_tunnel_nic_shared {
+       struct udp_tunnel_nic *udp_tunnel_nic_info;
+
+       struct list_head devices;
+};
+
+struct udp_tunnel_nic_shared_node {
+       struct net_device *dev;
+       struct list_head list;
+};
+
 /**
  * struct udp_tunnel_nic_info - driver UDP tunnel offload information
  * @set_port:  callback for adding a new port
  * @unset_port:        callback for removing a port
  * @sync_table:        callback for syncing the entire port table at once
+ * @shared:    reference to device global state (optional)
  * @flags:     device flags from enum udp_tunnel_nic_info_flags
  * @tables:    UDP port tables this device has
  * @tables.n_entries:          number of entries in this table
@@ -213,6 +229,12 @@ enum udp_tunnel_nic_info_flags {
  * Drivers are expected to provide either @set_port and @unset_port callbacks
  * or the @sync_table callback. Callbacks are invoked with rtnl lock held.
  *
+ * Devices which (misguidedly) share the UDP tunnel port table across multiple
+ * netdevs should allocate an instance of struct udp_tunnel_nic_shared and
+ * point @shared at it.
+ * There must never be more than %UDP_TUNNEL_NIC_MAX_SHARING_DEVICES devices
+ * sharing a table.
+ *
  * Known limitations:
  *  - UDP tunnel port notifications are fundamentally best-effort -
  *    it is likely the driver will both see skbs which use a UDP tunnel port,
@@ -234,6 +256,8 @@ struct udp_tunnel_nic_info {
        /* all at once */
        int (*sync_table)(struct net_device *dev, unsigned int table);
 
+       struct udp_tunnel_nic_shared *shared;
+
        unsigned int flags;
 
        struct udp_tunnel_nic_table_info {