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>
此提交包含在:
@@ -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;
|
||||
|
新增問題並參考
封鎖使用者