team: add mode priv to port
authorJiri Pirko <jpirko@redhat.com>
Tue, 19 Jun 2012 05:54:05 +0000 (05:54 +0000)
committerDavid S. Miller <davem@davemloft.net>
Tue, 19 Jun 2012 22:00:22 +0000 (15:00 -0700)
Signed-off-by: Jiri Pirko <jpirko@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/team/team.c
include/linux/if_team.h

index 343f4ffaf8f0b7310c8476825ae80efcc38e2a66..dea2d8afa2f4825e00dac7f1bde94ef0ebbfb008 100644 (file)
@@ -793,7 +793,8 @@ static int team_port_add(struct team *team, struct net_device *port_dev)
                return -EBUSY;
        }
 
-       port = kzalloc(sizeof(struct team_port), GFP_KERNEL);
+       port = kzalloc(sizeof(struct team_port) + team->mode->port_priv_size,
+                      GFP_KERNEL);
        if (!port)
                return -ENOMEM;
 
index d45fcd5a188ddf5e0983095db4ba6f8edce68137..54af95f5d58b7903eb8832a57a8bc82a410c4aad 100644 (file)
@@ -61,6 +61,7 @@ struct team_port {
        } orig;
 
        struct rcu_head rcu;
+       long mode_priv[0];
 };
 
 struct team_mode_ops {
@@ -108,6 +109,7 @@ struct team_mode {
        const char *kind;
        struct module *owner;
        size_t priv_size;
+       size_t port_priv_size;
        const struct team_mode_ops *ops;
 };