Lines Matching refs:mlxsw_sp

17 static int mlxsw_sp_flower_parse_actions(struct mlxsw_sp *mlxsw_sp,  in mlxsw_sp_flower_parse_actions()  argument
30 err = mlxsw_sp_acl_rulei_act_count(mlxsw_sp, rulei, extack); in mlxsw_sp_flower_parse_actions()
58 ruleset = mlxsw_sp_acl_ruleset_lookup(mlxsw_sp, block, in mlxsw_sp_flower_parse_actions()
75 fid = mlxsw_sp_acl_dummy_fid(mlxsw_sp); in mlxsw_sp_flower_parse_actions()
77 err = mlxsw_sp_acl_rulei_act_fid_set(mlxsw_sp, rulei, in mlxsw_sp_flower_parse_actions()
83 err = mlxsw_sp_acl_rulei_act_fwd(mlxsw_sp, rulei, in mlxsw_sp_flower_parse_actions()
90 err = mlxsw_sp_acl_rulei_act_mirror(mlxsw_sp, rulei, in mlxsw_sp_flower_parse_actions()
101 return mlxsw_sp_acl_rulei_act_vlan(mlxsw_sp, rulei, in mlxsw_sp_flower_parse_actions()
106 dev_err(mlxsw_sp->bus_info->dev, "Unsupported action\n"); in mlxsw_sp_flower_parse_actions()
171 static int mlxsw_sp_flower_parse_ports(struct mlxsw_sp *mlxsw_sp, in mlxsw_sp_flower_parse_ports() argument
183 dev_err(mlxsw_sp->bus_info->dev, "Only UDP and TCP keys are supported\n"); in mlxsw_sp_flower_parse_ports()
200 static int mlxsw_sp_flower_parse_tcp(struct mlxsw_sp *mlxsw_sp, in mlxsw_sp_flower_parse_tcp() argument
212 dev_err(mlxsw_sp->bus_info->dev, "TCP keys supported only for TCP\n"); in mlxsw_sp_flower_parse_tcp()
227 static int mlxsw_sp_flower_parse_ip(struct mlxsw_sp *mlxsw_sp, in mlxsw_sp_flower_parse_ip() argument
239 dev_err(mlxsw_sp->bus_info->dev, "IP keys supported only for IPv4/6\n"); in mlxsw_sp_flower_parse_ip()
261 static int mlxsw_sp_flower_parse(struct mlxsw_sp *mlxsw_sp, in mlxsw_sp_flower_parse() argument
282 dev_err(mlxsw_sp->bus_info->dev, "Unsupported key\n"); in mlxsw_sp_flower_parse()
379 err = mlxsw_sp_flower_parse_ports(mlxsw_sp, rulei, f, ip_proto); in mlxsw_sp_flower_parse()
382 err = mlxsw_sp_flower_parse_tcp(mlxsw_sp, rulei, f, ip_proto); in mlxsw_sp_flower_parse()
386 err = mlxsw_sp_flower_parse_ip(mlxsw_sp, rulei, f, n_proto_key & n_proto_mask); in mlxsw_sp_flower_parse()
390 return mlxsw_sp_flower_parse_actions(mlxsw_sp, block, rulei, f->exts, in mlxsw_sp_flower_parse()
394 int mlxsw_sp_flower_replace(struct mlxsw_sp *mlxsw_sp, in mlxsw_sp_flower_replace() argument
403 ruleset = mlxsw_sp_acl_ruleset_get(mlxsw_sp, block, in mlxsw_sp_flower_replace()
409 rule = mlxsw_sp_acl_rule_create(mlxsw_sp, ruleset, f->cookie, in mlxsw_sp_flower_replace()
417 err = mlxsw_sp_flower_parse(mlxsw_sp, block, rulei, f); in mlxsw_sp_flower_replace()
425 err = mlxsw_sp_acl_rule_add(mlxsw_sp, rule); in mlxsw_sp_flower_replace()
429 mlxsw_sp_acl_ruleset_put(mlxsw_sp, ruleset); in mlxsw_sp_flower_replace()
435 mlxsw_sp_acl_rule_destroy(mlxsw_sp, rule); in mlxsw_sp_flower_replace()
437 mlxsw_sp_acl_ruleset_put(mlxsw_sp, ruleset); in mlxsw_sp_flower_replace()
441 void mlxsw_sp_flower_destroy(struct mlxsw_sp *mlxsw_sp, in mlxsw_sp_flower_destroy() argument
448 ruleset = mlxsw_sp_acl_ruleset_get(mlxsw_sp, block, in mlxsw_sp_flower_destroy()
454 rule = mlxsw_sp_acl_rule_lookup(mlxsw_sp, ruleset, f->cookie); in mlxsw_sp_flower_destroy()
456 mlxsw_sp_acl_rule_del(mlxsw_sp, rule); in mlxsw_sp_flower_destroy()
457 mlxsw_sp_acl_rule_destroy(mlxsw_sp, rule); in mlxsw_sp_flower_destroy()
460 mlxsw_sp_acl_ruleset_put(mlxsw_sp, ruleset); in mlxsw_sp_flower_destroy()
463 int mlxsw_sp_flower_stats(struct mlxsw_sp *mlxsw_sp, in mlxsw_sp_flower_stats() argument
474 ruleset = mlxsw_sp_acl_ruleset_get(mlxsw_sp, block, in mlxsw_sp_flower_stats()
480 rule = mlxsw_sp_acl_rule_lookup(mlxsw_sp, ruleset, f->cookie); in mlxsw_sp_flower_stats()
484 err = mlxsw_sp_acl_rule_get_stats(mlxsw_sp, rule, &packets, &bytes, in mlxsw_sp_flower_stats()
491 mlxsw_sp_acl_ruleset_put(mlxsw_sp, ruleset); in mlxsw_sp_flower_stats()
495 mlxsw_sp_acl_ruleset_put(mlxsw_sp, ruleset); in mlxsw_sp_flower_stats()
499 int mlxsw_sp_flower_tmplt_create(struct mlxsw_sp *mlxsw_sp, in mlxsw_sp_flower_tmplt_create() argument
508 err = mlxsw_sp_flower_parse(mlxsw_sp, block, &rulei, f); in mlxsw_sp_flower_tmplt_create()
511 ruleset = mlxsw_sp_acl_ruleset_get(mlxsw_sp, block, in mlxsw_sp_flower_tmplt_create()
520 void mlxsw_sp_flower_tmplt_destroy(struct mlxsw_sp *mlxsw_sp, in mlxsw_sp_flower_tmplt_destroy() argument
526 ruleset = mlxsw_sp_acl_ruleset_get(mlxsw_sp, block, in mlxsw_sp_flower_tmplt_destroy()
532 mlxsw_sp_acl_ruleset_put(mlxsw_sp, ruleset); in mlxsw_sp_flower_tmplt_destroy()
533 mlxsw_sp_acl_ruleset_put(mlxsw_sp, ruleset); in mlxsw_sp_flower_tmplt_destroy()