mlx5hws_bwc_rule_create(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… 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_actions you 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
  • inserts the new rule πŸ“₯
  • polls till completion is received ⏳

πŸ’€ NOTES πŸ’€

  • matcher->tbl->ctx must 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


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