ionic: no rx flush in deinit
authorShannon Nelson <snelson@pensando.io>
Thu, 22 Oct 2020 23:55:30 +0000 (16:55 -0700)
committerJakub Kicinski <kuba@kernel.org>
Sat, 24 Oct 2020 01:37:23 +0000 (18:37 -0700)
Kmemleak pointed out to us that ionic_rx_flush() is sending
skbs into napi_gro_XXX with a disabled napi context, and these
end up getting lost and leaked.  We can safely remove the flush.

Fixes: 0f3154e6bcb3 ("ionic: Add Tx and Rx handling")
Signed-off-by: Shannon Nelson <snelson@pensando.io>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
drivers/net/ethernet/pensando/ionic/ionic_lif.c
drivers/net/ethernet/pensando/ionic/ionic_txrx.c
drivers/net/ethernet/pensando/ionic/ionic_txrx.h

index 591c644b8e69c48f7d8f2396f377fe28f1e268fd..a12df3946a07cdcb89474d1687755bb2a3019401 100644 (file)
@@ -1656,7 +1656,6 @@ static void ionic_txrx_deinit(struct ionic_lif *lif)
        if (lif->rxqcqs) {
                for (i = 0; i < lif->nxqs && lif->rxqcqs[i]; i++) {
                        ionic_lif_qcq_deinit(lif, lif->rxqcqs[i]);
-                       ionic_rx_flush(&lif->rxqcqs[i]->cq);
                        ionic_rx_empty(&lif->rxqcqs[i]->q);
                }
        }
index 8f6fc7142bc5a13be0a3923ad12ac06ef09deedf..35acb4d66e3110f9da5f74f28fff50e7268d25ee 100644 (file)
@@ -253,19 +253,6 @@ static bool ionic_rx_service(struct ionic_cq *cq, struct ionic_cq_info *cq_info)
        return true;
 }
 
-void ionic_rx_flush(struct ionic_cq *cq)
-{
-       struct ionic_dev *idev = &cq->lif->ionic->idev;
-       u32 work_done;
-
-       work_done = ionic_cq_service(cq, cq->num_descs,
-                                    ionic_rx_service, NULL, NULL);
-
-       if (work_done)
-               ionic_intr_credits(idev->intr_ctrl, cq->bound_intr->index,
-                                  work_done, IONIC_INTR_CRED_RESET_COALESCE);
-}
-
 static int ionic_rx_page_alloc(struct ionic_queue *q,
                               struct ionic_page_info *page_info)
 {
index a5883be0413f6da4e6bbef642f049521182e382c..7667b72232b8a32da7a33eb8e58383707544f61b 100644 (file)
@@ -4,7 +4,6 @@
 #ifndef _IONIC_TXRX_H_
 #define _IONIC_TXRX_H_
 
-void ionic_rx_flush(struct ionic_cq *cq);
 void ionic_tx_flush(struct ionic_cq *cq);
 
 void ionic_rx_fill(struct ionic_queue *q);