switchdev: introduce transaction item queue for attr_set and obj_add

Now, the memory allocation in prepare/commit state is done separatelly
in each driver (rocker). Introduce the similar mechanism in generic
switchdev code, in form of queue. That can be used not only for memory
allocations, but also for different items. Abort item destruction
is handled as well.

Signed-off-by: Jiri Pirko <jiri@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
Jiri Pirko 2015-09-24 10:02:41 +02:00 committed by David S. Miller
parent 69f5df491e
commit 7ea6eb3f56
5 changed files with 146 additions and 20 deletions

View file

@ -456,7 +456,8 @@ static int dsa_slave_stp_update(struct net_device *dev, u8 state)
}
static int dsa_slave_port_attr_set(struct net_device *dev,
struct switchdev_attr *attr)
struct switchdev_attr *attr,
struct switchdev_trans *trans)
{
int ret = 0;
@ -474,7 +475,8 @@ static int dsa_slave_port_attr_set(struct net_device *dev,
}
static int dsa_slave_port_obj_add(struct net_device *dev,
struct switchdev_obj *obj)
struct switchdev_obj *obj,
struct switchdev_trans *trans)
{
int err;