Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net
[cascardo/linux.git] / include / linux / if_team.h
index 16fae64..f6156f9 100644 (file)
@@ -69,6 +69,7 @@ struct team_port {
        s32 priority; /* lower number ~ higher priority */
        u16 queue_id;
        struct list_head qom_list; /* node in queue override mapping list */
+       struct rcu_head rcu;
        long mode_priv[0];
 };
 
@@ -228,6 +229,16 @@ static inline struct team_port *team_get_port_by_index(struct team *team,
                        return port;
        return NULL;
 }
+
+static inline int team_num_to_port_index(struct team *team, int num)
+{
+       int en_port_count = ACCESS_ONCE(team->en_port_count);
+
+       if (unlikely(!en_port_count))
+               return 0;
+       return num % en_port_count;
+}
+
 static inline struct team_port *team_get_port_by_index_rcu(struct team *team,
                                                           int port_index)
 {