[v3,30/60] common/sfc_efx/base: free Rx queue structure in generic code
diff mbox series

Message ID 1600949555-28043-31-git-send-email-arybchenko@solarflare.com
State Accepted
Delegated to: Ferruh Yigit
Headers show
Series
  • common/sfc_efx: support Riverhead NIC family
Related show

Checks

Context Check Description
ci/checkpatch warning coding style issues

Commit Message

Andrew Rybchenko Sept. 24, 2020, 12:12 p.m. UTC
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 | 3 ---
 drivers/common/sfc_efx/base/efx_rx.c  | 6 +++---
 2 files changed, 3 insertions(+), 6 deletions(-)

Patch
diff mbox series

diff --git a/drivers/common/sfc_efx/base/ef10_rx.c b/drivers/common/sfc_efx/base/ef10_rx.c
index 7004ab2aca..58152be768 100644
--- a/drivers/common/sfc_efx/base/ef10_rx.c
+++ b/drivers/common/sfc_efx/base/ef10_rx.c
@@ -1015,13 +1015,10 @@  ef10_rx_qcreate(
 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
diff --git a/drivers/common/sfc_efx/base/efx_rx.c b/drivers/common/sfc_efx/base/efx_rx.c
index a361112849..d208c2292e 100644
--- a/drivers/common/sfc_efx/base/efx_rx.c
+++ b/drivers/common/sfc_efx/base/efx_rx.c
@@ -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