From: Shaopeng He Date: Fri, 5 Feb 2016 04:57:50 +0000 (+0800) Subject: examples/l3fwd-power: fix memory leak for non-IP packets X-Git-Tag: spdx-start~7344 X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=bec2f7df9c4509e42c266b164af3ac5998447ffb;p=dpdk.git examples/l3fwd-power: fix memory leak for non-IP packets 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 Acked-by: Jing Chen Acked-by: Michael Qiu --- diff --git a/doc/guides/rel_notes/release_16_04.rst b/doc/guides/rel_notes/release_16_04.rst index 8d6e593cff..67892a8d45 100644 --- a/doc/guides/rel_notes/release_16_04.rst +++ b/doc/guides/rel_notes/release_16_04.rst @@ -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 diff --git a/examples/l3fwd-power/main.c b/examples/l3fwd-power/main.c index d4bb7a3638..e7ebe30f2f 100644 --- a/examples/l3fwd-power/main.c +++ b/examples/l3fwd-power/main.c @@ -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); }