diff mbox

[ovs-dev,PATCHv2,9/9] compat: Document nf_defrag_ipv[46] backport.

Message ID 1462213158-60221-10-git-send-email-joe@ovn.org
State Accepted
Headers show

Commit Message

Joe Stringer May 2, 2016, 6:19 p.m. UTC
Document how the IP(6) defrag backport works, and do minor style cleanups.

Signed-off-by: Joe Stringer <joe@ovn.org>
---
v2: Initial Post.
---
 datapath/linux/compat/include/net/ip.h                        |  7 +++++++
 .../linux/compat/include/net/netfilter/ipv6/nf_defrag_ipv6.h  | 11 +++++++++--
 2 files changed, 16 insertions(+), 2 deletions(-)
diff mbox

Patch

diff --git a/datapath/linux/compat/include/net/ip.h b/datapath/linux/compat/include/net/ip.h
index 0fb13913eecd..145529ecbbe1 100644
--- a/datapath/linux/compat/include/net/ip.h
+++ b/datapath/linux/compat/include/net/ip.h
@@ -116,6 +116,10 @@  static inline int rpl_ip_do_fragment(struct sock *sk, struct sk_buff *skb,
 #define ip_do_fragment rpl_ip_do_fragment
 #endif /* IP_DO_FRAGMENT */
 
+/* If backporting IP defrag, then init/exit functions need to be called from
+ * compat_{in,ex}it() to prepare the backported fragmentation cache. In this
+ * case we declare the functions which are defined in
+ * datapath/linux/compat/ip_fragment.c. */
 int rpl_ip_defrag(struct net *net, struct sk_buff *skb, u32 user);
 #define ip_defrag rpl_ip_defrag
 int __init rpl_ipfrag_init(void);
@@ -139,6 +143,9 @@  static inline int rpl_ip_defrag(struct net *net, struct sk_buff *skb, u32 user)
 #define ip_defrag rpl_ip_defrag
 #endif
 
+/* If we can use upstream defrag then we can rely on the upstream
+ * defrag module to init/exit correctly. In this case the calls in
+ * compat_{in,ex}it() can be no-ops. */
 static inline int rpl_ipfrag_init(void) { return 0; }
 static inline void rpl_ipfrag_fini(void) { }
 #endif /* HAVE_CORRECT_MRU_HANDLING */
diff --git a/datapath/linux/compat/include/net/netfilter/ipv6/nf_defrag_ipv6.h b/datapath/linux/compat/include/net/netfilter/ipv6/nf_defrag_ipv6.h
index dc440db99924..09fe78101f3a 100644
--- a/datapath/linux/compat/include/net/netfilter/ipv6/nf_defrag_ipv6.h
+++ b/datapath/linux/compat/include/net/netfilter/ipv6/nf_defrag_ipv6.h
@@ -16,9 +16,16 @@ 
 #define OVS_NF_DEFRAG6_BACKPORT 1
 int rpl_nf_ct_frag6_gather(struct net *net, struct sk_buff *skb, u32 user);
 #define nf_ct_frag6_gather rpl_nf_ct_frag6_gather
-#endif /* HAVE_NF_CT_FRAG6_CONSUME_ORIG */
 
-#ifdef OVS_NF_DEFRAG6_BACKPORT
+/* If backporting IPv6 defrag, then init/exit functions need to be called from
+ * compat_{in,ex}it() to prepare the backported fragmentation cache. In this
+ * case we declare the functions which are defined in
+ * datapath/linux/compat/nf_conntrack_reasm.c.
+ *
+ * Otherwise, if we can use upstream defrag then we can rely on the upstream
+ * nf_defrag_ipv6 module to init/exit correctly. In this case the calls in
+ * compat_{in,ex}it() can be no-ops.
+ */
 int __init rpl_nf_ct_frag6_init(void);
 void rpl_nf_ct_frag6_cleanup(void);
 #else /* !OVS_NF_DEFRAG6_BACKPORT */