[ovs-dev,v5,04/11] conntrack: Support fragmentation.

Message ID 1517761364-17655-5-git-send-email-dlu998@gmail.com
State Superseded
Delegated to: Ian Stokes
Headers show
Series
  • Userspace datapath: Add fragmentation support.
Related show

Commit Message

Darrell Ball Feb. 4, 2018, 4:22 p.m.
The conntrack module now calls fragmentation support apis.

Signed-off-by: Darrell Ball <dlu998@gmail.com>
---
 NEWS            | 2 ++
 lib/conntrack.c | 7 +++++++
 2 files changed, 9 insertions(+)

Patch

diff --git a/NEWS b/NEWS
index 8c360ba..ee1f272 100644
--- a/NEWS
+++ b/NEWS
@@ -11,6 +11,8 @@  Post-v2.9.0
        "table#".  These are not helpful names for the purpose of accepting
        and displaying table names, so now tables by default have no names.
 
+   - Userspace datapath:
+     * Add v4/v6 fragmentation support for conntrack.
 
 v2.9.0 - xx xxx xxxx
 --------------------
diff --git a/lib/conntrack.c b/lib/conntrack.c
index d34eb32..2894a77 100644
--- a/lib/conntrack.c
+++ b/lib/conntrack.c
@@ -30,6 +30,7 @@ 
 #include "ct-dpif.h"
 #include "dp-packet.h"
 #include "flow.h"
+#include "ipf.h"
 #include "netdev.h"
 #include "odp-netlink.h"
 #include "openvswitch/hmap.h"
@@ -340,6 +341,7 @@  conntrack_init(struct conntrack *ct)
     atomic_init(&ct->n_conn_limit, DEFAULT_N_CONN_LIMIT);
     latch_init(&ct->clean_thread_exit);
     ct->clean_thread = ovs_thread_create("ct_clean", clean_thread_main, ct);
+    ipf_init();
 }
 
 /* Destroys the connection tracker 'ct' and frees all the allocated memory. */
@@ -382,6 +384,7 @@  conntrack_destroy(struct conntrack *ct)
     hindex_destroy(&ct->alg_expectation_refs);
     ct_rwlock_unlock(&ct->resources_lock);
     ct_rwlock_destroy(&ct->resources_lock);
+    ipf_destroy();
 }
 
 static unsigned hash_to_bucket(uint32_t hash)
@@ -1308,6 +1311,8 @@  conntrack_execute(struct conntrack *ct, struct dp_packet_batch *pkt_batch,
                   const struct nat_action_info_t *nat_action_info,
                   long long now)
 {
+    ipf_preprocess_conntrack(pkt_batch, now, dl_type, zone, ct->hash_basis);
+
     struct dp_packet *packet;
     struct conn_lookup_ctx ctx;
 
@@ -1321,6 +1326,8 @@  conntrack_execute(struct conntrack *ct, struct dp_packet_batch *pkt_batch,
                     setlabel, nat_action_info, tp_src, tp_dst, helper);
     }
 
+    ipf_postprocess_conntrack(pkt_batch, now, dl_type);
+
     return 0;
 }