]> git.baikalelectronics.ru Git - kernel.git/commitdiff
liquidio: rx/tx queue cleanup
authorIntiyaz Basha <intiyaz.basha@cavium.com>
Wed, 9 Aug 2017 19:07:08 +0000 (12:07 -0700)
committerDavid S. Miller <davem@davemloft.net>
Fri, 11 Aug 2017 20:54:41 +0000 (13:54 -0700)
When deleting a queue, clear its corresponding bit in the qmask, vfree its
memory, clear out the pointer that's pointing to it, and decrement the
queue count.

Signed-off-by: Intiyaz Basha <intiyaz.basha@cavium.com>
Signed-off-by: Felix Manlunas <fmanlunas@cavium.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/cavium/liquidio/octeon_droq.c
drivers/net/ethernet/cavium/liquidio/request_manager.c

index f7b5d68eb4cf23e2fdbc458966b2c4f7080aab5b..9372d4ce995400de3e853ae3d7c29b437c44f463 100644 (file)
@@ -209,6 +209,10 @@ int octeon_delete_droq(struct octeon_device *oct, u32 q_no)
                             droq->desc_ring, droq->desc_ring_dma);
 
        memset(droq, 0, OCT_DROQ_SIZE);
+       oct->io_qmask.oq &= ~(1ULL << q_no);
+       vfree(oct->droq[q_no]);
+       oct->droq[q_no] = NULL;
+       oct->num_oqs--;
 
        return 0;
 }
index 7b297f1f6dbe9b7443fdbb76f68e59ffb92934f8..20a96bab3d0d56bb637b6e7e3b95f042f11d56c5 100644 (file)
@@ -190,6 +190,10 @@ int octeon_delete_instr_queue(struct octeon_device *oct, u32 iq_no)
                q_size = iq->max_count * desc_size;
                lio_dma_free(oct, (u32)q_size, iq->base_addr,
                             iq->base_addr_dma);
+               oct->io_qmask.iq &= ~(1ULL << iq_no);
+               vfree(oct->instr_queue[iq_no]);
+               oct->instr_queue[iq_no] = NULL;
+               oct->num_iqs--;
                return 0;
        }
        return 1;