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>
(cherry picked from commit 6c00bf9297134760f10974383ae4169589e16fa6)
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3285723
This commit is contained in:
Revanth Kumar Uppala
2024-12-23 11:33:27 +00:00
committed by mobile promotions
parent a08c7112e7
commit a736931748

View File

@@ -28435,7 +28435,8 @@ rtl8168_init_one(struct pci_dev *pdev,
struct rtl8168_private *tp;
void __iomem *ioaddr = NULL;
static int board_idx = -1;
u16 desired_mps = 128;
u32 desired_mrrs = 512;
int rc;
assert(pdev != NULL);
@@ -28598,6 +28599,22 @@ rtl8168_init_one(struct pci_dev *pdev,
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 */
if (((tp->mcfg == CFG_METHOD_21 || tp->mcfg == CFG_METHOD_22 ||
tp->mcfg == CFG_METHOD_25 || tp->mcfg == CFG_METHOD_29 ||