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 45C7CA32A1 for ; Thu, 24 Oct 2019 09:54:52 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 6CF381E53C; Thu, 24 Oct 2019 09:53:09 +0200 (CEST) Received: from relay.smtp.broadcom.com (unknown [192.19.232.149]) by dpdk.org (Postfix) with ESMTP id AC9571D426 for ; Thu, 24 Oct 2019 09:52:38 +0200 (CEST) Received: from dhcp-10-123-153-55.dhcp.broadcom.net (dhcp-10-123-153-55.dhcp.broadcom.net [10.123.153.55]) by relay.smtp.broadcom.com (Postfix) with ESMTP id 5E4991B9D68; Thu, 24 Oct 2019 00:52:37 -0700 (PDT) DKIM-Filter: OpenDKIM Filter v2.10.3 relay.smtp.broadcom.com 5E4991B9D68 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=broadcom.com; s=dkimrelay; t=1571903558; bh=sW/WoBf1sW3Jwpnu4SHt2RpCcL3YI+1/gAUMAOekAK0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=OWJxNxF9IuMg6i004PraxrF3DjqGBpXz1C7NAb3SqIt1OYHOGT3mzbM13rO/wsE8K +Q2xb8eAxLwVTxhcWGJvqe0uTOil/trksWxJQHQFFf4YfefDIkTqv77CDyy+AcR+DD hPn/F6FcYBSdUiBKUAvJraVNiyEjo7rIGW4FpQeA= From: Somnath Kotur To: dev@dpdk.org Cc: ferruh.yigit@intel.com Date: Thu, 24 Oct 2019 13:14:30 +0530 Message-Id: <20191024074432.30705-16-somnath.kotur@broadcom.com> X-Mailer: git-send-email 2.10.1.613.g2cc2e70 In-Reply-To: <20191024074432.30705-1-somnath.kotur@broadcom.com> References: <20191024074432.30705-1-somnath.kotur@broadcom.com> Subject: [dpdk-dev] [PATCH 15/17] net/bnxt: add a wrapper function for thor device check 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 This patch adds a wrapper function bnxt_thor_device() which checks for the pci device is Thor family. Signed-off-by: Kalesh AP Reviewed-by: Somnath Kotur Reviewed-by: Santoshkumar Karanappa Rastapur Signed-off-by: Somnath Kotur --- drivers/net/bnxt/bnxt_ethdev.c | 24 +++++++++++++++++++----- 1 file changed, 19 insertions(+), 5 deletions(-) diff --git a/drivers/net/bnxt/bnxt_ethdev.c b/drivers/net/bnxt/bnxt_ethdev.c index 0bed4a2..013b968 100644 --- a/drivers/net/bnxt/bnxt_ethdev.c +++ b/drivers/net/bnxt/bnxt_ethdev.c @@ -4074,6 +4074,24 @@ static bool bnxt_vf_pciid(uint16_t id) return false; } +static bool bnxt_thor_device(uint16_t id) +{ + if (id == BROADCOM_DEV_ID_57508 || + id == BROADCOM_DEV_ID_57504 || + id == BROADCOM_DEV_ID_57502 || + id == BROADCOM_DEV_ID_57508_MF1 || + id == BROADCOM_DEV_ID_57504_MF1 || + id == BROADCOM_DEV_ID_57502_MF1 || + id == BROADCOM_DEV_ID_57508_MF2 || + id == BROADCOM_DEV_ID_57504_MF2 || + id == BROADCOM_DEV_ID_57502_MF2 || + id == BROADCOM_DEV_ID_57500_VF1 || + id == BROADCOM_DEV_ID_57500_VF2) + return true; + + return false; +} + bool bnxt_stratus_device(struct bnxt *bp) { uint16_t id = bp->pdev->id.device_id; @@ -4716,11 +4734,7 @@ bnxt_dev_init(struct rte_eth_dev *eth_dev) if (bnxt_vf_pciid(pci_dev->id.device_id)) bp->flags |= BNXT_FLAG_VF; - if (pci_dev->id.device_id == BROADCOM_DEV_ID_57508 || - pci_dev->id.device_id == BROADCOM_DEV_ID_57504 || - pci_dev->id.device_id == BROADCOM_DEV_ID_57502 || - pci_dev->id.device_id == BROADCOM_DEV_ID_57500_VF1 || - pci_dev->id.device_id == BROADCOM_DEV_ID_57500_VF2) + if (bnxt_thor_device(pci_dev->id.device_id)) bp->flags |= BNXT_FLAG_THOR_CHIP; if (pci_dev->id.device_id == BROADCOM_DEV_ID_58802 || -- 2.10.1.613.g2cc2e70