From patchwork Mon Dec 2 04:18:09 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kalesh A P X-Patchwork-Id: 63425 X-Patchwork-Delegate: ajit.khaparde@broadcom.com Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 14850A04B5; Mon, 2 Dec 2019 05:07:14 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 9ECFF1BE3D; Mon, 2 Dec 2019 05:06:53 +0100 (CET) Received: from relay.smtp.broadcom.com (relay.smtp.broadcom.com [192.19.211.62]) by dpdk.org (Postfix) with ESMTP id ADC201F28 for ; Mon, 2 Dec 2019 05:06:48 +0100 (CET) Received: from dhcp-10-123-153-22.dhcp.broadcom.net (bgccx-dev-host-lnx2.bec.broadcom.net [10.123.153.22]) by relay.smtp.broadcom.com (Postfix) with ESMTP id CC2E628F873; Sun, 1 Dec 2019 20:06:47 -0800 (PST) DKIM-Filter: OpenDKIM Filter v2.10.3 relay.smtp.broadcom.com CC2E628F873 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=broadcom.com; s=dkimrelay; t=1575259608; bh=d+k7n3Bd7nO0OAimgy9i6pONy3hhPYhPEi6ZZ2B/C4Q=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=JWacYywr9WxlQoB/9dWVsAZR181iYpxoQDXVFqVX03PkV6iCMNw/5WVFv85lhzxxY YU++fl5McUH8kTCxHrUREXWI0Xlc6mfq2KWg3FDukmMs8uVEG1n9uAQaYlreRdtbSZ QwmTy6ciFAZIvt+jcd+wlLZV9mmQp4gCLGysLEbQ= From: Kalesh A P To: dev@dpdk.org Cc: ferruh.yigit@intel.com, ajit.khaparde@broadcom.com Date: Mon, 2 Dec 2019 09:48:09 +0530 Message-Id: <20191202041809.18370-4-kalesh-anakkur.purayil@broadcom.com> X-Mailer: git-send-email 2.10.1 In-Reply-To: <20191202041809.18370-1-kalesh-anakkur.purayil@broadcom.com> References: <20191202041809.18370-1-kalesh-anakkur.purayil@broadcom.com> Subject: [dpdk-dev] [PATCH 3/3] net/bnxt: use macro for getting default 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: , Errors-To: dev-bounces@dpdk.org Sender: "dev" From: Kalesh AP BNXT_GET_DEFAULT_VNIC macro returns the default VNIC of the function and fixed all occurrences of code to use the macro. Signed-off-by: Kalesh AP Reviewed-by: Somnath Kotur --- drivers/net/bnxt/bnxt_ethdev.c | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/drivers/net/bnxt/bnxt_ethdev.c b/drivers/net/bnxt/bnxt_ethdev.c index 081bb46..c70b072 100644 --- a/drivers/net/bnxt/bnxt_ethdev.c +++ b/drivers/net/bnxt/bnxt_ethdev.c @@ -1271,7 +1271,7 @@ static int bnxt_reta_update_op(struct rte_eth_dev *eth_dev, { struct bnxt *bp = eth_dev->data->dev_private; struct rte_eth_conf *dev_conf = &bp->eth_dev->data->dev_conf; - struct bnxt_vnic_info *vnic = &bp->vnic_info[0]; + struct bnxt_vnic_info *vnic = BNXT_GET_DEFAULT_VNIC(bp); uint16_t tbl_size = bnxt_rss_hash_tbl_size(bp); uint16_t idx, sft; int i, rc; @@ -1328,7 +1328,7 @@ static int bnxt_reta_query_op(struct rte_eth_dev *eth_dev, uint16_t reta_size) { struct bnxt *bp = eth_dev->data->dev_private; - struct bnxt_vnic_info *vnic = &bp->vnic_info[0]; + struct bnxt_vnic_info *vnic = BNXT_GET_DEFAULT_VNIC(bp); uint16_t tbl_size = bnxt_rss_hash_tbl_size(bp); uint16_t idx, sft, i; int rc; @@ -1402,7 +1402,7 @@ static int bnxt_rss_hash_update_op(struct rte_eth_dev *eth_dev, memcpy(&bp->rss_conf, rss_conf, sizeof(*rss_conf)); /* Update the default RSS VNIC(s) */ - vnic = &bp->vnic_info[0]; + vnic = BNXT_GET_DEFAULT_VNIC(bp); vnic->hash_type = bnxt_rte_to_hwrm_hash_types(rss_conf->rss_hf); /* @@ -1428,7 +1428,7 @@ static int bnxt_rss_hash_conf_get_op(struct rte_eth_dev *eth_dev, struct rte_eth_rss_conf *rss_conf) { struct bnxt *bp = eth_dev->data->dev_private; - struct bnxt_vnic_info *vnic = &bp->vnic_info[0]; + struct bnxt_vnic_info *vnic = BNXT_GET_DEFAULT_VNIC(bp); int len, rc; uint32_t hash_types; @@ -1964,7 +1964,7 @@ bnxt_set_default_mac_addr_op(struct rte_eth_dev *dev, { struct bnxt *bp = dev->data->dev_private; /* Default Filter is tied to VNIC 0 */ - struct bnxt_vnic_info *vnic = &bp->vnic_info[0]; + struct bnxt_vnic_info *vnic = BNXT_GET_DEFAULT_VNIC(bp); struct bnxt_filter_info *filter; int rc; @@ -2378,7 +2378,7 @@ bnxt_match_and_validate_ether_filter(struct bnxt *bp, goto exit; } - vnic0 = &bp->vnic_info[0]; + vnic0 = BNXT_GET_DEFAULT_VNIC(bp); vnic = &bp->vnic_info[efilter->queue]; if (vnic == NULL) { PMD_DRV_LOG(ERR, "Invalid queue %d\n", efilter->queue); @@ -2437,7 +2437,7 @@ bnxt_ethertype_filter(struct rte_eth_dev *dev, return -EINVAL; } - vnic0 = &bp->vnic_info[0]; + vnic0 = BNXT_GET_DEFAULT_VNIC(bp); vnic = &bp->vnic_info[efilter->queue]; switch (filter_op) { @@ -2652,7 +2652,7 @@ bnxt_cfg_ntuple_filter(struct bnxt *bp, goto free_filter; vnic = &bp->vnic_info[nfilter->queue]; - vnic0 = &bp->vnic_info[0]; + vnic0 = BNXT_GET_DEFAULT_VNIC(bp); filter1 = STAILQ_FIRST(&vnic0->filter); if (filter1 == NULL) { ret = -EINVAL; @@ -2945,7 +2945,7 @@ bnxt_parse_fdir_filter(struct bnxt *bp, return -EINVAL; } - vnic0 = &bp->vnic_info[0]; + vnic0 = BNXT_GET_DEFAULT_VNIC(bp); vnic = &bp->vnic_info[fdir->action.rx_queue]; if (vnic == NULL) { PMD_DRV_LOG(ERR, "Invalid queue %d\n", fdir->action.rx_queue);