Skip to content

Commit 5f5c51e

Browse files
Matt Carlsondavem330
authored andcommitted
[TG3]: Increase the PCI MRRS
Previous devices hardcoded the PCI Maximum Read Request Size to 4K. To better comply with the PCI spec, the hardware now defaults the MRRS to 512 bytes. This will yield poor driver performance if left untouched. This patch increases the MRRS to 4K on driver initialization. Signed-off-by: Matt Carlson <[email protected]> Signed-off-by: Michael Chan <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent aa6c91f commit 5f5c51e

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

drivers/net/tg3.c

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5098,12 +5098,15 @@ static void tg3_restore_pci_state(struct tg3 *tp)
50985098

50995099
pci_write_config_word(tp->pdev, PCI_COMMAND, tp->pci_cmd);
51005100

5101-
if (!(tp->tg3_flags2 & TG3_FLG2_PCI_EXPRESS)) {
5101+
if (tp->tg3_flags2 & TG3_FLG2_PCI_EXPRESS)
5102+
pcie_set_readrq(tp->pdev, 4096);
5103+
else {
51025104
pci_write_config_byte(tp->pdev, PCI_CACHE_LINE_SIZE,
51035105
tp->pci_cacheline_sz);
51045106
pci_write_config_byte(tp->pdev, PCI_LATENCY_TIMER,
51055107
tp->pci_lat_timer);
51065108
}
5109+
51075110
/* Make sure PCI-X relaxed ordering bit is clear. */
51085111
if (tp->pcix_cap) {
51095112
u16 pcix_cmd;
@@ -11215,6 +11218,9 @@ static int __devinit tg3_get_invariants(struct tg3 *tp)
1121511218
pcie_cap = pci_find_capability(tp->pdev, PCI_CAP_ID_EXP);
1121611219
if (pcie_cap != 0) {
1121711220
tp->tg3_flags2 |= TG3_FLG2_PCI_EXPRESS;
11221+
11222+
pcie_set_readrq(tp->pdev, 4096);
11223+
1121811224
if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5906) {
1121911225
u16 lnkctl;
1122011226

0 commit comments

Comments
 (0)