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>
此提交包含在:
Jiri Pirko
2015-09-24 10:02:41 +02:00
提交者 David S. Miller
父節點 69f5df491e
當前提交 7ea6eb3f56
共有 5 個檔案被更改,包括 146 行新增20 行删除

查看文件

@@ -4383,7 +4383,8 @@ static int rocker_port_brport_flags_set(struct rocker_port *rocker_port,
}
static int rocker_port_attr_set(struct net_device *dev,
struct switchdev_attr *attr)
struct switchdev_attr *attr,
struct switchdev_trans *trans)
{
struct rocker_port *rocker_port = netdev_priv(dev);
int err = 0;
@@ -4467,7 +4468,8 @@ static int rocker_port_fdb_add(struct rocker_port *rocker_port,
}
static int rocker_port_obj_add(struct net_device *dev,
struct switchdev_obj *obj)
struct switchdev_obj *obj,
struct switchdev_trans *trans)
{
struct rocker_port *rocker_port = netdev_priv(dev);
const struct switchdev_obj_ipv4_fib *fib4;