From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-gw3-out.broadcom.com (mail-gw3-out.broadcom.com [216.31.210.64]) by dpdk.org (Postfix) with ESMTP id 1652E5AB8 for ; Tue, 7 Jun 2016 00:09:32 +0200 (CEST) X-IronPort-AV: E=Sophos;i="5.26,429,1459839600"; d="scan'208";a="96478866" Received: from mail-irv-18.broadcom.com ([10.15.198.37]) by mail-gw3-out.broadcom.com with ESMTP; 06 Jun 2016 15:28:33 -0700 Received: from mail-irva-12.broadcom.com (mail-irva-12.broadcom.com [10.11.16.101]) by mail-irv-18.broadcom.com (Postfix) with ESMTP id 763F282032; Mon, 6 Jun 2016 15:09:31 -0700 (PDT) Received: from DPDK-C1.broadcom.com (dhcp-10-13-115-104.irv.broadcom.com [10.13.115.104]) by mail-irva-12.broadcom.com (Postfix) with ESMTP id BA07A127621; Mon, 6 Jun 2016 15:09:29 -0700 (PDT) From: Stephen Hurd To: dev@dpdk.org, ajit.khaparde@broadcom.com, bruce.richardson@intel.com Date: Mon, 6 Jun 2016 15:08:43 -0700 Message-Id: <1465250923-78695-39-git-send-email-stephen.hurd@broadcom.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1465250923-78695-1-git-send-email-stephen.hurd@broadcom.com> References: <1465250923-78695-1-git-send-email-stephen.hurd@broadcom.com> Subject: [dpdk-dev] [PATCH v4 39/39] bnxt: Replace bnxt_ring_struct with bnxt_ring X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 Jun 2016 22:09:33 -0000 From: Ajit Khaparde As pointed in the previous round of review, Having struct at the end of the structure bnxt_ring_struct is a redundant. Replace it with bnxt_ring. Signed-off-by: Ajit Khaparde Reviewed-by: David Christensen Signed-off-by: Stephen Hurd --- drivers/net/bnxt/bnxt_cpr.c | 4 ++-- drivers/net/bnxt/bnxt_cpr.h | 4 ++-- drivers/net/bnxt/bnxt_hwrm.c | 10 +++++----- drivers/net/bnxt/bnxt_hwrm.h | 4 ++-- drivers/net/bnxt/bnxt_ring.c | 20 ++++++++++---------- drivers/net/bnxt/bnxt_ring.h | 4 ++-- drivers/net/bnxt/bnxt_rxr.c | 10 +++++----- drivers/net/bnxt/bnxt_rxr.h | 2 +- drivers/net/bnxt/bnxt_txr.c | 8 ++++---- drivers/net/bnxt/bnxt_txr.h | 2 +- 10 files changed, 34 insertions(+), 34 deletions(-) diff --git a/drivers/net/bnxt/bnxt_cpr.c b/drivers/net/bnxt/bnxt_cpr.c index 98f3ca2..f0bfa1f 100644 --- a/drivers/net/bnxt/bnxt_cpr.c +++ b/drivers/net/bnxt/bnxt_cpr.c @@ -133,7 +133,7 @@ void bnxt_free_def_cp_ring(struct bnxt *bp) int bnxt_init_def_ring_struct(struct bnxt *bp, unsigned int socket_id) { struct bnxt_cp_ring_info *cpr; - struct bnxt_ring_struct *ring; + struct bnxt_ring *ring; cpr = rte_zmalloc_socket("bnxt_cp_ring", sizeof(struct bnxt_cp_ring_info), @@ -143,7 +143,7 @@ int bnxt_init_def_ring_struct(struct bnxt *bp, unsigned int socket_id) bp->def_cp_ring = cpr; ring = rte_zmalloc_socket("bnxt_cp_ring_struct", - sizeof(struct bnxt_ring_struct), + sizeof(struct bnxt_ring), RTE_CACHE_LINE_SIZE, socket_id); if (ring == NULL) return -ENOMEM; diff --git a/drivers/net/bnxt/bnxt_cpr.h b/drivers/net/bnxt/bnxt_cpr.h index 3e25a75..c176f8c 100644 --- a/drivers/net/bnxt/bnxt_cpr.h +++ b/drivers/net/bnxt/bnxt_cpr.h @@ -57,7 +57,7 @@ (*(uint32_t *)((cpr)->cp_doorbell) = (DB_CP_FLAGS | \ RING_CMP(cpr->cp_ring_struct, raw_cons))) -struct bnxt_ring_struct; +struct bnxt_ring; struct bnxt_cp_ring_info { uint32_t cp_raw_cons; void *cp_doorbell; @@ -70,7 +70,7 @@ struct bnxt_cp_ring_info { phys_addr_t hw_stats_map; uint32_t hw_stats_ctx_id; - struct bnxt_ring_struct *cp_ring_struct; + struct bnxt_ring *cp_ring_struct; }; #define RX_CMP_L2_ERRORS \ diff --git a/drivers/net/bnxt/bnxt_hwrm.c b/drivers/net/bnxt/bnxt_hwrm.c index 978e379..5d81a60 100644 --- a/drivers/net/bnxt/bnxt_hwrm.c +++ b/drivers/net/bnxt/bnxt_hwrm.c @@ -587,7 +587,7 @@ int bnxt_hwrm_queue_qportcfg(struct bnxt *bp) } int bnxt_hwrm_ring_alloc(struct bnxt *bp, - struct bnxt_ring_struct *ring, + struct bnxt_ring *ring, uint32_t ring_type, uint32_t map_index, uint32_t stats_ctx_id) { @@ -660,7 +660,7 @@ int bnxt_hwrm_ring_alloc(struct bnxt *bp, } int bnxt_hwrm_ring_free(struct bnxt *bp, - struct bnxt_ring_struct *ring, uint32_t ring_type) + struct bnxt_ring *ring, uint32_t ring_type) { int rc; struct hwrm_ring_free_input req = {.req_type = 0 }; @@ -1058,7 +1058,7 @@ int bnxt_free_all_hwrm_ring_grps(struct bnxt *bp) static void bnxt_free_cp_ring(struct bnxt *bp, struct bnxt_cp_ring_info *cpr, unsigned int idx) { - struct bnxt_ring_struct *cp_ring = cpr->cp_ring_struct; + struct bnxt_ring *cp_ring = cpr->cp_ring_struct; bnxt_hwrm_ring_free(bp, cp_ring, HWRM_RING_FREE_INPUT_RING_TYPE_CMPL); @@ -1077,7 +1077,7 @@ int bnxt_free_all_hwrm_rings(struct bnxt *bp) for (i = 0; i < bp->tx_cp_nr_rings; i++) { struct bnxt_tx_queue *txq = bp->tx_queues[i]; struct bnxt_tx_ring_info *txr = txq->tx_ring; - struct bnxt_ring_struct *ring = txr->tx_ring_struct; + struct bnxt_ring *ring = txr->tx_ring_struct; struct bnxt_cp_ring_info *cpr = txq->cp_ring; unsigned int idx = bp->rx_cp_nr_rings + i + 1; @@ -1101,7 +1101,7 @@ int bnxt_free_all_hwrm_rings(struct bnxt *bp) for (i = 0; i < bp->rx_cp_nr_rings; i++) { struct bnxt_rx_queue *rxq = bp->rx_queues[i]; struct bnxt_rx_ring_info *rxr = rxq->rx_ring; - struct bnxt_ring_struct *ring = rxr->rx_ring_struct; + struct bnxt_ring *ring = rxr->rx_ring_struct; struct bnxt_cp_ring_info *cpr = rxq->cp_ring; unsigned int idx = i + 1; diff --git a/drivers/net/bnxt/bnxt_hwrm.h b/drivers/net/bnxt/bnxt_hwrm.h index d1aee1c..7ad5f51 100644 --- a/drivers/net/bnxt/bnxt_hwrm.h +++ b/drivers/net/bnxt/bnxt_hwrm.h @@ -62,11 +62,11 @@ int bnxt_hwrm_func_driver_unregister(struct bnxt *bp, uint32_t flags); int bnxt_hwrm_queue_qportcfg(struct bnxt *bp); int bnxt_hwrm_ring_alloc(struct bnxt *bp, - struct bnxt_ring_struct *ring, + struct bnxt_ring *ring, uint32_t ring_type, uint32_t map_index, uint32_t stats_ctx_id); int bnxt_hwrm_ring_free(struct bnxt *bp, - struct bnxt_ring_struct *ring, uint32_t ring_type); + struct bnxt_ring *ring, uint32_t ring_type); int bnxt_hwrm_ring_grp_alloc(struct bnxt *bp, unsigned int idx); int bnxt_hwrm_ring_grp_free(struct bnxt *bp, unsigned int idx); diff --git a/drivers/net/bnxt/bnxt_ring.c b/drivers/net/bnxt/bnxt_ring.c index 49cfab9..4e0bd35 100644 --- a/drivers/net/bnxt/bnxt_ring.c +++ b/drivers/net/bnxt/bnxt_ring.c @@ -48,7 +48,7 @@ * Generic ring handling */ -void bnxt_free_ring(struct bnxt_ring_struct *ring) +void bnxt_free_ring(struct bnxt_ring *ring) { if (ring->vmem_size && *ring->vmem) { memset((char *)*ring->vmem, 0, ring->vmem_size); @@ -77,7 +77,7 @@ void bnxt_init_ring_grps(struct bnxt *bp) * * Order in the allocation is: * stats - Always non-zero length - * cp vmem - Always zero-length, supported for the bnxt_ring_struct abstraction + * cp vmem - Always zero-length, supported for the bnxt_ring abstraction * tx vmem - Only non-zero length if tx_ring_info is not NULL * rx vmem - Only non-zero length if rx_ring_info is not NULL * cp bd ring - Always non-zero length @@ -90,9 +90,9 @@ int bnxt_alloc_rings(struct bnxt *bp, uint16_t qidx, struct bnxt_cp_ring_info *cp_ring_info, const char *suffix) { - struct bnxt_ring_struct *cp_ring = cp_ring_info->cp_ring_struct; - struct bnxt_ring_struct *rx_ring; - struct bnxt_ring_struct *tx_ring; + struct bnxt_ring *cp_ring = cp_ring_info->cp_ring_struct; + struct bnxt_ring *rx_ring; + struct bnxt_ring *tx_ring; struct rte_pci_device *pdev = bp->pdev; const struct rte_memzone *mz = NULL; char mz_name[RTE_MEMZONE_NAMESIZE]; @@ -214,7 +214,7 @@ int bnxt_alloc_hwrm_rings(struct bnxt *bp) /* Default completion ring */ { struct bnxt_cp_ring_info *cpr = bp->def_cp_ring; - struct bnxt_ring_struct *cp_ring = cpr->cp_ring_struct; + struct bnxt_ring *cp_ring = cpr->cp_ring_struct; rc = bnxt_hwrm_ring_alloc(bp, cp_ring, HWRM_RING_ALLOC_INPUT_RING_TYPE_CMPL, @@ -230,9 +230,9 @@ int bnxt_alloc_hwrm_rings(struct bnxt *bp) for (i = 0; i < bp->rx_cp_nr_rings; i++) { struct bnxt_rx_queue *rxq = bp->rx_queues[i]; struct bnxt_cp_ring_info *cpr = rxq->cp_ring; - struct bnxt_ring_struct *cp_ring = cpr->cp_ring_struct; + struct bnxt_ring *cp_ring = cpr->cp_ring_struct; struct bnxt_rx_ring_info *rxr = rxq->rx_ring; - struct bnxt_ring_struct *ring = rxr->rx_ring_struct; + struct bnxt_ring *ring = rxr->rx_ring_struct; unsigned int idx = i + 1; /* Rx cmpl */ @@ -270,9 +270,9 @@ int bnxt_alloc_hwrm_rings(struct bnxt *bp) for (i = 0; i < bp->tx_cp_nr_rings; i++) { struct bnxt_tx_queue *txq = bp->tx_queues[i]; struct bnxt_cp_ring_info *cpr = txq->cp_ring; - struct bnxt_ring_struct *cp_ring = cpr->cp_ring_struct; + struct bnxt_ring *cp_ring = cpr->cp_ring_struct; struct bnxt_tx_ring_info *txr = txq->tx_ring; - struct bnxt_ring_struct *ring = txr->tx_ring_struct; + struct bnxt_ring *ring = txr->tx_ring_struct; unsigned int idx = 1 + bp->rx_cp_nr_rings + i; /* Tx cmpl */ diff --git a/drivers/net/bnxt/bnxt_ring.h b/drivers/net/bnxt/bnxt_ring.h index e548586..8656549 100644 --- a/drivers/net/bnxt/bnxt_ring.h +++ b/drivers/net/bnxt/bnxt_ring.h @@ -66,7 +66,7 @@ #define INVALID_HW_RING_ID ((uint16_t)-1) -struct bnxt_ring_struct { +struct bnxt_ring { void *bd; phys_addr_t bd_dma; uint32_t ring_size; @@ -91,7 +91,7 @@ struct bnxt; struct bnxt_tx_ring_info; struct bnxt_rx_ring_info; struct bnxt_cp_ring_info; -void bnxt_free_ring(struct bnxt_ring_struct *ring); +void bnxt_free_ring(struct bnxt_ring *ring); void bnxt_init_ring_grps(struct bnxt *bp); int bnxt_alloc_rings(struct bnxt *bp, uint16_t qidx, struct bnxt_tx_ring_info *tx_ring_info, diff --git a/drivers/net/bnxt/bnxt_rxr.c b/drivers/net/bnxt/bnxt_rxr.c index 0ac6f21..5d93de2 100644 --- a/drivers/net/bnxt/bnxt_rxr.c +++ b/drivers/net/bnxt/bnxt_rxr.c @@ -273,7 +273,7 @@ int bnxt_init_rx_ring_struct(struct bnxt_rx_queue *rxq, unsigned int socket_id) struct bnxt *bp = rxq->bp; struct bnxt_cp_ring_info *cpr; struct bnxt_rx_ring_info *rxr; - struct bnxt_ring_struct *ring; + struct bnxt_ring *ring; rxq->rx_buf_use_size = bp->eth_dev->data->mtu + ETHER_HDR_LEN + ETHER_CRC_LEN + @@ -288,7 +288,7 @@ int bnxt_init_rx_ring_struct(struct bnxt_rx_queue *rxq, unsigned int socket_id) rxq->rx_ring = rxr; ring = rte_zmalloc_socket("bnxt_rx_ring_struct", - sizeof(struct bnxt_ring_struct), + sizeof(struct bnxt_ring), RTE_CACHE_LINE_SIZE, socket_id); if (ring == NULL) return -ENOMEM; @@ -308,7 +308,7 @@ int bnxt_init_rx_ring_struct(struct bnxt_rx_queue *rxq, unsigned int socket_id) rxq->cp_ring = cpr; ring = rte_zmalloc_socket("bnxt_rx_ring_struct", - sizeof(struct bnxt_ring_struct), + sizeof(struct bnxt_ring), RTE_CACHE_LINE_SIZE, socket_id); if (ring == NULL) return -ENOMEM; @@ -323,7 +323,7 @@ int bnxt_init_rx_ring_struct(struct bnxt_rx_queue *rxq, unsigned int socket_id) return 0; } -static void bnxt_init_rxbds(struct bnxt_ring_struct *ring, uint32_t type, +static void bnxt_init_rxbds(struct bnxt_ring *ring, uint32_t type, uint16_t len) { uint32_t j; @@ -341,7 +341,7 @@ static void bnxt_init_rxbds(struct bnxt_ring_struct *ring, uint32_t type, int bnxt_init_one_rx_ring(struct bnxt_rx_queue *rxq) { struct bnxt_rx_ring_info *rxr; - struct bnxt_ring_struct *ring; + struct bnxt_ring *ring; uint32_t prod, type; unsigned int i; diff --git a/drivers/net/bnxt/bnxt_rxr.h b/drivers/net/bnxt/bnxt_rxr.h index 7ba8f7b..f766b26 100644 --- a/drivers/net/bnxt/bnxt_rxr.h +++ b/drivers/net/bnxt/bnxt_rxr.h @@ -50,7 +50,7 @@ struct bnxt_rx_ring_info { phys_addr_t rx_desc_mapping; - struct bnxt_ring_struct *rx_ring_struct; + struct bnxt_ring *rx_ring_struct; }; uint16_t bnxt_recv_pkts(void *rx_queue, struct rte_mbuf **rx_pkts, diff --git a/drivers/net/bnxt/bnxt_txr.c b/drivers/net/bnxt/bnxt_txr.c index eef01c7..8bf8fee 100644 --- a/drivers/net/bnxt/bnxt_txr.c +++ b/drivers/net/bnxt/bnxt_txr.c @@ -74,7 +74,7 @@ void bnxt_free_tx_rings(struct bnxt *bp) int bnxt_init_one_tx_ring(struct bnxt_tx_queue *txq) { struct bnxt_tx_ring_info *txr = txq->tx_ring; - struct bnxt_ring_struct *ring = txr->tx_ring_struct; + struct bnxt_ring *ring = txr->tx_ring_struct; txq->tx_wake_thresh = ring->ring_size / 2; ring->fw_ring_id = INVALID_HW_RING_ID; @@ -86,7 +86,7 @@ int bnxt_init_tx_ring_struct(struct bnxt_tx_queue *txq, unsigned int socket_id) { struct bnxt_cp_ring_info *cpr; struct bnxt_tx_ring_info *txr; - struct bnxt_ring_struct *ring; + struct bnxt_ring *ring; txr = rte_zmalloc_socket("bnxt_tx_ring", sizeof(struct bnxt_tx_ring_info), @@ -96,7 +96,7 @@ int bnxt_init_tx_ring_struct(struct bnxt_tx_queue *txq, unsigned int socket_id) txq->tx_ring = txr; ring = rte_zmalloc_socket("bnxt_tx_ring_struct", - sizeof(struct bnxt_ring_struct), + sizeof(struct bnxt_ring), RTE_CACHE_LINE_SIZE, socket_id); if (ring == NULL) return -ENOMEM; @@ -116,7 +116,7 @@ int bnxt_init_tx_ring_struct(struct bnxt_tx_queue *txq, unsigned int socket_id) txq->cp_ring = cpr; ring = rte_zmalloc_socket("bnxt_tx_ring_struct", - sizeof(struct bnxt_ring_struct), + sizeof(struct bnxt_ring), RTE_CACHE_LINE_SIZE, socket_id); if (ring == NULL) return -ENOMEM; diff --git a/drivers/net/bnxt/bnxt_txr.h b/drivers/net/bnxt/bnxt_txr.h index 56d0b08..2176aca 100644 --- a/drivers/net/bnxt/bnxt_txr.h +++ b/drivers/net/bnxt/bnxt_txr.h @@ -53,7 +53,7 @@ struct bnxt_tx_ring_info { #define BNXT_DEV_STATE_CLOSING 0x1 uint32_t dev_state; - struct bnxt_ring_struct *tx_ring_struct; + struct bnxt_ring *tx_ring_struct; }; struct bnxt_sw_tx_bd { -- 1.9.1