lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Date: Mon,  5 Jun 2023 15:54:07 -0300
From: Fernando Eckhardt Valle <fevalle@....br>
To: davem@...emloft.net
Cc: jesse.brandeburg@...el.com,
	anthony.l.nguyen@...el.com,
	edumazet@...gle.com,
	kuba@...nel.org,
	pabeni@...hat.com,
	netdev@...r.kernel.org,
	Fernando Eckhardt Valle <fevalle@....br>
Subject: [PATCH] igc: enable Mac Address Passthrough in Lenovo Thunderbolt 4 Docks

In order for the Mac Address Passthrough to work with the igc
driver and the Lenovo Thunderbolt 4 dock station, it is necessary
to wait for a minimum time of 600ms for the Laptop's MAC address
to be copied to the Dock. To avoid always waiting for this 600ms
time, a parameter was created to enable the Mac Address PT and
also another parameter to modify the waiting time if necessary
in the future.
This is an old bug reported here but never finalized: 
https://patchwork.ozlabs.org/project/ubuntu-kernel/patch/20210908084952.41486-2-aaron.ma@canonical.com/

Signed-off-by: Fernando Eckhardt Valle <fevalle@....br>
---
 drivers/net/ethernet/intel/igc/igc_main.c | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/drivers/net/ethernet/intel/igc/igc_main.c b/drivers/net/ethernet/intel/igc/igc_main.c
index 1c4676882..cc491e3dc 100644
--- a/drivers/net/ethernet/intel/igc/igc_main.c
+++ b/drivers/net/ethernet/intel/igc/igc_main.c
@@ -30,12 +30,18 @@
 #define IGC_XDP_REDIRECT	BIT(2)
 
 static int debug = -1;
+static bool macpt_delay_enable = false;
+static unsigned int macpt_delay = 600;
 
 MODULE_AUTHOR("Intel Corporation, <linux.nics@...el.com>");
 MODULE_DESCRIPTION(DRV_SUMMARY);
 MODULE_LICENSE("GPL v2");
 module_param(debug, int, 0);
+module_param(macpt_delay_enable, bool, 0444);
+module_param(macpt_delay, uint, 0444);
 MODULE_PARM_DESC(debug, "Debug level (0=none,...,16=all)");
+MODULE_PARM_DESC(macpt_delay_enable, "True to enable Mac Addr PT");
+MODULE_PARM_DESC(macpt_delay, "Ms delay to allow Mac Addr PT change to occur");
 
 char igc_driver_name[] = "igc";
 static const char igc_driver_string[] = DRV_SUMMARY;
@@ -6606,6 +6612,9 @@ static int igc_probe(struct pci_dev *pdev,
 		}
 	}
 
+	if (macpt_delay_enable && pci_is_thunderbolt_attached(pdev))
+		msleep(macpt_delay);
+
 	if (eth_platform_get_mac_address(&pdev->dev, hw->mac.addr)) {
 		/* copy the MAC address out of the NVM */
 		if (hw->mac.ops.read_mac_addr(hw))
-- 
2.25.1


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ