From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from rnd-relay.smtp.broadcom.com (rnd-relay.smtp.broadcom.com [192.19.229.170]) by dpdk.org (Postfix) with ESMTP id 0CE2C1B05C for ; Tue, 19 Jun 2018 23:31:09 +0200 (CEST) Received: from nis-sj1-27.broadcom.com (nis-sj1-27.lvn.broadcom.net [10.75.144.136]) by rnd-relay.smtp.broadcom.com (Postfix) with ESMTP id 8D3A530C06A; Tue, 19 Jun 2018 14:31:05 -0700 (PDT) DKIM-Filter: OpenDKIM Filter v2.10.3 rnd-relay.smtp.broadcom.com 8D3A530C06A DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=broadcom.com; s=dkimrelay; t=1529443865; bh=/aDSiIGrNVnDiQJzYcFL7TQLzOFACF9AzID83WnVEpQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=jfihG/YM4+gIaH8m6jiRQSD3eA2kC4JvvYLCT47Q3mK1j7WJPml4Eyd4bH8Oyraz3 D5Z1DL+84lGFSztfuaFh8088zCckKoYZGCgwRScBds9y/Bk4JRaVjIiKYKRVXhR2HR 7PHpFDVcMxo/NFe206f7l92YTSejmdJuOK+VyxSU= Received: from C02VPB22HTD6.dhcp.broadcom.net (c02vpb22htd6.dhcp.broadcom.net [10.136.50.120]) by nis-sj1-27.broadcom.com (Postfix) with ESMTP id C0B00AC0799; Tue, 19 Jun 2018 14:31:05 -0700 (PDT) From: Ajit Khaparde To: dev@dpdk.org Cc: ferruh.yigit@intel.com, Scott Branden Date: Tue, 19 Jun 2018 14:30:41 -0700 Message-Id: <20180619213058.12273-15-ajit.khaparde@broadcom.com> X-Mailer: git-send-email 2.15.1 (Apple Git-101) In-Reply-To: <20180619213058.12273-1-ajit.khaparde@broadcom.com> References: <20180619213058.12273-1-ajit.khaparde@broadcom.com> Subject: [dpdk-dev] [PATCH 14/31] net/bnxt: code cleanup style of bnxt vnic 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: , X-List-Received-Date: Tue, 19 Jun 2018 21:31:10 -0000 From: Scott Branden Cleanup alignment, brackets, debug string style of bnxt_vnic Signed-off-by: Scott Branden Signed-off-by: Ajit Khaparde --- drivers/net/bnxt/bnxt_vnic.c | 26 +++++++++++++------------- drivers/net/bnxt/bnxt_vnic.h | 8 ++++++-- 2 files changed, 19 insertions(+), 15 deletions(-) diff --git a/drivers/net/bnxt/bnxt_vnic.c b/drivers/net/bnxt/bnxt_vnic.c index 19d06af55..5d9d369a3 100644 --- a/drivers/net/bnxt/bnxt_vnic.c +++ b/drivers/net/bnxt/bnxt_vnic.c @@ -64,8 +64,9 @@ void bnxt_init_vnics(struct bnxt *bp) STAILQ_INIT(&bp->ff_pool[i]); } -int bnxt_free_vnic(struct bnxt *bp, struct bnxt_vnic_info *vnic, - int pool) +int bnxt_free_vnic(struct bnxt *bp, + struct bnxt_vnic_info *vnic, + int pool) { struct bnxt_vnic_info *temp; @@ -143,14 +144,16 @@ int bnxt_alloc_vnic_attributes(struct bnxt *bp) struct rte_pci_device *pdev = bp->pdev; const struct rte_memzone *mz; char mz_name[RTE_MEMZONE_NAMESIZE]; - uint32_t entry_length = RTE_CACHE_LINE_ROUNDUP( - HW_HASH_INDEX_SIZE * sizeof(*vnic->rss_table) + - HW_HASH_KEY_SIZE + - BNXT_MAX_MC_ADDRS * ETHER_ADDR_LEN); + uint32_t entry_length; uint16_t max_vnics; int i; rte_iova_t mz_phys_addr; + entry_length = RTE_CACHE_LINE_ROUNDUP + (HW_HASH_INDEX_SIZE * sizeof(*vnic->rss_table) + + HW_HASH_KEY_SIZE + + BNXT_MAX_MC_ADDRS * ETHER_ADDR_LEN); + max_vnics = bp->max_vnics; snprintf(mz_name, RTE_MEMZONE_NAMESIZE, "bnxt_%04x:%02x:%02x:%02x_vnicattr", pdev->addr.domain, @@ -168,14 +171,11 @@ int bnxt_alloc_vnic_attributes(struct bnxt *bp) } mz_phys_addr = mz->iova; if ((unsigned long)mz->addr == mz_phys_addr) { - PMD_DRV_LOG(WARNING, - "Memzone physical address same as virtual.\n"); - PMD_DRV_LOG(WARNING, - "Using rte_mem_virt2iova()\n"); + PMD_DRV_LOG(WARNING, "Memzone phys addr == virtual\n"); + PMD_DRV_LOG(WARNING, "Using rte_mem_virt2iova()\n"); mz_phys_addr = rte_mem_virt2iova(mz->addr); if (mz_phys_addr == 0) { - PMD_DRV_LOG(ERR, - "unable to map vnic address to physical memory\n"); + PMD_DRV_LOG(ERR, "unable to map vnic addr\n"); return -ENOMEM; } } @@ -234,7 +234,7 @@ int bnxt_alloc_vnic_mem(struct bnxt *bp) vnic_mem = rte_zmalloc("bnxt_vnic_info", max_vnics * sizeof(struct bnxt_vnic_info), 0); if (vnic_mem == NULL) { - PMD_DRV_LOG(ERR, "Failed to alloc memory for %d VNICs", + PMD_DRV_LOG(ERR, "Failed to alloc memory for %d VNICs\n", max_vnics); return -ENOMEM; } diff --git a/drivers/net/bnxt/bnxt_vnic.h b/drivers/net/bnxt/bnxt_vnic.h index c521d7e5a..3401ae098 100644 --- a/drivers/net/bnxt/bnxt_vnic.h +++ b/drivers/net/bnxt/bnxt_vnic.h @@ -58,12 +58,16 @@ struct bnxt_vnic_info { struct bnxt; void bnxt_init_vnics(struct bnxt *bp); -int bnxt_free_vnic(struct bnxt *bp, struct bnxt_vnic_info *vnic, - int pool); + +int bnxt_free_vnic(struct bnxt *bp, + struct bnxt_vnic_info *vnic, + int pool); + struct bnxt_vnic_info *bnxt_alloc_vnic(struct bnxt *bp); void bnxt_free_all_vnics(struct bnxt *bp); void bnxt_free_vnic_attributes(struct bnxt *bp); int bnxt_alloc_vnic_attributes(struct bnxt *bp); void bnxt_free_vnic_mem(struct bnxt *bp); int bnxt_alloc_vnic_mem(struct bnxt *bp); + #endif -- 2.15.1 (Apple Git-101)