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 A75C3A32A1 for ; Thu, 24 Oct 2019 08:09:22 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id F37751C2EF; Thu, 24 Oct 2019 08:08:08 +0200 (CEST) Received: from relay.smtp.broadcom.com (relay.smtp.broadcom.com [192.19.211.62]) by dpdk.org (Postfix) with ESMTP id 5DAD21C025 for ; Thu, 24 Oct 2019 08:07:01 +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 DA64C28FABA; Wed, 23 Oct 2019 23:07:00 -0700 (PDT) DKIM-Filter: OpenDKIM Filter v2.10.3 relay.smtp.broadcom.com DA64C28FABA DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=broadcom.com; s=dkimrelay; t=1571897221; bh=pztY8kSJFsbt7x7T95KUBzY01kpsZkl77pmj1kaD01A=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Z2koWRfCqAl2fbLeSQGSTWkb2QbgCJ3XnFqxgz6SLOoMyRaBF8IVG09y0xTIPVdRg kDmgxXzMC9fAJ7Exti0Ukz60ii9oslq87Fvtpcr2hru6PgJ2lvflVi3cLmIuuSUB3N Ok8BgA5DfsoskIOzbAOn3Nn7qaXIQFTrlXp/IR8I= From: Somnath Kotur To: dev@dpdk.org Cc: ferruh.yigit@intel.com Date: Thu, 24 Oct 2019 11:29:10 +0530 Message-Id: <20191024055913.28817-16-somnath.kotur@broadcom.com> X-Mailer: git-send-email 2.10.1.613.g2cc2e70 In-Reply-To: <20191024055913.28817-1-somnath.kotur@broadcom.com> References: <20191024055913.28817-1-somnath.kotur@broadcom.com> Subject: [dpdk-dev] [PATCH 15/16] 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 @@ static int bnxt_init_resources(struct bnxt *bp, bool reconfig_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 || -- 1.8.3.1