]> git.droids-corp.org - dpdk.git/commitdiff
common/sfc_efx/base: free Rx queue structure in generic code
authorAndrew Rybchenko <arybchenko@solarflare.com>
Thu, 24 Sep 2020 12:12:05 +0000 (13:12 +0100)
committerFerruh Yigit <ferruh.yigit@intel.com>
Wed, 30 Sep 2020 17:19:12 +0000 (19:19 +0200)
Rx queue structure is allocated in generic code, but was freed in NIC
family specific callbacks. Move free to generic function makes NIC
family specific callbacks shorter and reduces code duplication.

Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
Reviewed-by: Andy Moreton <amoreton@xilinx.com>
drivers/common/sfc_efx/base/ef10_rx.c
drivers/common/sfc_efx/base/efx_rx.c

index 7004ab2aca10bb7e6eccd124765d9ae7b12b91d0..58152be768bbcba281dd296207e33ed6dc5c1c67 100644 (file)
@@ -1015,13 +1015,10 @@ fail1:
 ef10_rx_qdestroy(
        __in    efx_rxq_t *erp)
 {
-       efx_nic_t *enp = erp->er_enp;
        efx_evq_t *eep = erp->er_eep;
        unsigned int label = erp->er_label;
 
        ef10_ev_rxlabel_fini(eep, label);
-
-       EFSYS_KMEM_FREE(enp->en_esip, sizeof (efx_rxq_t), erp);
 }
 
                void
index a361112849794a9c32eb7a2b2b56b5692a3c7ab5..d208c2292ecdc8603022901778ce61d9b7ef09d8 100644 (file)
@@ -981,6 +981,9 @@ efx_rx_qdestroy(
        --enp->en_rx_qcount;
 
        erxop->erxo_qdestroy(erp);
+
+       /* Free the RXQ object */
+       EFSYS_KMEM_FREE(enp->en_esip, sizeof (efx_rxq_t), erp);
 }
 
        __checkReturn   efx_rc_t
@@ -1706,9 +1709,6 @@ siena_rx_qdestroy(
 
        EFX_BAR_TBL_WRITEO(enp, FR_AZ_RX_DESC_PTR_TBL,
                            erp->er_index, &oword, B_TRUE);
-
-       /* Free the RXQ object */
-       EFSYS_KMEM_FREE(enp->en_esip, sizeof (efx_rxq_t), erp);
 }
 
 static         void