mlx5hws_bwc_rule_create(9)
π mlx5hws_bwc_rule_create β Kernel API Manual, bestie edition β¨
Okay so we're in the Kernel API Manual today, and the star of the show is mlx5hws_bwc_rule_create(9) π
β¨ NAME β¨
mlx5hws_bwc_rule_create β makes you a brand-new BWC rule, no cap π
πΈ SYNOPSIS πΈ
struct mlx5hws_bwc_rule * mlx5hws_bwc_rule_create (struct
mlx5hws_bwc_matcher *bwc_matcher , struct mlx5hws_match_parameters
*params , u32 flow_source , struct mlx5hws_rule_action rule_actions[] );
π¦ ARGUMENTS π¦
bwc_matcherβ the BWC matcher where your shiny new rule is gonna live, obviously πparamsβ the match parameters, i.e. what you're matching on πflow_sourceβ the flow source for this rule πrule_actionsβ the rule action (or actions) that get executed on a match, slay π
π§ DESCRIPTION π§
So here's the tea: unlike the usual rule creation function, this one is blocking. Like, when the function returns, the rule is already written to its place β no need to poll, bestie, it's done β
Here's everything this function does, in order:
- finds the matching action template based on the
rule_actionsyou provided, or creates a new action template if a matching one doesn't exist π - updates the corresponding BWC matcher stats π
- if needed, the function performs a rehash:
- creates a new matcher based on
mt,at,new_sz - moves all the existing matcher rules over to the new matcher
- removes the old matcher
- creates a new matcher based on
- inserts the new rule π₯
- polls till completion is received β³
π NOTES π
matcher->tbl->ctxmust have BWC support (non-negotiable, fr fr)- separate BWC ctx queues are used π«Ά
π RETURN π
A valid BWC rule handle on success, NULL otherwise π
π SEE ALSO π
Kernel file: ./drivers/net/ethernet/mellanox/mlx5/core/steering/hws/mlx5hws.h
mlx5hws_is_supported(9),mlx5hws_context_open(9),mlx5hws_context_close(9),mlx5hws_context_set_peer(9),mlx5hws_table_create(9),mlx5hws_table_destroy(9),mlx5hws_table_get_id(9),mlx5hws_table_set_default_miss(9),mlx5hws_match_template_create(9),mlx5hws_match_template_destroy(9),mlx5hws_action_template_create(9),mlx5hws_action_template_destroy(9),mlx5hws_matcher_create(9),mlx5hws_matcher_destroy(9),mlx5hws_matcher_attach_at(9),mlx5hws_matcher_resize_set_target(9),mlx5hws_matcher_resize_rule_move(9),mlx5hws_rule_create(9),mlx5hws_rule_destroy(9),mlx5hws_rule_action_update(9),mlx5hws_action_get_type(9),mlx5hws_action_get_dev(9),mlx5hws_action_create_dest_drop(9),mlx5hws_action_create_default_miss(9),mlx5hws_action_create_dest_table(9),mlx5hws_action_create_dest_table_num(9),mlx5hws_action_create_dest_match_range(9),mlx5hws_action_create_flow_sampler(9),mlx5hws_action_create_dest_vport(9),mlx5hws_action_create_tag(9),mlx5hws_action_create_counter(9),mlx5hws_action_create_reformat(9),mlx5hws_action_create_modify_header(9),mlx5hws_action_create_aso_meter(9),mlx5hws_action_create_pop_vlan(9),mlx5hws_action_create_push_vlan(9),mlx5hws_action_create_dest_array(9),mlx5hws_action_create_insert_header(9),mlx5hws_action_create_remove_header(9),mlx5hws_action_create_last(9),mlx5hws_action_destroy(9),mlx5hws_send_queue_poll(9),mlx5hws_send_queue_action(9),mlx5hws_debug_dump(9),mlx5hws_bwc_matcher_create(9),mlx5hws_bwc_matcher_destroy(9),mlx5hws_bwc_rule_destroy(9),mlx5hws_bwc_rule_action_update(9)
And that's the whole vibe check, bestie π The source lives at ./drivers/net/ethernet/mellano... and this drop is dated October 2026 β go forth and create those rules, ily π«Άβ¨
π¦ where this page comes from
- nixpkgs unstable: linux-manual 7.3.1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms