aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/cxgb4
diff options
context:
space:
mode:
authorDimitris Michailidis <dm@chelsio.com>2010-12-14 16:36:44 -0500
committerDavid S. Miller <davem@davemloft.net>2010-12-16 16:15:59 -0500
commitef306b50b983be4873aed453c1feeaab22f3a098 (patch)
tree3bebb611a4c3820179149dbcef372cf08d63f28a /drivers/net/cxgb4
parent986d730a696277520084180071ac4873aac63905 (diff)
cxgb4: enable PCIe relaxed ordering
Enable relaxed ordering for descriptor reads and packet I/O. Signed-off-by: Dimitris Michailidis <dm@chelsio.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/cxgb4')
-rw-r--r--drivers/net/cxgb4/cxgb4_main.c14
-rw-r--r--drivers/net/cxgb4/sge.c5
2 files changed, 19 insertions, 0 deletions
diff --git a/drivers/net/cxgb4/cxgb4_main.c b/drivers/net/cxgb4/cxgb4_main.c
index 848f89d19fb7..953d62a3403c 100644
--- a/drivers/net/cxgb4/cxgb4_main.c
+++ b/drivers/net/cxgb4/cxgb4_main.c
@@ -3535,6 +3535,19 @@ static void __devinit print_port_info(struct adapter *adap)
3535 } 3535 }
3536} 3536}
3537 3537
3538static void __devinit enable_pcie_relaxed_ordering(struct pci_dev *dev)
3539{
3540 u16 v;
3541 int pos;
3542
3543 pos = pci_pcie_cap(dev);
3544 if (pos > 0) {
3545 pci_read_config_word(dev, pos + PCI_EXP_DEVCTL, &v);
3546 v |= PCI_EXP_DEVCTL_RELAX_EN;
3547 pci_write_config_word(dev, pos + PCI_EXP_DEVCTL, v);
3548 }
3549}
3550
3538/* 3551/*
3539 * Free the following resources: 3552 * Free the following resources:
3540 * - memory used for tables 3553 * - memory used for tables
@@ -3609,6 +3622,7 @@ static int __devinit init_one(struct pci_dev *pdev,
3609 } 3622 }
3610 3623
3611 pci_enable_pcie_error_reporting(pdev); 3624 pci_enable_pcie_error_reporting(pdev);
3625 enable_pcie_relaxed_ordering(pdev);
3612 pci_set_master(pdev); 3626 pci_set_master(pdev);
3613 pci_save_state(pdev); 3627 pci_save_state(pdev);
3614 3628
diff --git a/drivers/net/cxgb4/sge.c b/drivers/net/cxgb4/sge.c
index 17022258ed68..cc0b9975d472 100644
--- a/drivers/net/cxgb4/sge.c
+++ b/drivers/net/cxgb4/sge.c
@@ -2014,6 +2014,8 @@ int t4_sge_alloc_rxq(struct adapter *adap, struct sge_rspq *iq, bool fwevtq,
2014 2014
2015 flsz = fl->size / 8 + STAT_LEN / sizeof(struct tx_desc); 2015 flsz = fl->size / 8 + STAT_LEN / sizeof(struct tx_desc);
2016 c.iqns_to_fl0congen = htonl(FW_IQ_CMD_FL0PACKEN | 2016 c.iqns_to_fl0congen = htonl(FW_IQ_CMD_FL0PACKEN |
2017 FW_IQ_CMD_FL0FETCHRO(1) |
2018 FW_IQ_CMD_FL0DATARO(1) |
2017 FW_IQ_CMD_FL0PADEN); 2019 FW_IQ_CMD_FL0PADEN);
2018 c.fl0dcaen_to_fl0cidxfthresh = htons(FW_IQ_CMD_FL0FBMIN(2) | 2020 c.fl0dcaen_to_fl0cidxfthresh = htons(FW_IQ_CMD_FL0FBMIN(2) |
2019 FW_IQ_CMD_FL0FBMAX(3)); 2021 FW_IQ_CMD_FL0FBMAX(3));
@@ -2106,6 +2108,7 @@ int t4_sge_alloc_eth_txq(struct adapter *adap, struct sge_eth_txq *txq,
2106 c.viid_pkd = htonl(FW_EQ_ETH_CMD_VIID(pi->viid)); 2108 c.viid_pkd = htonl(FW_EQ_ETH_CMD_VIID(pi->viid));
2107 c.fetchszm_to_iqid = htonl(FW_EQ_ETH_CMD_HOSTFCMODE(2) | 2109 c.fetchszm_to_iqid = htonl(FW_EQ_ETH_CMD_HOSTFCMODE(2) |
2108 FW_EQ_ETH_CMD_PCIECHN(pi->tx_chan) | 2110 FW_EQ_ETH_CMD_PCIECHN(pi->tx_chan) |
2111 FW_EQ_ETH_CMD_FETCHRO(1) |
2109 FW_EQ_ETH_CMD_IQID(iqid)); 2112 FW_EQ_ETH_CMD_IQID(iqid));
2110 c.dcaen_to_eqsize = htonl(FW_EQ_ETH_CMD_FBMIN(2) | 2113 c.dcaen_to_eqsize = htonl(FW_EQ_ETH_CMD_FBMIN(2) |
2111 FW_EQ_ETH_CMD_FBMAX(3) | 2114 FW_EQ_ETH_CMD_FBMAX(3) |
@@ -2158,6 +2161,7 @@ int t4_sge_alloc_ctrl_txq(struct adapter *adap, struct sge_ctrl_txq *txq,
2158 c.physeqid_pkd = htonl(0); 2161 c.physeqid_pkd = htonl(0);
2159 c.fetchszm_to_iqid = htonl(FW_EQ_CTRL_CMD_HOSTFCMODE(2) | 2162 c.fetchszm_to_iqid = htonl(FW_EQ_CTRL_CMD_HOSTFCMODE(2) |
2160 FW_EQ_CTRL_CMD_PCIECHN(pi->tx_chan) | 2163 FW_EQ_CTRL_CMD_PCIECHN(pi->tx_chan) |
2164 FW_EQ_CTRL_CMD_FETCHRO |
2161 FW_EQ_CTRL_CMD_IQID(iqid)); 2165 FW_EQ_CTRL_CMD_IQID(iqid));
2162 c.dcaen_to_eqsize = htonl(FW_EQ_CTRL_CMD_FBMIN(2) | 2166 c.dcaen_to_eqsize = htonl(FW_EQ_CTRL_CMD_FBMIN(2) |
2163 FW_EQ_CTRL_CMD_FBMAX(3) | 2167 FW_EQ_CTRL_CMD_FBMAX(3) |
@@ -2207,6 +2211,7 @@ int t4_sge_alloc_ofld_txq(struct adapter *adap, struct sge_ofld_txq *txq,
2207 FW_EQ_OFLD_CMD_EQSTART | FW_LEN16(c)); 2211 FW_EQ_OFLD_CMD_EQSTART | FW_LEN16(c));
2208 c.fetchszm_to_iqid = htonl(FW_EQ_OFLD_CMD_HOSTFCMODE(2) | 2212 c.fetchszm_to_iqid = htonl(FW_EQ_OFLD_CMD_HOSTFCMODE(2) |
2209 FW_EQ_OFLD_CMD_PCIECHN(pi->tx_chan) | 2213 FW_EQ_OFLD_CMD_PCIECHN(pi->tx_chan) |
2214 FW_EQ_OFLD_CMD_FETCHRO(1) |
2210 FW_EQ_OFLD_CMD_IQID(iqid)); 2215 FW_EQ_OFLD_CMD_IQID(iqid));
2211 c.dcaen_to_eqsize = htonl(FW_EQ_OFLD_CMD_FBMIN(2) | 2216 c.dcaen_to_eqsize = htonl(FW_EQ_OFLD_CMD_FBMIN(2) |
2212 FW_EQ_OFLD_CMD_FBMAX(3) | 2217 FW_EQ_OFLD_CMD_FBMAX(3) |