]> www.infradead.org Git - users/willy/xarray.git/commitdiff
mlxsw: spectrum_matchall: Put matchall list into substruct of flow struct
authorJiri Pirko <jiri@mellanox.com>
Sat, 9 May 2020 20:06:04 +0000 (23:06 +0300)
committerJakub Kicinski <kuba@kernel.org>
Sat, 9 May 2020 23:02:43 +0000 (16:02 -0700)
As there are going to be other matchall specific fields in flow
structure, put the existing list field into matchall substruct.

Signed-off-by: Jiri Pirko <jiri@mellanox.com>
Signed-off-by: Ido Schimmel <idosch@mellanox.com>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
drivers/net/ethernet/mellanox/mlxsw/spectrum.h
drivers/net/ethernet/mellanox/mlxsw/spectrum_flow.c
drivers/net/ethernet/mellanox/mlxsw/spectrum_matchall.c

index d9a963c77401192202f94be7fd21ccf14d2e116b..55369346980581693318e39ab99a97f130c54d8a 100644 (file)
@@ -636,7 +636,9 @@ struct mlxsw_sp_acl_rule_info {
 /* spectrum_flow.c */
 struct mlxsw_sp_flow_block {
        struct list_head binding_list;
-       struct list_head mall_list;
+       struct {
+               struct list_head list;
+       } mall;
        struct mlxsw_sp_acl_ruleset *ruleset_zero;
        struct mlxsw_sp *mlxsw_sp;
        unsigned int rule_count;
index ecab581ff956b3d54a29a30900ffbf1aa949729a..76644f6a81211f460cdb8902fd5a8c6dc012a669 100644 (file)
@@ -18,7 +18,7 @@ mlxsw_sp_flow_block_create(struct mlxsw_sp *mlxsw_sp, struct net *net)
        if (!block)
                return NULL;
        INIT_LIST_HEAD(&block->binding_list);
-       INIT_LIST_HEAD(&block->mall_list);
+       INIT_LIST_HEAD(&block->mall.list);
        block->mlxsw_sp = mlxsw_sp;
        block->net = net;
        return block;
index c75661521bbc98301744fdefc417df684c183dd0..d64ee31a611c24135905a9e8e923f80087c7fbd2 100644 (file)
@@ -37,7 +37,7 @@ mlxsw_sp_mall_entry_find(struct mlxsw_sp_flow_block *block, unsigned long cookie
 {
        struct mlxsw_sp_mall_entry *mall_entry;
 
-       list_for_each_entry(mall_entry, &block->mall_list, list)
+       list_for_each_entry(mall_entry, &block->mall.list, list)
                if (mall_entry->cookie == cookie)
                        return mall_entry;
 
@@ -244,7 +244,7 @@ int mlxsw_sp_mall_replace(struct mlxsw_sp_flow_block *block,
                block->egress_blocker_rule_count++;
        else
                block->ingress_blocker_rule_count++;
-       list_add_tail(&mall_entry->list, &block->mall_list);
+       list_add_tail(&mall_entry->list, &block->mall.list);
        return 0;
 
 rollback:
@@ -285,7 +285,7 @@ int mlxsw_sp_mall_port_bind(struct mlxsw_sp_flow_block *block,
        struct mlxsw_sp_mall_entry *mall_entry;
        int err;
 
-       list_for_each_entry(mall_entry, &block->mall_list, list) {
+       list_for_each_entry(mall_entry, &block->mall.list, list) {
                err = mlxsw_sp_mall_port_rule_add(mlxsw_sp_port, mall_entry);
                if (err)
                        goto rollback;
@@ -293,7 +293,7 @@ int mlxsw_sp_mall_port_bind(struct mlxsw_sp_flow_block *block,
        return 0;
 
 rollback:
-       list_for_each_entry_continue_reverse(mall_entry, &block->mall_list,
+       list_for_each_entry_continue_reverse(mall_entry, &block->mall.list,
                                             list)
                mlxsw_sp_mall_port_rule_del(mlxsw_sp_port, mall_entry);
        return err;
@@ -304,6 +304,6 @@ void mlxsw_sp_mall_port_unbind(struct mlxsw_sp_flow_block *block,
 {
        struct mlxsw_sp_mall_entry *mall_entry;
 
-       list_for_each_entry(mall_entry, &block->mall_list, list)
+       list_for_each_entry(mall_entry, &block->mall.list, list)
                mlxsw_sp_mall_port_rule_del(mlxsw_sp_port, mall_entry);
 }