Merge pull request #216670 from cole-h/fix-em-ice-bonding

linux_{5_15,6_1}: revert patch to fix Equinix Metal bonded networking with `ice` driver

authored by Maximilian Bosch and committed by GitHub 1d1688bb f47ea8fb

+94
+87
pkgs/os-specific/linux/kernel/fix-em-ice-bonding.patch
··· 1 + From 1640688018f329559c61352646f283f98938af31 Mon Sep 17 00:00:00 2001 2 + From: Cole Helbling <cole.helbling@determinate.systems> 3 + Date: Thu, 16 Feb 2023 09:30:21 -0800 4 + Subject: [PATCH] Revert "RDMA/irdma: Report the correct link speed" 5 + 6 + This reverts commit 425c9bd06b7a70796d880828d15c11321bdfb76d. 7 + 8 + Some Equinix Metal instances, such as a3.large.x86, m3.large.x86 9 + (specific hardware revisions), and n3.large.x86, use the `ice` kernel 10 + driver for their network cards, in conjunction with bonded devices. 11 + However, this commit caused a regression where these bonded devices 12 + would deadlock. This was initially reported by Jaroslav Pulchart on 13 + the netdev mailing list[1], and there were follow-up patches from Dave 14 + Ertman[2][3] that attempted to fix this but were not up to snuff for 15 + various reasons[4]. 16 + 17 + Specifically, v2 of the patch ([3]) appears to fix the issue on some 18 + devices (tested with 8086:159B network cards), while it is still broken 19 + on others (such as an 8086:1593 network card). 20 + 21 + We revert the patch exposing the issue until upstream has a working 22 + solution in order to make Equinix Metal instances work reliably again. 23 + 24 + [1]: https://lore.kernel.org/netdev/CAK8fFZ6A_Gphw_3-QMGKEFQk=sfCw1Qmq0TVZK3rtAi7vb621A@mail.gmail.com/ 25 + [2]: https://patchwork.ozlabs.org/project/intel-wired-lan/patch/20230111183145.1497367-1-david.m.ertman@intel.com/ 26 + [3]: https://patchwork.ozlabs.org/project/intel-wired-lan/patch/20230215191757.1826508-1-david.m.ertman@intel.com/ 27 + [4]: https://lore.kernel.org/netdev/cb31a911-ba80-e2dc-231f-851757cfd0b8@intel.com/T/#m6e53f8c43093693c10268140126abe99e082dc1c 28 + --- 29 + drivers/infiniband/hw/irdma/verbs.c | 35 ++++++++++++++++++++++++++--- 30 + 1 file changed, 32 insertions(+), 3 deletions(-) 31 + 32 + diff --git a/drivers/infiniband/hw/irdma/verbs.c b/drivers/infiniband/hw/irdma/verbs.c 33 + index c5971a840b87..911902d2b93e 100644 34 + --- a/drivers/infiniband/hw/irdma/verbs.c 35 + +++ b/drivers/infiniband/hw/irdma/verbs.c 36 + @@ -60,6 +60,36 @@ static int irdma_query_device(struct ib_device *ibdev, 37 + return 0; 38 + } 39 + 40 + +/** 41 + + * irdma_get_eth_speed_and_width - Get IB port speed and width from netdev speed 42 + + * @link_speed: netdev phy link speed 43 + + * @active_speed: IB port speed 44 + + * @active_width: IB port width 45 + + */ 46 + +static void irdma_get_eth_speed_and_width(u32 link_speed, u16 *active_speed, 47 + + u8 *active_width) 48 + +{ 49 + + if (link_speed <= SPEED_1000) { 50 + + *active_width = IB_WIDTH_1X; 51 + + *active_speed = IB_SPEED_SDR; 52 + + } else if (link_speed <= SPEED_10000) { 53 + + *active_width = IB_WIDTH_1X; 54 + + *active_speed = IB_SPEED_FDR10; 55 + + } else if (link_speed <= SPEED_20000) { 56 + + *active_width = IB_WIDTH_4X; 57 + + *active_speed = IB_SPEED_DDR; 58 + + } else if (link_speed <= SPEED_25000) { 59 + + *active_width = IB_WIDTH_1X; 60 + + *active_speed = IB_SPEED_EDR; 61 + + } else if (link_speed <= SPEED_40000) { 62 + + *active_width = IB_WIDTH_4X; 63 + + *active_speed = IB_SPEED_FDR10; 64 + + } else { 65 + + *active_width = IB_WIDTH_4X; 66 + + *active_speed = IB_SPEED_EDR; 67 + + } 68 + +} 69 + + 70 + /** 71 + * irdma_query_port - get port attributes 72 + * @ibdev: device pointer from stack 73 + @@ -87,9 +117,8 @@ static int irdma_query_port(struct ib_device *ibdev, u32 port, 74 + props->state = IB_PORT_DOWN; 75 + props->phys_state = IB_PORT_PHYS_STATE_DISABLED; 76 + } 77 + - 78 + - ib_get_eth_speed(ibdev, port, &props->active_speed, 79 + - &props->active_width); 80 + + irdma_get_eth_speed_and_width(SPEED_100000, &props->active_speed, 81 + + &props->active_width); 82 + 83 + if (rdma_protocol_roce(ibdev, 1)) { 84 + props->gid_tbl_len = 32; 85 + -- 86 + 2.39.0 87 +
+5
pkgs/os-specific/linux/kernel/patches.nix
··· 57 57 name = "export-rt-sched-migrate"; 58 58 patch = ./export-rt-sched-migrate.patch; 59 59 }; 60 + 61 + fix-em-ice-bonding = { 62 + name = "fix-em-ice-bonding"; 63 + patch = ./fix-em-ice-bonding.patch; 64 + }; 60 65 }
+2
pkgs/top-level/linux-kernels.nix
··· 148 148 kernelPatches = [ 149 149 kernelPatches.bridge_stp_helper 150 150 kernelPatches.request_key_helper 151 + kernelPatches.fix-em-ice-bonding 151 152 ]; 152 153 }; 153 154 ··· 169 170 kernelPatches = [ 170 171 kernelPatches.bridge_stp_helper 171 172 kernelPatches.request_key_helper 173 + kernelPatches.fix-em-ice-bonding 172 174 ]; 173 175 }; 174 176