conntrack: Fix to avoid duplicate connections in initial burst 79/36379/1
authorAnand B Jyoti <anand.b.jyoti@intel.com>
Thu, 22 Jun 2017 06:39:52 +0000 (12:09 +0530)
committerAnand B Jyoti <anand.b.jyoti@intel.com>
Thu, 22 Jun 2017 06:39:52 +0000 (12:09 +0530)
JIRA: SAMPLEVNF-43

Before connection setup, if there are multiple packets in the  burst
and are belongs to same connection, it was adding new connection for
the same 5 tuple connection, leading to multiple connections in the CT.

It was causing more number of active connections than possible.

Change-Id: I15c90e7feb465d96a9429ea6fedcb09fad9482e6
Signed-off-by: Anand B Jyoti <anand.b.jyoti@intel.com>
common/VIL/conntrack/rte_cnxn_tracking.c

index aa18058..1559621 100644 (file)
@@ -1481,6 +1481,7 @@ rte_ct_cnxn_tracker_batch_lookup_basic_type(
        struct rte_ct_cnxn_data *cnxn_data_entry[RTE_HASH_LOOKUP_BULK_MAX];
 
        rte_prefetch0(ct->hash_table_entries);
+       rte_prefetch0(ct->rhash);
 
        if (CNXN_TRX_DEBUG > 1) {
                printf("Enter cnxn tracker %p", ct);
@@ -1647,18 +1648,6 @@ rte_ct_cnxn_tracker_batch_lookup_basic_type(
                        rte_prefetch0(entry);
                        rte_prefetch0(&entry->key_is_client_order);
                }
-               else {
-                       uint8_t pkt_index = compacting_map[i];
-                       uint32_t *key = ct->hash_key_ptrs[pkt_index];
-                       uint8_t protocol = *(key + 9);
-                       if (protocol == UDP_PROTOCOL) {
-                               /* Search in new connections only for UDP */
-                               entry = rte_ct_search_new_connections(ct, key);
-                               rte_prefetch0(&entry->counters.packets_forwarded);
-                               rte_prefetch0(entry);
-                               rte_prefetch0(&entry->key_is_client_order);
-                       }
-               }
                cnxn_data_entry[i] = entry;
        }
 
@@ -1735,7 +1724,7 @@ rte_ct_cnxn_tracker_batch_lookup_basic_type(
                                 */
 
                                struct rte_ct_cnxn_data *recent_entry =
-                                       cnxn_data_entry[i];
+                                       rte_ct_search_new_connections(ct, key);
 
                                if (recent_entry != NULL) {
                                        if (rte_ct_udp_packet(ct, recent_entry,