aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/ntb/ntb_hw.h
diff options
context:
space:
mode:
authorJon Mason <jon.mason@intel.com>2013-04-18 20:07:36 -0400
committerJon Mason <jon.mason@intel.com>2013-09-03 16:51:51 -0400
commit948d3a65b6d164b34309625f57656cb9e8b1a908 (patch)
tree01afe66a33f978552f0577eb478d801e8e6a6284 /drivers/ntb/ntb_hw.h
parent1517a3f21a1dd321f16bcf44204bddff9d21abd0 (diff)
NTB: Xeon Errata Workaround
There is a Xeon hardware errata related to writes to SDOORBELL or B2BDOORBELL in conjunction with inbound access to NTB MMIO Space, which may hang the system. To workaround this issue, use one of the memory windows to access the interrupt and scratch pad registers on the remote system. This bypasses the issue, but removes one of the memory windows from use by the transport. This reduction of MWs necessitates adding some logic to determine the number of available MWs. Since some NTB usage methodologies may have unidirectional traffic, the ability to disable the workaround via modparm has been added. See BF113 in http://www.intel.com/content/dam/www/public/us/en/documents/specification-updates/xeon-c5500-c3500-spec-update.pdf See BT119 in http://www.intel.com/content/dam/www/public/us/en/documents/specification-updates/xeon-e5-family-spec-update.pdf Signed-off-by: Jon Mason <jon.mason@intel.com>
Diffstat (limited to 'drivers/ntb/ntb_hw.h')
-rw-r--r--drivers/ntb/ntb_hw.h39
1 files changed, 33 insertions, 6 deletions
diff --git a/drivers/ntb/ntb_hw.h b/drivers/ntb/ntb_hw.h
index 6a4f56f564ee..72fcb22d7dd8 100644
--- a/drivers/ntb/ntb_hw.h
+++ b/drivers/ntb/ntb_hw.h
@@ -68,7 +68,7 @@
68 68
69#define NTB_HB_TIMEOUT msecs_to_jiffies(1000) 69#define NTB_HB_TIMEOUT msecs_to_jiffies(1000)
70 70
71#define NTB_NUM_MW 2 71#define NTB_MAX_NUM_MW 2
72 72
73enum ntb_hw_event { 73enum ntb_hw_event {
74 NTB_EVENT_SW_EVENT0 = 0, 74 NTB_EVENT_SW_EVENT0 = 0,
@@ -96,11 +96,12 @@ struct ntb_device {
96 struct pci_dev *pdev; 96 struct pci_dev *pdev;
97 struct msix_entry *msix_entries; 97 struct msix_entry *msix_entries;
98 void __iomem *reg_base; 98 void __iomem *reg_base;
99 struct ntb_mw mw[NTB_NUM_MW]; 99 struct ntb_mw mw[NTB_MAX_NUM_MW];
100 struct { 100 struct {
101 unsigned int max_spads; 101 unsigned char max_mw;
102 unsigned int max_db_bits; 102 unsigned char max_spads;
103 unsigned int msix_cnt; 103 unsigned char max_db_bits;
104 unsigned char msix_cnt;
104 } limits; 105 } limits;
105 struct { 106 struct {
106 void __iomem *pdb; 107 void __iomem *pdb;
@@ -132,6 +133,32 @@ struct ntb_device {
132}; 133};
133 134
134/** 135/**
136 * ntb_max_cbs() - return the max callbacks
137 * @ndev: pointer to ntb_device instance
138 *
139 * Given the ntb pointer, return the maximum number of callbacks
140 *
141 * RETURNS: the maximum number of callbacks
142 */
143static inline unsigned char ntb_max_cbs(struct ntb_device *ndev)
144{
145 return ndev->max_cbs;
146}
147
148/**
149 * ntb_max_mw() - return the max number of memory windows
150 * @ndev: pointer to ntb_device instance
151 *
152 * Given the ntb pointer, return the maximum number of memory windows
153 *
154 * RETURNS: the maximum number of memory windows
155 */
156static inline unsigned char ntb_max_mw(struct ntb_device *ndev)
157{
158 return ndev->limits.max_mw;
159}
160
161/**
135 * ntb_hw_link_status() - return the hardware link status 162 * ntb_hw_link_status() - return the hardware link status
136 * @ndev: pointer to ntb_device instance 163 * @ndev: pointer to ntb_device instance
137 * 164 *
@@ -148,7 +175,7 @@ static inline bool ntb_hw_link_status(struct ntb_device *ndev)
148 * ntb_query_pdev() - return the pci_dev pointer 175 * ntb_query_pdev() - return the pci_dev pointer
149 * @ndev: pointer to ntb_device instance 176 * @ndev: pointer to ntb_device instance
150 * 177 *
151 * Given the ntb pointer return the pci_dev pointerfor the NTB hardware device 178 * Given the ntb pointer, return the pci_dev pointer for the NTB hardware device
152 * 179 *
153 * RETURNS: a pointer to the ntb pci_dev 180 * RETURNS: a pointer to the ntb pci_dev
154 */ 181 */