From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id E4CB5A0C43; Wed, 16 Jun 2021 20:10:02 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id D2607410DE; Wed, 16 Jun 2021 20:10:02 +0200 (CEST) Received: from mail-pg1-f173.google.com (mail-pg1-f173.google.com [209.85.215.173]) by mails.dpdk.org (Postfix) with ESMTP id 1397040DFD for ; Wed, 16 Jun 2021 20:10:01 +0200 (CEST) Received: by mail-pg1-f173.google.com with SMTP id w31so2650055pga.6 for ; Wed, 16 Jun 2021 11:10:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=broadcom.com; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version; bh=UvGqiOtNtjvveHyok6XrbTN+UtTkWGlywuO0CL34u24=; b=U6jJo8amHgoV1Fke1zzjkGtsHjwQBZ5rTGKi9dttXtPyiqNovDyPfBQ9Uj7xcrF1Pw KRBShQHSqp0ja2/8P4czg6Z/Y0Vs0Z3BpUUCG4AvvPyQwgDnAbM7n8FXW5azoHZMhAvk Hzr20eELJtuNWngcJFFvEz1blUzYOQgNKoC78= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version; bh=UvGqiOtNtjvveHyok6XrbTN+UtTkWGlywuO0CL34u24=; b=OHVuKgLhnnG7KOv0DT3L/v/wa8ZZMNvnUwsID8iPLeKMySSwgDmUqr2O7zu4Pm+2fM aus3yCoWwID8WiA/2ANfmz9OBFsdBhgahdzDe2uSIsOh/TbdErorJ6WoYTOh0kCWL9sS okjTfFkusjLVcsTAOaeruEbebsC7t/oiqzMNem7Q2l6HbM0AqMXkuca8tJNYkY3MwZa4 h+WUEDNkeyCxI6ryga9mucagSCETGGeBb3ubcZyK9sqivfBUqyMqBHUDalKRWlBSC4XE CmiD4a5ohIHCeQlRSyC9aynPLhiYND0gTPpqBCwD0G9R3zwtjl/ccQKQKn5Tysbu/Wz0 SKUw== X-Gm-Message-State: AOAM531Pmazt3od/ko2g/PNTMBABaZZNH7Lyl4IFHCqQX9kcTkVqKBQl lijFwWdsEA8yFAWU9TqkIzxnfA== X-Google-Smtp-Source: ABdhPJyqKGHif7KNbp7rLlhEN6zstk/A88GbsK08OPB9RpZqWSElkt/b3APOwDqi/wPajlS2rApKRQ== X-Received: by 2002:a63:180c:: with SMTP id y12mr906984pgl.180.1623867000252; Wed, 16 Jun 2021 11:10:00 -0700 (PDT) Received: from lrichardson-VirtualBox.dhcp.broadcom.net ([192.19.231.250]) by smtp.gmail.com with ESMTPSA id q4sm2951401pfh.18.2021.06.16.11.09.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 16 Jun 2021 11:09:59 -0700 (PDT) From: Lance Richardson To: Ajit Khaparde , Somnath Kotur , Jerin Jacob , Ruifeng Wang , Bruce Richardson , Konstantin Ananyev Cc: dev@dpdk.org Date: Wed, 16 Jun 2021 13:55:23 -0400 Message-Id: <20210616175523.930678-5-lance.richardson@broadcom.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210616175523.930678-1-lance.richardson@broadcom.com> References: <20210616175523.930678-1-lance.richardson@broadcom.com> MIME-Version: 1.0 Content-Type: multipart/signed; protocol="application/pkcs7-signature"; micalg=sha-256; boundary="000000000000bb0f2905c4e5ff6e" X-Content-Filtered-By: Mailman/MimeDel 2.1.29 Subject: [dpdk-dev] [PATCH 4/4] net/bnxt: remove dead code X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 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" --000000000000bb0f2905c4e5ff6e Content-Transfer-Encoding: 8bit Code related to maintaining completion ring "valid" state is no longer needed, remove it. Signed-off-by: Lance Richardson Reviewed-by: Ajit Khaparde Reviewed-by: Somnath Kotur --- drivers/net/bnxt/bnxt_cpr.h | 17 ----------------- drivers/net/bnxt/bnxt_hwrm.c | 2 -- drivers/net/bnxt/bnxt_ring.c | 1 - drivers/net/bnxt/bnxt_rxr.c | 11 ----------- drivers/net/bnxt/bnxt_rxtx_vec_neon.c | 3 --- drivers/net/bnxt/bnxt_rxtx_vec_sse.c | 3 --- drivers/net/bnxt/bnxt_txr.c | 2 -- 7 files changed, 39 deletions(-) diff --git a/drivers/net/bnxt/bnxt_cpr.h b/drivers/net/bnxt/bnxt_cpr.h index 28c0a9049..2a56ec52c 100644 --- a/drivers/net/bnxt/bnxt_cpr.h +++ b/drivers/net/bnxt/bnxt_cpr.h @@ -15,14 +15,6 @@ struct bnxt_db_info; (!!(rte_le_to_cpu_32(((struct cmpl_base *)(cmp))->info3_v) & \ CMPL_BASE_V) == !((raw_cons) & ((ring)->ring_size))) -#define CMPL_VALID(cmp, v) \ - (!!(rte_le_to_cpu_32(((struct cmpl_base *)(cmp))->info3_v) & \ - CMPL_BASE_V) == !(v)) - -#define NQ_CMP_VALID(nqcmp, raw_cons, ring) \ - (!!((nqcmp)->v & rte_cpu_to_le_32(NQ_CN_V)) == \ - !((raw_cons) & ((ring)->ring_size))) - #define CMP_TYPE(cmp) \ (((struct cmpl_base *)cmp)->type & CMPL_BASE_TYPE_MASK) @@ -35,18 +27,10 @@ struct bnxt_db_info; #define RING_CMP(ring, idx) ((idx) & (ring)->ring_mask) #define RING_CMPL(ring_mask, idx) ((idx) & (ring_mask)) #define NEXT_CMP(idx) RING_CMP(ADV_RAW_CMP(idx, 1)) -#define FLIP_VALID(cons, mask, val) ((cons) >= (mask) ? !(val) : (val)) #define DB_CP_REARM_FLAGS (DB_KEY_CP | DB_IDX_VALID) #define DB_CP_FLAGS (DB_KEY_CP | DB_IDX_VALID | DB_IRQ_DIS) -#define NEXT_CMPL(cpr, idx, v, inc) do { \ - (idx) += (inc); \ - if (unlikely((idx) >= (cpr)->cp_ring_struct->ring_size)) { \ - (v) = !(v); \ - (idx) = 0; \ - } \ -} while (0) #define B_CP_DB_REARM(cpr, raw_cons) \ rte_write32((DB_CP_REARM_FLAGS | \ DB_RING_IDX(&((cpr)->cp_db), raw_cons)), \ @@ -107,7 +91,6 @@ struct bnxt_cp_ring_info { uint32_t hw_stats_ctx_id; struct bnxt_ring *cp_ring_struct; - bool valid; }; #define RX_CMP_L2_ERRORS \ diff --git a/drivers/net/bnxt/bnxt_hwrm.c b/drivers/net/bnxt/bnxt_hwrm.c index 6eab2342f..9ec65ad22 100644 --- a/drivers/net/bnxt/bnxt_hwrm.c +++ b/drivers/net/bnxt/bnxt_hwrm.c @@ -2670,7 +2670,6 @@ void bnxt_free_nq_ring(struct bnxt *bp, struct bnxt_cp_ring_info *cpr) memset(cpr->cp_desc_ring, 0, cpr->cp_ring_struct->ring_size * sizeof(*cpr->cp_desc_ring)); cpr->cp_raw_cons = 0; - cpr->valid = 0; } void bnxt_free_cp_ring(struct bnxt *bp, struct bnxt_cp_ring_info *cpr) @@ -2684,7 +2683,6 @@ void bnxt_free_cp_ring(struct bnxt *bp, struct bnxt_cp_ring_info *cpr) memset(cpr->cp_desc_ring, 0, cpr->cp_ring_struct->ring_size * sizeof(*cpr->cp_desc_ring)); cpr->cp_raw_cons = 0; - cpr->valid = 0; } void bnxt_free_hwrm_rx_ring(struct bnxt *bp, int queue_index) diff --git a/drivers/net/bnxt/bnxt_ring.c b/drivers/net/bnxt/bnxt_ring.c index 4a90ac264..cb18dfba7 100644 --- a/drivers/net/bnxt/bnxt_ring.c +++ b/drivers/net/bnxt/bnxt_ring.c @@ -769,7 +769,6 @@ int bnxt_alloc_async_cp_ring(struct bnxt *bp) return rc; cpr->cp_raw_cons = 0; - cpr->valid = 0; bnxt_set_db(bp, &cpr->cp_db, ring_type, 0, cp_ring->fw_ring_id, cp_ring->ring_mask); diff --git a/drivers/net/bnxt/bnxt_rxr.c b/drivers/net/bnxt/bnxt_rxr.c index 756a45ba9..0dee73af8 100644 --- a/drivers/net/bnxt/bnxt_rxr.c +++ b/drivers/net/bnxt/bnxt_rxr.c @@ -297,9 +297,6 @@ static int bnxt_agg_bufs_valid(struct bnxt_cp_ring_info *cpr, raw_cp_cons = ADV_RAW_CMP(raw_cp_cons, agg_bufs); last_cp_cons = RING_CMP(cpr->cp_ring_struct, raw_cp_cons); agg_cmpl = (struct rx_pkt_cmpl *)&cpr->cp_desc_ring[last_cp_cons]; - cpr->valid = FLIP_VALID(raw_cp_cons, - cpr->cp_ring_struct->ring_mask, - cpr->valid); return CMP_VALID(agg_cmpl, raw_cp_cons, cpr->cp_ring_struct); } @@ -898,10 +895,6 @@ static int bnxt_rx_pkt(struct rte_mbuf **rx_pkt, if (!CMP_VALID(rxcmp1, tmp_raw_cons, cpr->cp_ring_struct)) return -EBUSY; - cpr->valid = FLIP_VALID(cp_cons, - cpr->cp_ring_struct->ring_mask, - cpr->valid); - if (cmp_type == RX_TPA_START_CMPL_TYPE_RX_TPA_START || cmp_type == RX_TPA_START_V2_CMPL_TYPE_RX_TPA_START_V2) { bnxt_tpa_start(rxq, (struct rx_tpa_start_cmpl *)rxcmp, @@ -1086,10 +1079,6 @@ uint16_t bnxt_recv_pkts(void *rx_queue, struct rte_mbuf **rx_pkts, if (!CMP_VALID(rxcmp, raw_cons, cpr->cp_ring_struct)) break; - cpr->valid = FLIP_VALID(cons, - cpr->cp_ring_struct->ring_mask, - cpr->valid); - if (CMP_TYPE(rxcmp) == CMPL_BASE_TYPE_HWRM_DONE) { PMD_DRV_LOG(ERR, "Rx flush done\n"); } else if ((CMP_TYPE(rxcmp) >= CMPL_BASE_TYPE_RX_TPA_START_V2) && diff --git a/drivers/net/bnxt/bnxt_rxtx_vec_neon.c b/drivers/net/bnxt/bnxt_rxtx_vec_neon.c index b4e920256..263e6ec3c 100644 --- a/drivers/net/bnxt/bnxt_rxtx_vec_neon.c +++ b/drivers/net/bnxt/bnxt_rxtx_vec_neon.c @@ -296,8 +296,6 @@ recv_burst_vec_neon(void *rx_queue, struct rte_mbuf **rx_pkts, uint16_t nb_pkts) rxq->rxrearm_nb += nb_rx_pkts; cpr->cp_raw_cons += 2 * nb_rx_pkts; - cpr->valid = - !!(cpr->cp_raw_cons & cpr->cp_ring_struct->ring_size); bnxt_db_cq(cpr); } @@ -353,7 +351,6 @@ bnxt_handle_tx_cp_vec(struct bnxt_tx_queue *txq) raw_cons = NEXT_RAW_CMP(raw_cons); } while (nb_tx_pkts < ring_mask); - cpr->valid = !!(raw_cons & cp_ring_struct->ring_size); if (nb_tx_pkts) { if (txq->offloads & DEV_TX_OFFLOAD_MBUF_FAST_FREE) bnxt_tx_cmp_vec_fast(txq, nb_tx_pkts); diff --git a/drivers/net/bnxt/bnxt_rxtx_vec_sse.c b/drivers/net/bnxt/bnxt_rxtx_vec_sse.c index c479697ac..9a53d1fba 100644 --- a/drivers/net/bnxt/bnxt_rxtx_vec_sse.c +++ b/drivers/net/bnxt/bnxt_rxtx_vec_sse.c @@ -277,8 +277,6 @@ recv_burst_vec_sse(void *rx_queue, struct rte_mbuf **rx_pkts, uint16_t nb_pkts) rxq->rxrearm_nb += nb_rx_pkts; cpr->cp_raw_cons += 2 * nb_rx_pkts; - cpr->valid = - !!(cpr->cp_raw_cons & cpr->cp_ring_struct->ring_size); bnxt_db_cq(cpr); } @@ -334,7 +332,6 @@ bnxt_handle_tx_cp_vec(struct bnxt_tx_queue *txq) raw_cons = NEXT_RAW_CMP(raw_cons); } while (nb_tx_pkts < ring_mask); - cpr->valid = !!(raw_cons & cp_ring_struct->ring_size); if (nb_tx_pkts) { if (txq->offloads & DEV_TX_OFFLOAD_MBUF_FAST_FREE) bnxt_tx_cmp_vec_fast(txq, nb_tx_pkts); diff --git a/drivers/net/bnxt/bnxt_txr.c b/drivers/net/bnxt/bnxt_txr.c index 54eaab34a..8eb949399 100644 --- a/drivers/net/bnxt/bnxt_txr.c +++ b/drivers/net/bnxt/bnxt_txr.c @@ -474,8 +474,6 @@ static int bnxt_handle_tx_cp(struct bnxt_tx_queue *txq) raw_cons = NEXT_RAW_CMP(raw_cons); } while (nb_tx_pkts < ring_mask); - cpr->valid = !!(raw_cons & cp_ring_struct->ring_size); - if (nb_tx_pkts) { if (txq->offloads & DEV_TX_OFFLOAD_MBUF_FAST_FREE) bnxt_tx_cmp_fast(txq, nb_tx_pkts); -- 2.25.1 --000000000000bb0f2905c4e5ff6e--