net: flow_offload: implement support for meta key
authorJiri Pirko <jiri@mellanox.com>
Wed, 19 Jun 2019 06:41:04 +0000 (09:41 +0300)
committerDavid S. Miller <davem@davemloft.net>
Wed, 19 Jun 2019 14:09:22 +0000 (10:09 -0400)
Implement support for previously added flow dissector meta key.

Signed-off-by: Jiri Pirko <jiri@mellanox.com>
Signed-off-by: Ido Schimmel <idosch@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
include/net/flow_offload.h
net/core/flow_offload.c

index 36fdb85c974dd299b78161a2faa21091fda8aae1..36127c1858a4f8dccaf38b8d93d0327360d52026 100644 (file)
@@ -10,6 +10,10 @@ struct flow_match {
        void                    *key;
 };
 
+struct flow_match_meta {
+       struct flow_dissector_key_meta *key, *mask;
+};
+
 struct flow_match_basic {
        struct flow_dissector_key_basic *key, *mask;
 };
@@ -64,6 +68,8 @@ struct flow_match_enc_opts {
 
 struct flow_rule;
 
+void flow_rule_match_meta(const struct flow_rule *rule,
+                         struct flow_match_meta *out);
 void flow_rule_match_basic(const struct flow_rule *rule,
                           struct flow_match_basic *out);
 void flow_rule_match_control(const struct flow_rule *rule,
index 3d93e51b83e027281c5d90d0f1f1b0a9ac61a32c..f52fe0bc40172407488365dbb8fed7bbc04ab467 100644 (file)
@@ -25,6 +25,13 @@ EXPORT_SYMBOL(flow_rule_alloc);
        (__out)->key = skb_flow_dissector_target(__d, __type, (__m)->key);      \
        (__out)->mask = skb_flow_dissector_target(__d, __type, (__m)->mask);    \
 
+void flow_rule_match_meta(const struct flow_rule *rule,
+                         struct flow_match_meta *out)
+{
+       FLOW_DISSECTOR_MATCH(rule, FLOW_DISSECTOR_KEY_META, out);
+}
+EXPORT_SYMBOL(flow_rule_match_meta);
+
 void flow_rule_match_basic(const struct flow_rule *rule,
                           struct flow_match_basic *out)
 {