Skip to content

Commit

Permalink
flow_offload: Introduce flow_match_l2tpv3
Browse files Browse the repository at this point in the history
Allow to offload L2TPv3 filters by adding flow_rule_match_l2tpv3.
Drivers can extract L2TPv3 specific fields from now on.

Signed-off-by: Wojciech Drewek <wojciech.drewek@intel.com>
Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
  • Loading branch information
Wojciech Drewek authored and Paolo Abeni committed Sep 20, 2022
1 parent 8b189ea commit 2c1befa
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
6 changes: 6 additions & 0 deletions include/net/flow_offload.h
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,10 @@ struct flow_match_pppoe {
struct flow_dissector_key_pppoe *key, *mask;
};

struct flow_match_l2tpv3 {
struct flow_dissector_key_l2tpv3 *key, *mask;
};

struct flow_rule;

void flow_rule_match_meta(const struct flow_rule *rule,
Expand Down Expand Up @@ -128,6 +132,8 @@ void flow_rule_match_ct(const struct flow_rule *rule,
struct flow_match_ct *out);
void flow_rule_match_pppoe(const struct flow_rule *rule,
struct flow_match_pppoe *out);
void flow_rule_match_l2tpv3(const struct flow_rule *rule,
struct flow_match_l2tpv3 *out);

enum flow_action_id {
FLOW_ACTION_ACCEPT = 0,
Expand Down
7 changes: 7 additions & 0 deletions net/core/flow_offload.c
Original file line number Diff line number Diff line change
Expand Up @@ -237,6 +237,13 @@ void flow_rule_match_pppoe(const struct flow_rule *rule,
}
EXPORT_SYMBOL(flow_rule_match_pppoe);

void flow_rule_match_l2tpv3(const struct flow_rule *rule,
struct flow_match_l2tpv3 *out)
{
FLOW_DISSECTOR_MATCH(rule, FLOW_DISSECTOR_KEY_L2TPV3, out);
}
EXPORT_SYMBOL(flow_rule_match_l2tpv3);

struct flow_block_cb *flow_block_cb_alloc(flow_setup_cb_t *cb,
void *cb_ident, void *cb_priv,
void (*release)(void *cb_priv))
Expand Down

0 comments on commit 2c1befa

Please sign in to comment.