[dpdk-stable] [PATCH 17.11] net/sfc/base: fix Tx descriptor max number check

Andrew Rybchenko arybchenko at solarflare.com
Mon Mar 11 09:44:15 CET 2019


From: Igor Romanov <igor.romanov at oktetlabs.ru>

[ backported from upstream commit 31c2379bad4157ca0beb05c9d2b49395b68f373b ]

Fix check of maximum descriptor number (compare with maximum Tx
descriptor number instead of maximum EVQ events number).

Fixes: f7dc06bf35f2 ("net/sfc/base: import 5xxx/6xxx family support")

Signed-off-by: Igor Romanov <igor.romanov at oktetlabs.ru>
Signed-off-by: Andrew Rybchenko <arybchenko at solarflare.com>
---
 drivers/net/sfc/base/efx_tx.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/net/sfc/base/efx_tx.c b/drivers/net/sfc/base/efx_tx.c
index ceb2920..ee0ec9f 100644
--- a/drivers/net/sfc/base/efx_tx.c
+++ b/drivers/net/sfc/base/efx_tx.c
@@ -910,7 +910,8 @@
 	EFSYS_ASSERT(ISP2(encp->enc_txq_max_ndescs));
 	EFX_STATIC_ASSERT(ISP2(EFX_TXQ_MINNDESCS));
 
-	if (!ISP2(n) || (n < EFX_TXQ_MINNDESCS) || (n > EFX_EVQ_MAXNEVS)) {
+	if (!ISP2(n) ||
+	    (n < EFX_TXQ_MINNDESCS) || (n > encp->enc_txq_max_ndescs)) {
 		rc = EINVAL;
 		goto fail1;
 	}
-- 
1.8.3.1



More information about the stable mailing list