[ovs-dev] netdev-offload-tc: Add support for ct_state flag rel

Ariel Levkovich lariel at nvidia.com
Tue Mar 30 10:00:15 UTC 2021


Signed-off-by: Ariel Levkovich <lariel at nvidia.com>
---
 lib/netdev-offload-tc.c | 15 +++++++++++++++
 1 file changed, 15 insertions(+)

diff --git a/lib/netdev-offload-tc.c b/lib/netdev-offload-tc.c
index 448747eae..41acbdeb7 100644
--- a/lib/netdev-offload-tc.c
+++ b/lib/netdev-offload-tc.c
@@ -765,6 +765,13 @@ parse_tc_flower_to_match(struct tc_flower *flower,
                 ct_statem |= OVS_CS_F_INVALID;
             }
 
+            if (mask->ct_state & TCA_FLOWER_KEY_CT_FLAGS_RELATED) {
+                if (key->ct_state & TCA_FLOWER_KEY_CT_FLAGS_RELATED) {
+                    ct_statev |= OVS_CS_F_RELATED;
+                }
+                ct_statem |= OVS_CS_F_RELATED;
+            }
+
             match_set_ct_state_masked(match, ct_statev, ct_statem);
         }
 
@@ -1522,6 +1529,14 @@ parse_match_ct_state_to_flower(struct tc_flower *flower, struct match *match)
             mask->ct_state &= ~OVS_CS_F_INVALID;
         }
 
+        if (mask->ct_state & OVS_CS_F_RELATED) {
+            if (key->ct_state & OVS_CS_F_RELATED) {
+                flower->key.ct_state |= TCA_FLOWER_KEY_CT_FLAGS_RELATED;
+            }
+            flower->mask.ct_state |= TCA_FLOWER_KEY_CT_FLAGS_RELATED;
+            mask->ct_state &= ~OVS_CS_F_RELATED;
+        }
+
         if (flower->key.ct_state & TCA_FLOWER_KEY_CT_FLAGS_ESTABLISHED) {
             flower->key.ct_state &= ~(TCA_FLOWER_KEY_CT_FLAGS_NEW);
             flower->mask.ct_state &= ~(TCA_FLOWER_KEY_CT_FLAGS_NEW);
-- 
2.25.2



More information about the dev mailing list