47bcda234310b57b59a413d331c0d7c80a1bc1e6
[vpp.git] / dpdk / dpdk-16.04_patches / 0020-net-enic-fix-releasing-mbufs-when-tearing-down-Rx-qu.patch
1 From 3f276178609472585a85fe440b549013a64d9327 Mon Sep 17 00:00:00 2001
2 From: Nelson Escobar <neescoba@cisco.com>
3 Date: Tue, 14 Jun 2016 16:55:34 -0700
4 Subject: [PATCH 20/25] net/enic: fix releasing mbufs when tearing down Rx
5  queue
6
7 When trying to release the mbufs, the function was incorrectly
8 iterating over the max size configured instead of the actual size
9 of the ring.
10
11 Fixes: 947d860c821f ("enic: improve Rx performance")
12
13 Signed-off-by: Nelson Escobar <neescoba@cisco.com>
14 Reviewed-by: John Daley <johndale@cisco.com>
15 ---
16  drivers/net/enic/enic_main.c | 4 ++--
17  1 file changed, 2 insertions(+), 2 deletions(-)
18
19 diff --git a/drivers/net/enic/enic_main.c b/drivers/net/enic/enic_main.c
20 index 68532d3..56ec96e 100644
21 --- a/drivers/net/enic/enic_main.c
22 +++ b/drivers/net/enic/enic_main.c
23 @@ -91,7 +91,7 @@ static int is_eth_addr_valid(uint8_t *addr)
24  }
25  
26  static void
27 -enic_rxmbuf_queue_release(struct enic *enic, struct vnic_rq *rq)
28 +enic_rxmbuf_queue_release(__rte_unused struct enic *enic, struct vnic_rq *rq)
29  {
30         uint16_t i;
31  
32 @@ -100,7 +100,7 @@ enic_rxmbuf_queue_release(struct enic *enic, struct vnic_rq *rq)
33                 return;
34         }
35  
36 -       for (i = 0; i < enic->config.rq_desc_count; i++) {
37 +       for (i = 0; i < rq->ring.desc_count; i++) {
38                 if (rq->mbuf_ring[i]) {
39                         rte_pktmbuf_free_seg(rq->mbuf_ring[i]);
40                         rq->mbuf_ring[i] = NULL;
41 -- 
42 2.7.0
43