Patchwork [dpdk-dev,24/38] net/sfc: use NIC event descritor size instead of common

login
register
mail settings
Submitter Andrew Rybchenko
Date Feb. 7, 2019, 4:29 p.m.
Message ID <1549556983-10896-25-git-send-email-arybchenko@solarflare.com>
Download mbox | patch
Permalink /patch/720867/
State New
Headers show

Comments

Andrew Rybchenko - Feb. 7, 2019, 4:29 p.m.
From: Igor Romanov <igor.romanov@oktetlabs.ru>

Use of the macro for calculating a Rx queue size is deprecated. Replace
it with a call to a function that uses descriptor size specified for
every NIC.

Signed-off-by: Igor Romanov <igor.romanov@oktetlabs.ru>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
---
 drivers/net/sfc/sfc_ev.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

Patch

diff --git a/drivers/net/sfc/sfc_ev.c b/drivers/net/sfc/sfc_ev.c
index 939766dc2..59928332a 100644
--- a/drivers/net/sfc/sfc_ev.c
+++ b/drivers/net/sfc/sfc_ev.c
@@ -599,7 +599,8 @@  sfc_ev_qstart(struct sfc_evq *evq, unsigned int hw_index)
 	evq->evq_index = hw_index;
 
 	/* Clear all events */
-	(void)memset((void *)esmp->esm_base, 0xff, EFX_EVQ_SIZE(evq->entries));
+	(void)memset((void *)esmp->esm_base, 0xff,
+		     efx_evq_size(sa->nic, evq->entries));
 
 	if (sa->intr.lsc_intr && hw_index == sa->mgmt_evq_index)
 		evq_flags |= EFX_EVQ_FLAGS_NOTIFY_INTERRUPT;
@@ -823,7 +824,8 @@  sfc_ev_qinit(struct sfc_adapter *sa,
 
 	/* Allocate DMA space */
 	rc = sfc_dma_alloc(sa, sfc_evq_type2str(type), type_index,
-			   EFX_EVQ_SIZE(evq->entries), socket_id, &evq->mem);
+			   efx_evq_size(sa->nic, evq->entries), socket_id,
+			   &evq->mem);
 	if (rc != 0)
 		goto fail_dma_alloc;