net/pcap: fix issue with unnecessary mbufs freeing

Message ID 20190711135946.811-1-aideen.mcloughlin@intel.com
State Accepted
Delegated to: Ferruh Yigit
Headers show
Series
  • net/pcap: fix issue with unnecessary mbufs freeing
Related show

Checks

Context Check Description
ci/Intel-compilation success Compilation OK
ci/intel-Performance-Testing success Performance Testing PASS
ci/mellanox-Performance-Testing success Performance Testing PASS
ci/checkpatch success coding style OK

Commit Message

A.McLoughlin July 11, 2019, 1:59 p.m.
In the eth_pcap_tx() and eth_pcap_tx_dumper() functions mbufs were freed
without incrementing num_tx. To fix the issue, the mbuf freeing was
removed as it was not of any benefit.

Fixes: 6db141c91e1f ("pcap: support jumbo frames")
Cc: stable@dpdk.org
Cc: tero.aho@coriant.com

Signed-off-by: A.McLoughlin <aideen.mcloughlin@intel.com>
---
 drivers/net/pcap/rte_eth_pcap.c | 2 --
 1 file changed, 2 deletions(-)

Comments

Ferruh Yigit July 11, 2019, 2:15 p.m. | #1
On 7/11/2019 2:59 PM, A.McLoughlin wrote:
> In the eth_pcap_tx() and eth_pcap_tx_dumper() functions mbufs were freed
> without incrementing num_tx. To fix the issue, the mbuf freeing was
> removed as it was not of any benefit.
> 
> Fixes: 6db141c91e1f ("pcap: support jumbo frames")
> Cc: stable@dpdk.org
> Cc: tero.aho@coriant.com
> 
> Signed-off-by: A.McLoughlin <aideen.mcloughlin@intel.com>

Acked-by: Ferruh Yigit <ferruh.yigit@intel.com>

(It may be good to mention PMD was freeing the mbuf without notifying the app,
which may lead double freeing of the mbuf (crash) or app using invalid mbuf.
I will add while merging.)
Ferruh Yigit July 16, 2019, 5:17 p.m. | #2
On 7/11/2019 3:15 PM, Ferruh Yigit wrote:
> On 7/11/2019 2:59 PM, A.McLoughlin wrote:
>> In the eth_pcap_tx() and eth_pcap_tx_dumper() functions mbufs were freed
>> without incrementing num_tx. To fix the issue, the mbuf freeing was
>> removed as it was not of any benefit.
>>
>> Fixes: 6db141c91e1f ("pcap: support jumbo frames")
>> Cc: stable@dpdk.org
>> Cc: tero.aho@coriant.com
>>
>> Signed-off-by: A.McLoughlin <aideen.mcloughlin@intel.com>
> 
> Acked-by: Ferruh Yigit <ferruh.yigit@intel.com>
> 
> (It may be good to mention PMD was freeing the mbuf without notifying the app,
> which may lead double freeing of the mbuf (crash) or app using invalid mbuf.
> I will add while merging.)
> 

Applied to dpdk-next-net/master, thanks.

Patch

diff --git a/drivers/net/pcap/rte_eth_pcap.c b/drivers/net/pcap/rte_eth_pcap.c
index 26e85183e..77bb66337 100644
--- a/drivers/net/pcap/rte_eth_pcap.c
+++ b/drivers/net/pcap/rte_eth_pcap.c
@@ -349,7 +349,6 @@  eth_pcap_tx_dumper(void *queue, struct rte_mbuf **bufs, uint16_t nb_pkts)
 					mbuf->pkt_len,
 					RTE_ETHER_MAX_JUMBO_FRAME_LEN);
 
-				rte_pktmbuf_free(mbuf);
 				break;
 			}
 		}
@@ -435,7 +434,6 @@  eth_pcap_tx(void *queue, struct rte_mbuf **bufs, uint16_t nb_pkts)
 					mbuf->pkt_len,
 					RTE_ETHER_MAX_JUMBO_FRAME_LEN);
 
-				rte_pktmbuf_free(mbuf);
 				break;
 			}
 		}