examples/l3fwd-power: fix memory leak for non-IP packets
authorShaopeng He <shaopeng.he@intel.com>
Fri, 5 Feb 2016 04:57:50 +0000 (12:57 +0800)
committerThomas Monjalon <thomas.monjalon@6wind.com>
Wed, 16 Mar 2016 17:51:43 +0000 (18:51 +0100)
Previous l3fwd-power only processes IP and IPv6 packets, other
packets' mbufs are not freed, and this causes a memory leak.
This patch fixes this issue.

Fixes: 3c0184cc0c60 ("examples: replace some offload flags with packet type")

Signed-off-by: Shaopeng He <shaopeng.he@intel.com>
Acked-by: Jing Chen <jing.d.chen@intel.com>
Acked-by: Michael Qiu <michael.qiu@intel.com>
doc/guides/rel_notes/release_16_04.rst
examples/l3fwd-power/main.c

index 8d6e593..67892a8 100644 (file)
@@ -276,6 +276,12 @@ Libraries
 Examples
 ~~~~~~~~
 
+* **l3fwd-power: Fixed memory leak for non-IP packet.**
+
+  Fixed issue in l3fwd-power where, on receiving packets of types
+  other than IPv4 or IPv6, the mbuf was not released, and caused
+  a memory leak.
+
 * **examples/vhost: Fixed frequent mbuf allocation failure.**
 
   vhost-switch often fails to allocate mbuf when dequeue from vring because it
index d4bb7a3..e7ebe30 100644 (file)
@@ -682,7 +682,8 @@ l3fwd_simple_forward(struct rte_mbuf *m, uint8_t portid,
                /* We don't currently handle IPv6 packets in LPM mode. */
                rte_pktmbuf_free(m);
 #endif
-       }
+       } else
+               rte_pktmbuf_free(m);
 
 }