From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id F3236A04E1; Tue, 22 Sep 2020 11:00:42 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id E4FAC1D53A; Tue, 22 Sep 2020 10:51:38 +0200 (CEST) Received: from dispatch1-us1.ppe-hosted.com (dispatch1-us1.ppe-hosted.com [67.231.154.164]) by dpdk.org (Postfix) with ESMTP id 405591D8CE for ; Tue, 22 Sep 2020 10:50:26 +0200 (CEST) Received: from mx1-us1.ppe-hosted.com (unknown [10.110.50.144]) by dispatch1-us1.ppe-hosted.com (PPE Hosted ESMTP Server) with ESMTP id DBF0920079 for ; Tue, 22 Sep 2020 08:50:25 +0000 (UTC) Received: from us4-mdac16-30.at1.mdlocal (unknown [10.110.49.214]) by mx1-us1.ppe-hosted.com (PPE Hosted ESMTP Server) with ESMTP id DB956800A4 for ; Tue, 22 Sep 2020 08:50:25 +0000 (UTC) X-Virus-Scanned: Proofpoint Essentials engine Received: from mx1-us1.ppe-hosted.com (unknown [10.110.50.12]) by mx1-us1.ppe-hosted.com (PPE Hosted ESMTP Server) with ESMTPS id EB9FF40060 for ; Tue, 22 Sep 2020 08:50:19 +0000 (UTC) Received: from webmail.solarflare.com (uk.solarflare.com [193.34.186.16]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by mx1-us1.ppe-hosted.com (PPE Hosted ESMTP Server) with ESMTPS id B50EF4005B for ; Tue, 22 Sep 2020 08:50:19 +0000 (UTC) Received: from ukex01.SolarFlarecom.com (10.17.10.4) by ukex01.SolarFlarecom.com (10.17.10.4) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Tue, 22 Sep 2020 09:50:10 +0100 Received: from opal.uk.solarflarecom.com (10.17.10.1) by ukex01.SolarFlarecom.com (10.17.10.4) with Microsoft SMTP Server id 15.0.1497.2 via Frontend Transport; Tue, 22 Sep 2020 09:50:10 +0100 Received: from ukv-loginhost.uk.solarflarecom.com (ukv-loginhost.uk.solarflarecom.com [10.17.10.39]) by opal.uk.solarflarecom.com (8.13.8/8.13.8) with ESMTP id 08M8oAoC004709 for ; Tue, 22 Sep 2020 09:50:10 +0100 Received: from ukv-loginhost.uk.solarflarecom.com (localhost [127.0.0.1]) by ukv-loginhost.uk.solarflarecom.com (Postfix) with ESMTP id 91FB11613A9 for ; Tue, 22 Sep 2020 09:50:10 +0100 (BST) From: Andrew Rybchenko To: Date: Tue, 22 Sep 2020 09:49:23 +0100 Message-ID: <1600764594-14752-30-git-send-email-arybchenko@solarflare.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1600764594-14752-1-git-send-email-arybchenko@solarflare.com> References: <1600764594-14752-1-git-send-email-arybchenko@solarflare.com> MIME-Version: 1.0 Content-Type: text/plain X-TM-AS-Product-Ver: SMEX-12.5.0.1300-8.6.1012-25674.003 X-TM-AS-Result: No-1.781200-8.000000-10 X-TMASE-MatchedRID: m5OprH8CLZCaVIIaatNFMCZm6wdY+F8KSoCG4sefl8RKddiF2Wo8eaJF mbmfOdw3Jhc7ZyunPkUWsp6eJb7A2xt/FEV6QNBCnFVnNmvv47tLXPA26IG0hN9RlPzeVuQQrIV tWePlRJHBpZJtALK4pJiZtB0b70pFGURp8zeLWy/HmyDJSEsI2+6jyigxCo6yrlV24CuN0IZnY0 nSyjeN3eLzNWBegCW2wgn7iDBesS1YF3qW3Je6+0KHP2ZsKkf0QFGuVXX4dA0/+ZnAPtkrDfB8w x2Mtm3fXYYiVu68oYGKou2TcCKqurEsM3A0blLU+Gx/pItXTcRaP5+mZKuUIKoWu33FSCn66r5P Qhx29DUG0+3lZBNmQtq4RBohbjorhiKda4whv6J+3BndfXUhXQ== X-TM-AS-User-Approved-Sender: Yes X-TM-AS-User-Blocked-Sender: No X-TMASE-Result: 10-1.781200-8.000000 X-TMASE-Version: SMEX-12.5.0.1300-8.6.1012-25674.003 X-MDID: 1600764620-CWkidwf8XTgr Subject: [dpdk-dev] [PATCH 29/60] common/sfc_efx/base: maintain RxQ counter in generic code X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" The counter is incremeted in generic efx_rx_qcreate(), but was asserted and decremented in NIC family specific queue create and destroy callbacks. Move assert and decrement to generic functions as well to make NIC family specific callbacks shorter. Signed-off-by: Andrew Rybchenko Reviewed-by: Andy Moreton --- drivers/common/sfc_efx/base/ef10_rx.c | 4 ---- drivers/common/sfc_efx/base/efx_rx.c | 9 +++++---- 2 files changed, 5 insertions(+), 8 deletions(-) diff --git a/drivers/common/sfc_efx/base/ef10_rx.c b/drivers/common/sfc_efx/base/ef10_rx.c index f27058963f..7004ab2aca 100644 --- a/drivers/common/sfc_efx/base/ef10_rx.c +++ b/drivers/common/sfc_efx/base/ef10_rx.c @@ -844,7 +844,6 @@ ef10_rx_qcreate( EFX_STATIC_ASSERT(EFX_EV_RX_NLABELS == (1 << ESF_DZ_RX_QLABEL_WIDTH)); EFSYS_ASSERT3U(label, <, EFX_EV_RX_NLABELS); - EFSYS_ASSERT3U(enp->en_rx_qcount + 1, <, encp->enc_rxq_limit); if (index >= encp->enc_rxq_limit) { rc = EINVAL; @@ -1022,9 +1021,6 @@ ef10_rx_qdestroy( ef10_ev_rxlabel_fini(eep, label); - EFSYS_ASSERT(enp->en_rx_qcount != 0); - --enp->en_rx_qcount; - EFSYS_KMEM_FREE(enp->en_esip, sizeof (efx_rxq_t), erp); } diff --git a/drivers/common/sfc_efx/base/efx_rx.c b/drivers/common/sfc_efx/base/efx_rx.c index cce34cfce9..a361112849 100644 --- a/drivers/common/sfc_efx/base/efx_rx.c +++ b/drivers/common/sfc_efx/base/efx_rx.c @@ -819,6 +819,8 @@ efx_rx_qcreate_internal( EFSYS_ASSERT3U(enp->en_magic, ==, EFX_NIC_MAGIC); EFSYS_ASSERT3U(enp->en_mod_flags, &, EFX_MOD_RX); + EFSYS_ASSERT3U(enp->en_rx_qcount + 1, <, encp->enc_rxq_limit); + EFSYS_ASSERT(ISP2(encp->enc_rxq_max_ndescs)); EFSYS_ASSERT(ISP2(encp->enc_rxq_min_ndescs)); @@ -975,6 +977,9 @@ efx_rx_qdestroy( EFSYS_ASSERT3U(erp->er_magic, ==, EFX_RXQ_MAGIC); + EFSYS_ASSERT(enp->en_rx_qcount != 0); + --enp->en_rx_qcount; + erxop->erxo_qdestroy(erp); } @@ -1626,7 +1631,6 @@ siena_rx_qcreate( EFX_STATIC_ASSERT(EFX_EV_RX_NLABELS == (1 << FRF_AZ_RX_DESCQ_LABEL_WIDTH)); EFSYS_ASSERT3U(label, <, EFX_EV_RX_NLABELS); - EFSYS_ASSERT3U(enp->en_rx_qcount + 1, <, encp->enc_rxq_limit); if (index >= encp->enc_rxq_limit) { rc = EINVAL; @@ -1697,9 +1701,6 @@ siena_rx_qdestroy( efx_nic_t *enp = erp->er_enp; efx_oword_t oword; - EFSYS_ASSERT(enp->en_rx_qcount != 0); - --enp->en_rx_qcount; - /* Purge descriptor queue */ EFX_ZERO_OWORD(oword); -- 2.17.1