lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1471645933-3643-2-git-send-email-okhaliq@caviumnetworks.com>
Date:   Fri, 19 Aug 2016 15:32:12 -0700
From:   Omer Khaliq <okhaliq@...iumnetworks.com>
To:     <linux-kernel@...r.kernel.org>, <linux-pci@...r.kernel.org>,
        <linux-crypto@...r.kernel.org>, <linux-arm-kernel@...r.kernel.org>,
        <bhelgaas@...gle.com>, <mpm@...enic.com>,
        <herbert@...dor.apana.org.au>, <Ananth.Jasty@...ium.com>,
        <david.daney@...ium.com>
CC:     Omer Khaliq <okhaliq@...iumnetworks.com>
Subject: [PATCH 1/2] PCI/IOV: Add function to allow Function Dependency Link override.

From: David Daney <david.daney@...ium.com>

Some hardware presents an incorrect SR-IOV Function Dependency Link,
add a function to allow this to be overridden in the PF driver for
such devices.

Signed-off-by: David Daney <david.daney@...ium.com>
Signed-off-by: Omer Khaliq <okhaliq@...iumnetworks.com>
---
 drivers/pci/iov.c   | 14 ++++++++++++++
 include/linux/pci.h |  1 +
 2 files changed, 15 insertions(+)

diff --git a/drivers/pci/iov.c b/drivers/pci/iov.c
index 2194b44..81f0672 100644
--- a/drivers/pci/iov.c
+++ b/drivers/pci/iov.c
@@ -640,6 +640,20 @@ int pci_enable_sriov(struct pci_dev *dev, int nr_virtfn)
 EXPORT_SYMBOL_GPL(pci_enable_sriov);
 
 /**
+ * pci_sriov_fdl_override - fix incorrect Function Dependency Link
+ * @dev: the PCI device
+ * @fdl: the corrected Function Dependency Link value
+ *
+ * For hardware presenting an incorrect Function Dependency Link in
+ * the SR-IOV Extended Capability, allow a driver to override it.
+ */
+void pci_sriov_fdl_override(struct pci_dev *dev, u8 fdl)
+{
+	dev->sriov->link = fdl;
+}
+EXPORT_SYMBOL_GPL(pci_sriov_fdl_override);
+
+/**
  * pci_disable_sriov - disable the SR-IOV capability
  * @dev: the PCI device
  */
diff --git a/include/linux/pci.h b/include/linux/pci.h
index 2599a98..da8a5b3 100644
--- a/include/linux/pci.h
+++ b/include/linux/pci.h
@@ -1823,6 +1823,7 @@ int pci_num_vf(struct pci_dev *dev);
 int pci_vfs_assigned(struct pci_dev *dev);
 int pci_sriov_set_totalvfs(struct pci_dev *dev, u16 numvfs);
 int pci_sriov_get_totalvfs(struct pci_dev *dev);
+void pci_sriov_fdl_override(struct pci_dev *dev, u8 fdl);
 resource_size_t pci_iov_resource_size(struct pci_dev *dev, int resno);
 #else
 static inline int pci_iov_virtfn_bus(struct pci_dev *dev, int id)
-- 
1.9.1

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ