tcf_em_tree_validate(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

✨ tcf_em_tree_validate ✨

Okay bestie, so this one is from the Kernel API Manual (section 9, kernel land 🧚), and it's literally the vibe-check function for ematch configs. Buckle up πŸ’…


🌸 NAME 🌸

tcf_em_tree_validate β€” validate an ematch config TLV and build the ematch tree πŸŽ€


πŸ¦‹ SYNOPSIS πŸ¦‹

int tcf_em_tree_validate (struct tcf_proto *tp , struct nlattr *nla ,
       struct tcf_ematch_tree *tree );

πŸ’– ARGUMENTS πŸ’–

  • tp β€” the classifier kind handle. Like, it's the handle for whichever classifier kind you're rolling with πŸ‘‘
  • nla β€” the ematch tree configuration TLV. This is the raw config you're feeding in πŸ“
  • tree β€” the destination ematch tree variable, where the resulting ematch tree gets stored. This is the output slot, not the real one, iykyk ✨

🌈 DESCRIPTION 🌈

So what this does is: it validates the configuration TLV you passed in as nla, and builds an ematch tree inside tree. Simple as that 🫢

Now here's the part where you gotta listen, bestie, because it's giving important πŸ’€ β€” the resulting tree must later be copied into the private classifier data using tcf_em_tree_change. And you MUST NOT pass the ematch tree variable of the private classifier data directly, because then the changes would not be locked properly. Like, no cap, do it the right way πŸ™ˆ

⚠️ Warning, fr fr: handing in the private classifier data's own ematch tree variable directly = broken locking. Do not do the thing. πŸ’€

And if the configuration TLV contains errors, it returns a negative error code. So negative return = something went wrong, bestie 😭


πŸ‘‘ SEE ALSO πŸ‘‘


That's the whole arc, bestie 🌸 this page lives in ./net/sched, and it's dated October 2026 β€” so like, from the future, main character energy fr fr. Laterz πŸ’œπŸ¦‹

πŸ“¦ where this page comes from