Fix memory leak in L3 submode 87/66787/1
authorXavier Simonart <xavier.simonart@intel.com>
Wed, 30 Jan 2019 14:27:20 +0000 (15:27 +0100)
committerXavier Simonart <xavier.simonart@intel.com>
Wed, 30 Jan 2019 14:27:20 +0000 (15:27 +0100)
In L3 submodes, there were two memory leaks
- when a L3 core was restarted, causing around 2MB leak and a
  potential issue after 256 start/stop
- a potential mbuf leak when handling arp replies

Those have been fixed

Change-Id: I348478fa5967936297850432e93667e12b0adac4
Signed-off-by: Xavier Simonart <xavier.simonart@intel.com>
VNFs/DPPD-PROX/handle_master.c
VNFs/DPPD-PROX/packet_utils.c

index 2252741..c6ae96b 100644 (file)
@@ -170,6 +170,8 @@ static inline void handle_arp_reply(struct task_base *tbase, struct rte_mbuf *mb
                                tx_ring_ip(tbase, ring, UPDATE_FROM_CTRL, mbuf, key);
                        }
                        task->external_ip_table[ret].nb_requests = 0;
+               } else {
+                       tx_drop(mbuf);
                }
        }
 }
index e93f430..a476230 100644 (file)
@@ -238,7 +238,7 @@ void task_start_l3(struct task_base *tbase, struct task_args *targ)
        const int NB_CACHE_ARP_MBUF = 256;
 
        struct prox_port_cfg *port = find_reachable_port(targ);
-        if (port) {
+        if (port && (tbase->l3.arp_pool == NULL)) {
                static char name[] = "arp0_pool";
                 tbase->l3.reachable_port_id = port - prox_port_cfg;
                if (targ->local_ipv4) {