net/sfc/base: fix Tx descriptor max number check
authorIgor Romanov <igor.romanov@oktetlabs.ru>
Wed, 9 Jan 2019 11:12:07 +0000 (11:12 +0000)
committerFerruh Yigit <ferruh.yigit@intel.com>
Mon, 14 Jan 2019 16:44:29 +0000 (17:44 +0100)
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")
Cc: stable@dpdk.org
Signed-off-by: Igor Romanov <igor.romanov@oktetlabs.ru>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
drivers/net/sfc/base/efx_tx.c

index bf1180a..9fa9e2e 100644 (file)
@@ -926,7 +926,8 @@ siena_tx_qcreate(
        EFX_STATIC_ASSERT(ISP2(EFX_TXQ_MINNDESCS));
 
        if (!ISP2(ndescs) ||
-           (ndescs < EFX_TXQ_MINNDESCS) || (ndescs > EFX_EVQ_MAXNEVS)) {
+           (ndescs < EFX_TXQ_MINNDESCS) ||
+           (ndescs > encp->enc_txq_max_ndescs)) {
                rc = EINVAL;
                goto fail1;
        }