R8168: Configure Root Port MPS and MRRS in r8168 driver

This patch ensures that the Maximum Payload Size (MPS) and Maximum Read Request Size (MRRS) settings of the root port associated with r8168 ethernet endpoint are properly configured after overwritten by kernel when pcie_bus_perf is enabled.

Bug 4607316

Change-Id: I7f7b83f74e4ac2104345bd568d9d2e7c03a1441e
Signed-off-by: Revanth Kumar Uppala <ruppala@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3273562
Reviewed-by: Manikanta Maddireddy <mmaddireddy@nvidia.com>
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
Reviewed-by: Bibek Basu <bbasu@nvidia.com>
This commit is contained in:
Revanth Kumar Uppala
2024-12-23 11:33:27 +00:00
committed by Jon Hunter
parent e3e3af93bc
commit e01250d7c8

View File

@@ -28435,7 +28435,8 @@ rtl8168_init_one(struct pci_dev *pdev,
struct rtl8168_private *tp; struct rtl8168_private *tp;
void __iomem *ioaddr = NULL; void __iomem *ioaddr = NULL;
static int board_idx = -1; static int board_idx = -1;
u16 desired_mps = 128;
u32 desired_mrrs = 512;
int rc; int rc;
assert(pdev != NULL); assert(pdev != NULL);
@@ -28598,6 +28599,22 @@ rtl8168_init_one(struct pci_dev *pdev,
rtl8168_hw_reset(dev); rtl8168_hw_reset(dev);
/* Set Maximum Payload Size (MPS) */
rc = pcie_set_mps(pdev->bus->self, desired_mps);
if (rc) {
dev_err(&pdev->bus->self->dev, "Failed to set MPS to %u (error %d)\n",
desired_mps, rc);
return rc;
}
/* Set Maximum Read Request Size (MRRS) */
rc = pcie_set_readrq(pdev->bus->self, desired_mrrs);
if (rc) {
dev_err(&pdev->bus->self->dev, "Failed to set MRRS to %u (error %d)\n",
desired_mrrs, rc);
return rc;
}
/* Get production from EEPROM */ /* Get production from EEPROM */
if (((tp->mcfg == CFG_METHOD_21 || tp->mcfg == CFG_METHOD_22 || if (((tp->mcfg == CFG_METHOD_21 || tp->mcfg == CFG_METHOD_22 ||
tp->mcfg == CFG_METHOD_25 || tp->mcfg == CFG_METHOD_29 || tp->mcfg == CFG_METHOD_25 || tp->mcfg == CFG_METHOD_29 ||