[ovs-dev] [PATCH] datapath: Use per-cpu allocator for sctp flow-stats.

Joe Stringer joestringer at nicira.com
Fri Jan 3 19:43:56 UTC 2014


This patch adds the logic used for TCP and UDP in b0f3a2feef
(datapath: Use percpu allocator for flow-stats.) to SCTP. This should
help to detect longer-lived flows that match on SCTP, for use with the
per-cpu allocator for flow-stats.

Signed-off-by: Joe Stringer <joestringer at nicira.com>
---
Pravin, I noticed that this code was added to TCP and UDP, and am
guessing that it's just as relevant to SCTP. If this doesn't make sense,
feel free to drop it.
---
 datapath/flow_netlink.c |    5 +++++
 1 file changed, 5 insertions(+)

diff --git a/datapath/flow_netlink.c b/datapath/flow_netlink.c
index 9b26528..eeac667 100644
--- a/datapath/flow_netlink.c
+++ b/datapath/flow_netlink.c
@@ -733,6 +733,11 @@ static int ovs_key_from_nlattrs(struct sw_flow_match *match,  bool *exact_5tuple
 					sctp_key->sctp_dst, is_mask);
 		}
 		attrs &= ~(1ULL << OVS_KEY_ATTR_SCTP);
+
+		if (is_mask && exact_5tuple && *exact_5tuple &&
+		    (sctp_key->sctp_src != htons(0xffff) ||
+		     sctp_key->sctp_dst != htons(0xffff)))
+			*exact_5tuple = false;
 	}
 
 	if (attrs & (1ULL << OVS_KEY_ATTR_ICMP)) {
-- 
1.7.9.5




More information about the dev mailing list