do not auto offload connections with non-zero mark

the idea is that we only want to auto offload if userspace does not
have enough cycles to keep up with detection.  if userspace is
receiving enough cycles to mark flows, we assume that it is capable
of offload.

this fixes a specific scenario, where StreamBoost wants to continue
to monitor a connection for characteristic changes, but
fast-classifier auto offloads the connection, causing StreamBoost to
miss the change later and making it look like a misdetect.

Change-Id: Ib48e8dbbfa557b192f976f4de57a0fe5cd8f2627
Signed-off-by: Nicolas Costa <ncosta@codeaurora.org>
diff --git a/fast-classifier/fast-classifier.c b/fast-classifier/fast-classifier.c
index 0c781e1..6cb69f4 100644
--- a/fast-classifier/fast-classifier.c
+++ b/fast-classifier/fast-classifier.c
@@ -615,7 +615,7 @@
 		    p_sic->dest_ip == sic.dest_ip ) {
 			conn->hits++;
 			if (conn->offloaded == 0) {
-				if (conn->hits >= offload_at_pkts) {
+				if ((conn->hits >= offload_at_pkts) && conn->sic->mark == 0) {
 					struct fast_classifier_tuple fc_msg;
 					DEBUG_TRACE("OFFLOADING CONNECTION, TOO MANY HITS\n");
 					if (fast_classifier_update_protocol(p_sic, conn->ct) == 0) {
@@ -641,7 +641,7 @@
 
 					return NF_ACCEPT;
 				} else if (conn->hits > offload_at_pkts) {
-					DEBUG_ERROR("ERROR: MORE THAN %d HITS AND NOT OFFLOADED\n", offload_at_pkts);
+					DEBUG_TRACE("MORE THAN %d HITS AND NOT OFFLOADED\n", offload_at_pkts);
 					spin_unlock_irqrestore(&sfe_connections_lock, flags);
 					return NF_ACCEPT;
 				}