From af37df66bffa0c40d5fc58a2054549773abd388e Mon Sep 17 00:00:00 2001
From: Billie R Alsup <balsup@cisco.com>
Date: Mon, 12 Feb 2024 17:45:06 -0800
Subject: [PATCH] Build for 6.6.9 kernel

pci_disable_pcie_error reporting removed in v6.6

Fix inconsistent usage of conditionals:
    HAVE_NDO_SET_VF_LINK_STATE
    CONFIG_DCB
    CONFIG_PCI_IOV

Signed-off-by: Billie R Alsup <balsup@cisco.com>
---
 src/i40e_virtchnl_pf.c | 4 ++--
 src/kcompat.h          | 5 +++++
 2 files changed, 7 insertions(+), 2 deletions(-)

diff --git a/src/i40e_virtchnl_pf.c b/src/i40e_virtchnl_pf.c
index f2594a4..0edbb9e 100644
--- a/src/i40e_virtchnl_pf.c
+++ b/src/i40e_virtchnl_pf.c
@@ -6661,7 +6661,6 @@ int i40e_get_vf_stats(struct net_device *netdev, int vf_id,
 #endif /* HAVE_VF_STATS */
 #endif /* IFLA_VF_MAX */
 #ifdef HAVE_NDO_SET_VF_LINK_STATE
-#ifdef CONFIG_DCB
 #ifdef CONFIG_PCI_IOV
 /**
  * i40e_configure_vf_link
@@ -6739,6 +6738,7 @@ error_out:
 	return ret;
 }
 
+#ifdef CONFIG_DCB
 /**
  * i40e_enable_vf_queues
  * @vsi: PCI device information struct
@@ -6792,8 +6792,8 @@ int i40e_enable_vf_queues(struct i40e_vsi *vsi, bool enable)
 err_out:
 	return ret;
 }
-#endif /* PCI_IOV */
 #endif /* CONFIG_DCB */
+#endif /* PCI_IOV */
 /**
  * i40e_get_vlan_anti_spoof
  * @pdev: PCI device information struct
diff --git a/src/kcompat.h b/src/kcompat.h
index 599277c..80fedb2 100644
--- a/src/kcompat.h
+++ b/src/kcompat.h
@@ -7066,6 +7066,11 @@ _kc_napi_busy_loop(unsigned int napi_id,
 #define HAVE_GRO_HEADER
 #endif /* >=5.12.0 */
 
+/*****************************************************************************/
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(6,6,0))
+#define pci_disable_pcie_error_reporting(dev) do {} while (0)
+#endif /* >=6.6.0 */
+
 /*****************************************************************************/
 /*
  * Load the implementations file which actually defines kcompat backports.
-- 
2.35.6

