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 6F30FA0521; Thu, 23 Jul 2020 14:06:13 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 57F021C139; Thu, 23 Jul 2020 14:02:47 +0200 (CEST) Received: from relay.smtp.broadcom.com (unknown [192.19.211.62]) by dpdk.org (Postfix) with ESMTP id 06AB81BFD7 for ; Thu, 23 Jul 2020 14:02:08 +0200 (CEST) Received: from dhcp-10-123-153-55.dhcp.broadcom.net (bgccx-dev-host-lnx35.bec.broadcom.net [10.123.153.55]) by relay.smtp.broadcom.com (Postfix) with ESMTP id 9265E29AE2E; Thu, 23 Jul 2020 05:02:07 -0700 (PDT) DKIM-Filter: OpenDKIM Filter v2.10.3 relay.smtp.broadcom.com 9265E29AE2E DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=broadcom.com; s=dkimrelay; t=1595505727; bh=UCm6Q9sSGvV/R5+ZqoJBNvXKbGaVTV6PBF7UzC6XH5g=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=MDI+Rij6a7eqog8g2FZ3eWllOrWydTk/RzVzKfbcqSKzT6WQOp5T9dsujjMW8u7vD WX4E0uHGj3+R1/FklM/3erTk1LhtAKCC+16+qss7iPs/I8NIXdoEi+PquLqlqtJAnW xjjzcCxYduaGH/GGclVBMVfwJRVXwKVLVfnT0ddw= From: Somnath Kotur To: dev@dpdk.org Cc: ferruh.yigit@intel.com Date: Thu, 23 Jul 2020 17:26:39 +0530 Message-Id: <20200723115639.22357-21-somnath.kotur@broadcom.com> X-Mailer: git-send-email 2.10.1.613.g2cc2e70 In-Reply-To: <20200723115639.22357-1-somnath.kotur@broadcom.com> References: <20200723111329.21855-1-somnath.kotur@broadcom.com> <20200723115639.22357-1-somnath.kotur@broadcom.com> Subject: [dpdk-dev] [PATCH v2 20/20] net/bnxt: cleanup of VF-representor dev ops 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" No need to access rx_cfa_code, cfa_code_map from the VF-Rep functions anymore. Fixes: 322bd6e70272 ("net/bnxt: add port representor infrastructure") Reviewed-by: Venkat Duvvuru Signed-off-by: Somnath Kotur --- drivers/net/bnxt/bnxt.h | 1 - drivers/net/bnxt/bnxt_reps.c | 75 +++++--------------------------------------- 2 files changed, 7 insertions(+), 69 deletions(-) diff --git a/drivers/net/bnxt/bnxt.h b/drivers/net/bnxt/bnxt.h index 41e7ae5..f4b2a3f 100644 --- a/drivers/net/bnxt/bnxt.h +++ b/drivers/net/bnxt/bnxt.h @@ -799,7 +799,6 @@ struct bnxt_vf_representor { uint16_t dflt_vnic_id; uint16_t svif; uint16_t vfr_tx_cfa_action; - uint16_t rx_cfa_code; uint32_t rep2vf_flow_id; uint32_t vf2rep_flow_id; /* Private data store of associated PF/Trusted VF */ diff --git a/drivers/net/bnxt/bnxt_reps.c b/drivers/net/bnxt/bnxt_reps.c index 2f775e0..6fa9a30 100644 --- a/drivers/net/bnxt/bnxt_reps.c +++ b/drivers/net/bnxt/bnxt_reps.c @@ -230,6 +230,9 @@ int bnxt_vf_rep_link_update_op(struct rte_eth_dev *eth_dev, int wait_to_compl) int rc; parent_bp = rep->parent_dev->data->dev_private; + if (!parent_bp) + return 0; + rc = bnxt_link_update_op(parent_bp->eth_dev, wait_to_compl); /* Link state. Inherited from PF or trusted VF */ @@ -324,7 +327,7 @@ static int bnxt_vfr_alloc(struct rte_eth_dev *vfr_ethdev) } /* Check if representor has been already allocated in FW */ - if (vfr->vfr_tx_cfa_action && vfr->rx_cfa_code) + if (vfr->vfr_tx_cfa_action) return 0; /* @@ -406,9 +409,11 @@ static int bnxt_vfr_free(struct bnxt_vf_representor *vfr) } parent_bp = vfr->parent_dev->data->dev_private; + if (!parent_bp) + return 0; /* Check if representor has been already freed in FW */ - if (!vfr->vfr_tx_cfa_action && !vfr->rx_cfa_code) + if (!vfr->vfr_tx_cfa_action) return 0; rc = bnxt_tf_vfr_free(vfr); @@ -419,11 +424,9 @@ static int bnxt_vfr_free(struct bnxt_vf_representor *vfr) return rc; } - parent_bp->cfa_code_map[vfr->rx_cfa_code] = BNXT_VF_IDX_INVALID; PMD_DRV_LOG(DEBUG, "freed representor %d in FW\n", vfr->vf_id); vfr->vfr_tx_cfa_action = 0; - vfr->rx_cfa_code = 0; rc = bnxt_hwrm_cfa_vfr_free(parent_bp, vfr->vf_id); @@ -456,7 +459,6 @@ int bnxt_vf_rep_dev_info_get_op(struct rte_eth_dev *eth_dev, { struct bnxt_vf_representor *rep_bp = eth_dev->data->dev_private; struct bnxt *parent_bp; - uint16_t max_vnics, i, j, vpool, vrxq; unsigned int max_rx_rings; int rc = 0; @@ -476,7 +478,6 @@ int bnxt_vf_rep_dev_info_get_op(struct rte_eth_dev *eth_dev, dev_info->max_tx_queues = max_rx_rings; dev_info->reta_size = bnxt_rss_hash_tbl_size(parent_bp); dev_info->hash_key_size = 40; - max_vnics = parent_bp->max_vnics; /* MTU specifics */ dev_info->min_mtu = RTE_ETHER_MIN_MTU; @@ -492,68 +493,6 @@ int bnxt_vf_rep_dev_info_get_op(struct rte_eth_dev *eth_dev, dev_info->tx_offload_capa = BNXT_DEV_TX_OFFLOAD_SUPPORT; dev_info->flow_type_rss_offloads = BNXT_ETH_RSS_SUPPORT; - /* *INDENT-OFF* */ - dev_info->default_rxconf = (struct rte_eth_rxconf) { - .rx_thresh = { - .pthresh = 8, - .hthresh = 8, - .wthresh = 0, - }, - .rx_free_thresh = 32, - /* If no descriptors available, pkts are dropped by default */ - .rx_drop_en = 1, - }; - - dev_info->default_txconf = (struct rte_eth_txconf) { - .tx_thresh = { - .pthresh = 32, - .hthresh = 0, - .wthresh = 0, - }, - .tx_free_thresh = 32, - .tx_rs_thresh = 32, - }; - eth_dev->data->dev_conf.intr_conf.lsc = 1; - - eth_dev->data->dev_conf.intr_conf.rxq = 1; - dev_info->rx_desc_lim.nb_min = BNXT_MIN_RING_DESC; - dev_info->rx_desc_lim.nb_max = BNXT_MAX_RX_RING_DESC; - dev_info->tx_desc_lim.nb_min = BNXT_MIN_RING_DESC; - dev_info->tx_desc_lim.nb_max = BNXT_MAX_TX_RING_DESC; - - /* *INDENT-ON* */ - - /* - * TODO: default_rxconf, default_txconf, rx_desc_lim, and tx_desc_lim - * need further investigation. - */ - - /* VMDq resources */ - vpool = 64; /* ETH_64_POOLS */ - vrxq = 128; /* ETH_VMDQ_DCB_NUM_QUEUES */ - for (i = 0; i < 4; vpool >>= 1, i++) { - if (max_vnics > vpool) { - for (j = 0; j < 5; vrxq >>= 1, j++) { - if (dev_info->max_rx_queues > vrxq) { - if (vpool > vrxq) - vpool = vrxq; - goto found; - } - } - /* Not enough resources to support VMDq */ - break; - } - } - /* Not enough resources to support VMDq */ - vpool = 0; - vrxq = 0; -found: - dev_info->max_vmdq_pools = vpool; - dev_info->vmdq_queue_num = vrxq; - - dev_info->vmdq_pool_base = 0; - dev_info->vmdq_queue_base = 0; - return 0; } -- 2.7.4