From 34f2f8ad40d868ca53732b3cd833bb5140821876 Mon Sep 17 00:00:00 2001 From: Kalesh AP Date: Thu, 24 Oct 2019 13:14:30 +0530 Subject: [PATCH] net/bnxt: add wrapper function for Thor device check This patch adds a wrapper function bnxt_thor_device() which checks for the pci device is Thor family. Signed-off-by: Kalesh AP Signed-off-by: Somnath Kotur Reviewed-by: Santoshkumar Karanappa Rastapur --- 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 0bed4a2e9b..013b968355 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.20.1