]> git.openfabrics.org - ~emulex/for-vlad/old/compat-rdma.git/commitdiff
be2net: Backport support for SLES11 SP3
authorMitesh Ahuja <mitesh.ahuja@emulex.com>
Mon, 9 Mar 2015 13:45:35 +0000 (06:45 -0700)
committerMitesh Ahuja <mitesh.ahuja@emulex.com>
Mon, 9 Mar 2015 13:45:35 +0000 (06:45 -0700)
Fixing compilation issues for SLES11 SP3.

linux-next-pending/0010-be2net-Backport-support-for-SLES11-SP3.patch [new file with mode: 0644]

diff --git a/linux-next-pending/0010-be2net-Backport-support-for-SLES11-SP3.patch b/linux-next-pending/0010-be2net-Backport-support-for-SLES11-SP3.patch
new file mode 100644 (file)
index 0000000..96405df
--- /dev/null
@@ -0,0 +1,109 @@
+From 1d51b1fec5e14e49bb3cc19eaec3f77da710b106 Mon Sep 17 00:00:00 2001
+From: Mitesh Ahuja <mitesh.ahuja@emulex.com>
+Date: Mon, 9 Mar 2015 06:24:10 -0700
+Subject: [PATCH] be2net: Backport support for SLES11 SP3
+
+Fixing compilation issues for SLES11 SP3.
+---
+ drivers/net/ethernet/emulex/benet/be_compat.c |   17 +++++++++++++++++
+ drivers/net/ethernet/emulex/benet/be_compat.h |    1 +
+ drivers/net/ethernet/emulex/benet/be_main.c   |   12 ++++++++++++
+ 3 files changed, 30 insertions(+), 0 deletions(-)
+
+diff --git a/drivers/net/ethernet/emulex/benet/be_compat.c b/drivers/net/ethernet/emulex/benet/be_compat.c
+index d1563d3..470dbea 100644
+--- a/drivers/net/ethernet/emulex/benet/be_compat.c
++++ b/drivers/net/ethernet/emulex/benet/be_compat.c
+@@ -72,3 +72,20 @@ int pci_sriov_get_totalvfs(struct pci_dev *pdev)
+ #endif
+ #endif /* CONFIG_PCI_IOV */
++
++void be_wait_for_vfs_detach(struct pci_dev *pdev)
++{
++#ifdef CONFIG_PCI_IOV
++#ifndef HAVE_PCI_VF_ASSIGNED
++      if (pci_vfs_assigned(pdev))
++               dev_warn(&pdev->dev,
++                        "Waiting to unload, until VFs are detached\n");
++      while (1) {
++              if (pci_vfs_assigned(pdev) == 0)
++                      break;
++
++              msleep(1000);
++      }
++#endif
++#endif
++}
+diff --git a/drivers/net/ethernet/emulex/benet/be_compat.h b/drivers/net/ethernet/emulex/benet/be_compat.h
+index be334b0..00bc2ba 100644
+--- a/drivers/net/ethernet/emulex/benet/be_compat.h
++++ b/drivers/net/ethernet/emulex/benet/be_compat.h
+@@ -76,6 +76,7 @@ int pci_sriov_get_totalvfs(struct pci_dev *pdev);
+ #define pci_vfs_assigned(x)                     0
+ #define pci_num_vf(x)                           0
+ #endif /* CONFIG_PCI_IOV */
++void be_wait_for_vfs_detach(struct pci_dev *pdev);
+ #ifndef NETIF_F_HW_VLAN_CTAG_TX
+ #define NETIF_F_HW_VLAN_CTAG_TX         NETIF_F_HW_VLAN_TX
+diff --git a/drivers/net/ethernet/emulex/benet/be_main.c b/drivers/net/ethernet/emulex/benet/be_main.c
+index b3890ae..c745fba 100644
+--- a/drivers/net/ethernet/emulex/benet/be_main.c
++++ b/drivers/net/ethernet/emulex/benet/be_main.c
+@@ -25,7 +25,9 @@
+ #ifdef HAVE_SKB_MARK_NAPI_ID
+ #include <net/busy_poll.h>
+ #endif
++#ifdef CONFIG_BE2NET_VXLAN
+ #include <net/vxlan.h>
++#endif
+ MODULE_VERSION(DRV_VER);
+ MODULE_DEVICE_TABLE(pci, be_dev_ids);
+@@ -1850,8 +1852,10 @@ static void be_rx_compl_process(struct be_rx_obj *rxo, struct napi_struct *napi,
+ #ifdef HAVE_SK_BUFF_CSUM_LEVEL
+       skb->csum_level = rxcp->tunneled;
+ #else
++#ifdef CONFIG_BE2NET_VXLAN
+       skb->encapsulation = rxcp->tunneled;
+ #endif
++#endif
+ #ifdef HAVE_SKB_MARK_NAPI_ID
+       skb_mark_napi_id(skb, napi);
+@@ -1919,8 +1923,10 @@ static void be_rx_compl_process_gro(struct be_rx_obj *rxo,
+ #ifdef HAVE_SK_BUFF_CSUM_LEVEL
+       skb->csum_level = rxcp->tunneled;
+ #else
++#ifdef CONFIG_BE2NET_VXLAN
+       skb->encapsulation = rxcp->tunneled;
+ #endif
++#endif
+ #ifdef HAVE_SKB_MARK_NAPI_ID
+       skb_mark_napi_id(skb, napi);
+@@ -3280,6 +3286,8 @@ static void be_vf_clear(struct be_adapter *adapter)
+       struct be_vf_cfg *vf_cfg;
+       u32 vf;
++      be_wait_for_vfs_detach(adapter->pdev);
++
+       if (pci_vfs_assigned(adapter->pdev)) {
+               dev_warn(&adapter->pdev->dev,
+                        "VFs are assigned to VMs: not disabling VFs\n");
+@@ -3623,7 +3631,11 @@ static int be_get_sriov_config(struct be_adapter *adapter)
+               return 0;
+       }
++#ifdef CONFIG_PCI_IOV
++#ifdef HAVE_PCI_VF_ASSIGNED
+       pci_sriov_set_totalvfs(adapter->pdev, be_max_vfs(adapter));
++#endif
++#endif
+       /* validate num_vfs module param */
+       old_vfs = pci_num_vf(adapter->pdev);
+-- 
+1.7.1
+