[16/38] net/sfc/base: make max number of TxQ bufs EF10-specific

Message ID 1549556983-10896-17-git-send-email-arybchenko@solarflare.com
State Accepted, archived
Delegated to: Ferruh Yigit
Headers show
Series
  • net/sfc: update base driver
Related show

Checks

Context Check Description
ci/checkpatch success coding style OK

Commit Message

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

The define EFX_TXQ_MAX_BUFS is used only by EF10 family implementation.
Since the macro is not used by any drivers, it does not require
exposed libefx interface.
Make the define EF10-specific.

Signed-off-by: Igor Romanov <igor.romanov@oktetlabs.ru>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
---
 drivers/net/sfc/base/ef10_impl.h | 3 +++
 drivers/net/sfc/base/ef10_tx.c   | 5 +++--
 drivers/net/sfc/base/efx.h       | 2 --
 3 files changed, 6 insertions(+), 4 deletions(-)

Patch

diff --git a/drivers/net/sfc/base/ef10_impl.h b/drivers/net/sfc/base/ef10_impl.h
index 44f7f635d..12747f43c 100644
--- a/drivers/net/sfc/base/ef10_impl.h
+++ b/drivers/net/sfc/base/ef10_impl.h
@@ -19,6 +19,9 @@  extern "C" {
 
 #define	EF10_TXQ_MINNDESCS	512
 
+/* Maximum independent of EFX_BUG35388_WORKAROUND. */
+#define	EF10_TXQ_MAXNBUFS	8
+
 /* Number of hardware PIO buffers (for compile-time resource dimensions) */
 #define	EF10_MAX_PIOBUF_NBUFS	(16)
 
diff --git a/drivers/net/sfc/base/ef10_tx.c b/drivers/net/sfc/base/ef10_tx.c
index 5f3df42b9..aacf4310a 100644
--- a/drivers/net/sfc/base/ef10_tx.c
+++ b/drivers/net/sfc/base/ef10_tx.c
@@ -31,7 +31,8 @@  efx_mcdi_init_txq(
 	__in		efsys_mem_t *esmp)
 {
 	efx_mcdi_req_t req;
-	EFX_MCDI_DECLARE_BUF(payload, MC_CMD_INIT_TXQ_IN_LEN(EFX_TXQ_MAX_BUFS),
+	EFX_MCDI_DECLARE_BUF(payload,
+		MC_CMD_INIT_TXQ_IN_LEN(EF10_TXQ_MAXNBUFS),
 		MC_CMD_INIT_TXQ_OUT_LEN);
 	efx_qword_t *dma_addr;
 	uint64_t addr;
@@ -39,7 +40,7 @@  efx_mcdi_init_txq(
 	int i;
 	efx_rc_t rc;
 
-	EFSYS_ASSERT(EFX_TXQ_MAX_BUFS >=
+	EFSYS_ASSERT(EF10_TXQ_MAXNBUFS >=
 	    EFX_TXQ_NBUFS(enp->en_nic_cfg.enc_txq_max_ndescs));
 
 	if ((esmp == NULL) || (EFSYS_MEM_SIZE(esmp) < EFX_TXQ_SIZE(ndescs))) {
diff --git a/drivers/net/sfc/base/efx.h b/drivers/net/sfc/base/efx.h
index 71500d6b8..d8914aa7c 100644
--- a/drivers/net/sfc/base/efx.h
+++ b/drivers/net/sfc/base/efx.h
@@ -2649,8 +2649,6 @@  efx_tx_fini(
 #define	EFX_TXQ_NBUFS(_ndescs)		(EFX_TXQ_SIZE(_ndescs) / EFX_BUF_SIZE)
 #define	EFX_TXQ_LIMIT(_ndescs)		((_ndescs) - 16)
 
-#define	EFX_TXQ_MAX_BUFS 8 /* Maximum independent of EFX_BUG35388_WORKAROUND. */
-
 #define	EFX_TXQ_CKSUM_IPV4		0x0001
 #define	EFX_TXQ_CKSUM_TCPUDP		0x0002
 #define	EFX_TXQ_FATSOV2			0x0004