├── README.md ├── .gitignore ├── Legacy ├── 4.4.116 │ ├── 0009-mlx4_en-Set-default-rx-queues-to-32.patch │ ├── 0008-hv_netvsc-replace-unregister_netdev-with-unregister_.patch │ ├── 0002-kernel-4.4.116-add-export-of-missing-symbols.patch │ ├── 0010-hack-l3-cache-fix-for-intel-vcpu-in-hyperv.pacth │ └── 0004-Add-INFINIBAND_ADDR_TRANS_CONFIGFS.patch ├── 4.13 │ ├── Tools-hv-fix-snprintf-warning-in-kvp_daemon.patch │ ├── 0041-netvsc-prefetch-the-first-incoming-ring-element.patch │ ├── netvsc-remove-bogus-rtnl_unlock.patch │ ├── hv_sock-add-the-support-of-auto-loading.patch │ ├── netvsc-align-buffer-sizing-with-net-next.patch │ ├── netvsc-Remove-redundant-use-of-ipv6_hdr.patch │ ├── netvsc-fix-return-value-for-set_channels.patch │ ├── hv-balloon-Initialize-last_post_time-on-star.patch │ ├── hv_netvsc-Fix-the-channel-limit-in-netvsc_set_rxfh.patch │ ├── netvsc-don-t-signal-host-twice-if-empty.patch │ ├── vmbus-vmbus_open-reset-onchannel_callback-on-error.patch │ ├── hv_netvsc-avoid-unnecessary-wakeups-on-subchannel-cr.patch │ ├── netvsc-don-t-print-pointer-value-in-error-message.patch │ ├── netvsc-remove-unnecessary-check-for-NULL-hdr.patch │ ├── netvsc-fix-use-after-free-in-transparent-VF-send.patch │ ├── netvsc-force-link-update-after-MTU-change.patch │ ├── hv-balloon-Show-the-max-dynamic-memory-assig.patch │ ├── vmbus-unregister-device_obj-channels_kset.patch │ ├── netvsc-fix-error-unwind-on-device-setup-failure.patch │ ├── hv_netvsc-replace-divide-with-mask-when-computing-pa.patch │ ├── netvsc-fix-ptr_ret.cocci-warnings.patch │ ├── hv_netvsc-Clean-up-unused-parameter-from-netvsc_get_rss_hash_opts.patch │ ├── vmbus-add-prefetch-to-ring-buffer-iterator.patch │ ├── netvsc-include-rtnetlink.h.patch │ ├── hv-kvp-Use-MAX_ADAPTER_ID_SIZE-for-translati.patch │ ├── hv_netvsc-don-t-need-local-xmit_more.patch │ ├── hv_netvsc-Add-initialization-of-tx_table-in-netvsc_d.patch │ ├── pci-hyperv-Use-only-16-bit-integer-for-PCI-domain.patch │ ├── hv_netvsc-use-hv_get_bytes_to_write.patch │ ├── hv_sock-avoid-double-FINs-if-shutdown-is-called.patch │ ├── netvsc-fix-rtnl-deadlock-on-unregister-of-vf.patch │ ├── hv_netvsc-Clean-up-unsed-parameter-from-netvsc_get_hash.patch │ ├── hv_netvsc-Simplify-the-limit-check-in-netvsc_set_cha.patch │ ├── netvsc-signal-host-if-receive-ring-is-emptied.patch │ ├── hv_netvsc-Fix-the-real-number-of-queues-of-non-vRSS-.patch │ ├── hv_netvsc-Simplify-num_chn-checking-in-rndis_filter_.patch │ ├── hyper-v-trace-vmbus_on_message.patch │ ├── hv_netvsc-make-const-array-ver_list-static-reduces-o.patch │ ├── vmbus-suppress-uevents-for-hv_sock-devices.patch │ ├── netvsc-change-order-of-steps-in-setting-queues.patch │ ├── netvsc-prefetch-the-first-incoming-ring-element.patch │ ├── hyper-v-trace-vmbus_ongpadl_torndown.patch │ ├── hyper-v-trace-vmbus_onoffer_rescind.patch │ ├── hv_netvsc-Fix-rndis_filter_close-error-during-netvsc.patch │ ├── netvsc-remove-unnecessary-cast-of-void-pointer.patch │ ├── hyper-v-trace-vmbus_request_offers.patch │ └── hv_netvsc-drop-received-traffic-if-device-not-opened.patch ├── 4.15 │ ├── 0046-Boot-with-rcu-expedite-on.patch │ ├── 0051-give-rdrand-some-credit.patch │ ├── 0041-smpboot-reuse-timer-calibration.patch │ ├── 0019-uio_hv_generic-use-ISR-callback-method.patch │ ├── 0052-free-initmem-asynchronously.patch │ ├── 0053-remove-clear-ioapic.patch │ ├── 0022-uio_hv_generic-check-that-host-supports-monitor-page.patch │ ├── 0049-init_task-faster-timerslack.patch │ ├── 0003-hv_netvsc-replace-divide-with-mask-when-computing-pa.patch │ ├── 0045-Make-a-few-key-drivers-probe-asynchronous.patch │ ├── 0002-hv_netvsc-don-t-need-local-xmit_more.patch │ ├── 0055-init-don-t-wait-for-PS-2-at-boot.patch │ ├── 0035-pci-hyperv-Use-only-16-bit-integer-for-PCI-domain.patch │ └── 0017-uio_hv_generic-fix-configuration-comments.patch ├── 3.10.88 │ └── 0001-hack-pci-res-code-to-make-OFED-driver-work.patch ├── 3.10.108 │ └── 0002-hack-pci-res-code-to-make-OFED-driver-work.patch └── 4.14 │ ├── hv_netvsc-tx-table-set-weight.patch │ ├── vmbus-unregister-device_obj-channels_kset.patch │ ├── hv_netvsc-replace-divide-with-mask-when-computing-pa.patch │ ├── hv_netvsc-hide-warnings-about-rndis-device.patch │ ├── hv_netvsc-don-t-need-local-xmit_more.patch │ ├── hv_netvsc-Add-initialization-of-tx_table-in-netvsc_d.patch │ ├── pci-hyperv-Use-only-16-bit-integer-for-PCI-domain.patch │ ├── hv_netvsc-use-hv_get_bytes_to_write.patch │ ├── hv_netvsc-Fix-the-real-number-of-queues-of-non-vRSS-.patch │ ├── trace-vmbus_on_message.patch │ ├── hv_netvsc-make-const-array-ver_list-static-reduces-o.patch │ ├── trace-vmbus_ongpadl_torndown.patch │ ├── hv_netvsc-Update-netvsc-Document-for-TCP-hash-level-.patch │ ├── trace-vmbus_onoffer_rescind.patch │ ├── trace-vmbus_request_offers.patch │ └── hv_netvsc-drop-received-traffic-if-device-not-opened.patch └── Patches_Following_Mainline_History ├── 4.4.211 ├── 0361-net-mlx4-remove-unused-array-zero_gid.patch ├── 0455-IB-core-Make-all-casts-in-ib_device_cap_flags-enum-c.patch ├── 0585-net-mlx5-Update-struct-mlx5_ifc_xrqc_bits.patch ├── 0265-cpu-hotplug-Remove-redundant-state-check.patch ├── 0384-net-mlx5e-Remove-redundant-barrier.patch ├── 0046-mlxsw-core-Change-BUG-to-WARN-in-hwmon-code.patch ├── 0053-mlxsw-core-remove-an-unneeded-condition.patch ├── 0458-net-mlx5-Update-command-strings.patch ├── 0620-PCI-hv-Remove-the-unused-wrk-in-struct-hv_pcibus_dev.patch ├── 0751-netvsc-fix-return-value-for-set_channels.patch ├── 0776-hv_netvsc-Fix-the-channel-limit-in-netvsc_set_rxfh.patch ├── 0617-PCI-hv-Use-list_move_tail-instead-of-list_del-list_a.patch ├── 0705-hv_netvsc-change-netvsc-device-default-duplex-to-FUL.patch ├── 0274-Drivers-hv-vmbus-add-a-helper-function-to-set-a-chan.patch ├── 0485-net-mlx5e-Add-missing-50G-baseSR2-link-mode.patch ├── 0813-hv_netvsc-only-wake-transmit-queue-if-link-is-up.patch ├── README-4.4.211 ├── 0063-mlxsw-reg-Fix-max-temperature-getting.patch ├── 0110-mlxsw-fix-SWITCHDEV_OBJ_ID_PORT_MDB.patch ├── 0170-net-mlx5e-Remove-select-queue-ndo-initialization.patch ├── 0079-mlxsw-spectrum-Initialize-PVID-only-once.patch ├── 0088-mlxsw-Fixing-vlans-init-range.patch ├── 0786-hv_netvsc-avoid-unnecessary-wakeups-on-subchannel-cr.patch ├── 0843-vmbus-don-t-return-values-for-uninitalized-channels.patch ├── 0846-netvsc-fix-rcu-dereference-warning-from-ethtool.patch ├── 0052-mlxsw-spectrum-fix-some-error-handling.patch ├── 0054-net-mlx5-Fix-query-E-Switch-capabilities.patch ├── 0741-netvsc-force-link-update-after-MTU-change.patch ├── 0814-hv_netvsc-fix-error-unwind-handling-if-vmbus_open-fa.patch ├── 0362-net-mlx5_core-Fix-caching-ATOMIC-endian-mode-capabil.patch ├── 0681-Drivers-hv-restore-TSC-page-cleanup-before-kexec.patch ├── 0178-mlxsw-Treat-local-port-64-as-valid.patch ├── 0819-hv_netvsc-fix-locking-during-VF-setup.patch ├── 0338-mlxsw-spectrum-Mark-unused-ports-using-NULL.patch ├── 0675-Drivers-hv-util-Use-hv_get_current_tick-to-get-curre.patch ├── 0322-IB-mlx5-Eliminate-GSI-RX-QP-s-send-buffers.patch ├── 0806-vmbus-unregister-device_obj-channels_kset.patch ├── 0461-net-mlx5e-Check-for-BlueFlame-capability-before-allo.patch ├── 0354-net-mlx5e-Relax-ndo_setup_tc-handle-restriction.patch ├── 0856-hv_netvsc-Sync-offloading-features-to-VF-NIC.patch ├── 0092-mlxsw-core-remove-an-unnecessary-condition.patch ├── 0567-hv_netvsc-make-variable-local.patch ├── 0370-net-mlx5_core-Add-ConnectX-5-to-list-of-supported-de.patch ├── 0397-net-mlx5e-Call-vxlan_get_rx_port-with-rtnl-lock.patch ├── 0313-IB-mlx5-Add-support-for-CSUM-in-RX-flow.patch ├── 0832-hv_netvsc-set-master-device.patch ├── 0750-netvsc-include-rtnetlink.h.patch └── 0648-hv_netvsc-init-completion-during-alloc.patch ├── 4.9.184 ├── 0042-hv_netvsc-change-netvsc-device-default-duplex-to-FUL.patch ├── 0101-hv_netvsc-disable-NAPI-before-channel-close.patch ├── 0117-vmbus-don-t-return-values-for-uninitalized-channels.patch ├── 0028-Drivers-hv-restore-TSC-page-cleanup-before-kexec.patch ├── 0118-hv_netvsc-fix-locking-during-VF-setup.patch ├── 0097-hv_netvsc-fix-error-unwind-handling-if-vmbus_open-fa.patch ├── 0025-Drivers-hv-util-Use-hv_get_current_tick-to-get-curre.patch ├── 0094-vmbus-unregister-device_obj-channels_kset.patch ├── 0108-hv_netvsc-set-master-device.patch └── 0062-netvsc-include-rtnetlink.h.patch ├── 4.19.87 └── README-4.19.87.txt └── 4.14.141 ├── README-4.14.141 ├── 0023-vmbus-don-t-return-values-for-uninitalized-channels.patch ├── 0010-hv_netvsc-fix-race-in-napi-poll-when-rescheduling.patch ├── 0007-vmbus-unregister-device_obj-channels_kset.patch └── 0020-hv_netvsc-Fix-napi-reschedule-while-receive-completi.patch /README.md: -------------------------------------------------------------------------------- 1 | TODO: Create a file called LICENSE (not LICENSE.TXT, LICENSE.md, etc.)… -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Prerequisites 2 | *.d 3 | 4 | # Object files 5 | *.o 6 | *.ko 7 | *.obj 8 | *.elf 9 | 10 | # Linker output 11 | *.ilk 12 | *.map 13 | *.exp 14 | 15 | # Precompiled Headers 16 | *.gch 17 | *.pch 18 | 19 | # Libraries 20 | *.lib 21 | *.a 22 | *.la 23 | *.lo 24 | 25 | # Shared objects (inc. Windows DLLs) 26 | *.dll 27 | *.so 28 | *.so.* 29 | *.dylib 30 | 31 | # Executables 32 | *.exe 33 | *.out 34 | *.app 35 | *.i*86 36 | *.x86_64 37 | *.hex 38 | 39 | # Debug files 40 | *.dSYM/ 41 | *.su 42 | *.idb 43 | *.pdb 44 | 45 | # Kernel Module Compile Results 46 | *.mod* 47 | *.cmd 48 | .tmp_versions/ 49 | modules.order 50 | Module.symvers 51 | Mkfile.old 52 | dkms.conf 53 | 54 | # Quilt temporary files 55 | .pc 56 | -------------------------------------------------------------------------------- /Legacy/4.4.116/0009-mlx4_en-Set-default-rx-queues-to-32.patch: -------------------------------------------------------------------------------- 1 | From bd95b4f22f43012c93381f89515ba6b9694e229e Mon Sep 17 00:00:00 2001 2 | From: Haiyang Zhang 3 | Date: Sat, 18 Aug 2018 12:55:53 +0000 4 | Subject: [PATCH] mlx4_en: Set default rx queues to 32 5 | 6 | --- 7 | drivers/net/ethernet/mellanox/mlx4/mlx4_en.h | 2 +- 8 | 1 file changed, 1 insertion(+), 1 deletion(-) 9 | 10 | diff --git a/drivers/net/ethernet/mellanox/mlx4/mlx4_en.h b/drivers/net/ethernet/mellanox/mlx4/mlx4_en.h 11 | index 23701be..79f4236 100644 12 | --- a/drivers/net/ethernet/mellanox/mlx4/mlx4_en.h 13 | +++ b/drivers/net/ethernet/mellanox/mlx4/mlx4_en.h 14 | @@ -87,7 +87,7 @@ 15 | 16 | #define MLX4_EN_PAGE_SHIFT 12 17 | #define MLX4_EN_PAGE_SIZE (1 << MLX4_EN_PAGE_SHIFT) 18 | -#define DEF_RX_RINGS 16 19 | +#define DEF_RX_RINGS 32 20 | #define MAX_RX_RINGS 128 21 | #define MIN_RX_RINGS 4 22 | #define LOG_TXBB_SIZE 6 23 | -- 24 | 2.1.4 25 | 26 | -------------------------------------------------------------------------------- /Legacy/4.4.116/0008-hv_netvsc-replace-unregister_netdev-with-unregister_.patch: -------------------------------------------------------------------------------- 1 | From ac16c7a38654b4b9494b9b411ac53d74391818fd Mon Sep 17 00:00:00 2001 2 | From: Haiyang Zhang 3 | Date: Wed, 15 Aug 2018 22:09:38 +0300 4 | Subject: [PATCH] hv_netvsc: replace unregister_netdev with unregister_netdevice 5 | 6 | This fixes the unloading hang 7 | --- 8 | drivers/net/hyperv/netvsc_drv.c | 2 +- 9 | 1 file changed, 1 insertion(+), 1 deletion(-) 10 | 11 | diff --git a/drivers/net/hyperv/netvsc_drv.c b/drivers/net/hyperv/netvsc_drv.c 12 | index 176cbfa..c381c1b 100644 13 | --- a/drivers/net/hyperv/netvsc_drv.c 14 | +++ b/drivers/net/hyperv/netvsc_drv.c 15 | @@ -1736,7 +1736,7 @@ static int netvsc_remove(struct hv_device *dev) 16 | if (vf_netdev) 17 | netvsc_unregister_vf(vf_netdev); 18 | 19 | - unregister_netdev(net); 20 | + unregister_netdevice(net); 21 | 22 | rndis_filter_device_remove(dev); 23 | rtnl_unlock(); 24 | -- 25 | 2.1.4 26 | 27 | -------------------------------------------------------------------------------- /Legacy/4.13/Tools-hv-fix-snprintf-warning-in-kvp_daemon.patch: -------------------------------------------------------------------------------- 1 | From b1284536ce050830a8fdc7db00522d3d8b492a7e Mon Sep 17 00:00:00 2001 2 | From: Olaf Hering 3 | Date: Thu, 10 Aug 2017 15:45:15 -0700 4 | Subject: [PATCH 77/98] Tools: hv: fix snprintf warning in kvp_daemon 5 | 6 | Increase buffer size so that "_{-INT_MAX}" will fit. 7 | Spotted by the gcc7 snprintf checker. 8 | 9 | Signed-off-by: Olaf Hering 10 | Signed-off-by: K. Y. Srinivasan 11 | --- 12 | tools/hv/hv_kvp_daemon.c | 2 +- 13 | 1 file changed, 1 insertion(+), 1 deletion(-) 14 | 15 | --- a/tools/hv/hv_kvp_daemon.c 2017-12-05 16:23:28.091784281 -0800 16 | +++ b/tools/hv/hv_kvp_daemon.c 2017-12-05 16:23:28.087784334 -0800 17 | @@ -1136,7 +1136,7 @@ static int process_ip_string(FILE *f, ch 18 | int i = 0; 19 | int j = 0; 20 | char str[256]; 21 | - char sub_str[10]; 22 | + char sub_str[13]; 23 | int offset = 0; 24 | 25 | memset(addr, 0, sizeof(addr)); 26 | -------------------------------------------------------------------------------- /Legacy/4.4.116/0002-kernel-4.4.116-add-export-of-missing-symbols.patch: -------------------------------------------------------------------------------- 1 | From ebb17be6e47a734e4e676c8d454e7bc6361e6d81 Mon Sep 17 00:00:00 2001 2 | From: your name 3 | Date: Sun, 18 Feb 2018 08:52:41 -0800 4 | Subject: [PATCH 2/4] kernel 4.4.116 add export of missing symbols 5 | 6 | --- 7 | arch/x86/hyperv/hv_init.c | 2 ++ 8 | 1 file changed, 2 insertions(+) 9 | 10 | diff --git a/arch/x86/hyperv/hv_init.c b/arch/x86/hyperv/hv_init.c 11 | index 1d7b547..1cd8e57 100644 12 | --- a/arch/x86/hyperv/hv_init.c 13 | +++ b/arch/x86/hyperv/hv_init.c 14 | @@ -95,6 +95,7 @@ int hv_cpu_init(unsigned int cpu) 15 | 16 | return 0; 17 | } 18 | +EXPORT_SYMBOL_GPL(hv_cpu_init); 19 | 20 | /* 21 | * This function is to be invoked early in the boot sequence after the 22 | @@ -178,6 +179,7 @@ free_vp_index: 23 | kfree(hv_vp_index); 24 | hv_vp_index = NULL; 25 | } 26 | +EXPORT_SYMBOL_GPL(hyperv_init); 27 | 28 | /* 29 | * This routine is called before kexec/kdump, it does the required cleanup. 30 | -- 31 | 2.7.4 32 | 33 | -------------------------------------------------------------------------------- /Legacy/4.13/0041-netvsc-prefetch-the-first-incoming-ring-element.patch: -------------------------------------------------------------------------------- 1 | From 157d1be023f1f994f979f4fa8395120fd3d88a6e Mon Sep 17 00:00:00 2001 2 | From: stephen hemminger 3 | Date: Mon, 24 Jul 2017 10:57:27 -0700 4 | Subject: [PATCH 41/98] netvsc: prefetch the first incoming ring element 5 | 6 | In interrupt handler, prefetch the first incoming ring element 7 | so that it is in cache by the time NAPI poll gets to it. 8 | 9 | Signed-off-by: Stephen Hemminger 10 | Signed-off-by: David S. Miller 11 | --- 12 | drivers/net/hyperv/netvsc.c | 1 + 13 | 1 file changed, 1 insertion(+) 14 | 15 | --- a/drivers/net/hyperv/netvsc.c 2017-12-05 16:21:06.077591391 -0800 16 | +++ b/drivers/net/hyperv/netvsc.c 2017-12-05 16:21:36.841199905 -0800 17 | @@ -30,6 +30,7 @@ 18 | #include 19 | #include 20 | #include 21 | +#include 22 | #include 23 | 24 | #include "hyperv_net.h" 25 | -------------------------------------------------------------------------------- /Legacy/4.13/netvsc-remove-bogus-rtnl_unlock.patch: -------------------------------------------------------------------------------- 1 | From 037edb5556e7b1adcad3b263f0dfe2247d36811c Mon Sep 17 00:00:00 2001 2 | From: stephen hemminger 3 | Date: Mon, 24 Jul 2017 10:57:25 -0700 4 | Subject: [PATCH 39/98] netvsc: remove bogus rtnl_unlock 5 | 6 | Remove accidental rtnl_unlock from earlier testing. 7 | 8 | Fixes: 3962981f4822 ("netvsc: add rtnl annotations in rndis") 9 | Signed-off-by: Stephen Hemminger 10 | Signed-off-by: David S. Miller 11 | --- 12 | drivers/net/hyperv/netvsc_drv.c | 1 - 13 | 1 file changed, 1 deletion(-) 14 | 15 | --- a/drivers/net/hyperv/netvsc_drv.c 2017-10-05 14:20:50.903517019 -0700 16 | +++ b/drivers/net/hyperv/netvsc_drv.c 2017-10-05 14:20:50.903517019 -0700 17 | @@ -1576,7 +1576,6 @@ static int netvsc_probe(struct hv_device 18 | 19 | netif_set_real_num_tx_queues(net, nvdev->num_chn); 20 | netif_set_real_num_rx_queues(net, nvdev->num_chn); 21 | - rtnl_unlock(); 22 | 23 | netdev_lockdep_set_classes(net); 24 | 25 | -------------------------------------------------------------------------------- /Legacy/4.4.116/0010-hack-l3-cache-fix-for-intel-vcpu-in-hyperv.pacth: -------------------------------------------------------------------------------- 1 | From 14be599f4adb53689b5e4c00ec57e4f10f4a12d6 Mon Sep 17 00:00:00 2001 2 | From: Michael Kelley 3 | Date: Fri, 24 Aug 2018 00:09:57 +0000 4 | Subject: [PATCH] HACK: force the L3 cache group for Intel vCPUs in HyperV 5 | 6 | --- 7 | arch/x86/kernel/cpu/intel_cacheinfo.c | 2 ++ 8 | 1 file changed, 2 insertions(+) 9 | 10 | diff --git a/arch/x86/kernel/cpu/intel_cacheinfo.c b/arch/x86/kernel/cpu/intel_cacheinfo.c 11 | index b4ca91c..2ab3e49 100644 12 | --- a/arch/x86/kernel/cpu/intel_cacheinfo.c 13 | +++ b/arch/x86/kernel/cpu/intel_cacheinfo.c 14 | @@ -604,6 +604,8 @@ cpuid4_cache_lookup_regs(int index, struct _cpuid4_info_regs *this_leaf) 15 | if (eax.split.type == CTYPE_NULL) 16 | return -EIO; /* better error ? */ 17 | 18 | + if (eax.split.level == 3) 19 | + eax.split.num_threads_sharing = (num_processors/nr_node_ids) - 1; 20 | this_leaf->eax = eax; 21 | this_leaf->ebx = ebx; 22 | this_leaf->ecx = ecx; 23 | -- 24 | 2.1.4 25 | 26 | -------------------------------------------------------------------------------- /Legacy/4.13/hv_sock-add-the-support-of-auto-loading.patch: -------------------------------------------------------------------------------- 1 | From bdc7e1e834d3b0dd0ce894d505a6e7397b24c88a Mon Sep 17 00:00:00 2001 2 | From: Dexuan Cui 3 | Date: Wed, 26 Jul 2017 12:32:00 -0600 4 | Subject: [PATCH 24/98] hv_sock: add the support of auto-loading 5 | 6 | After we disable VMWare virtual sockets driver's auto-loading on Hyper-V, 7 | we can enable hv_sock's auto-loading now. 8 | 9 | Signed-off-by: Dexuan Cui 10 | Cc: K. Y. Srinivasan 11 | Cc: Haiyang Zhang 12 | Cc: Stephen Hemminger 13 | --- 14 | net/vmw_vsock/hyperv_transport.c | 1 + 15 | 1 file changed, 1 insertion(+) 16 | 17 | --- a/net/vmw_vsock/hyperv_transport.c 2017-10-05 14:20:49.327497602 -0700 18 | +++ b/net/vmw_vsock/hyperv_transport.c 2017-10-05 14:20:49.323497553 -0700 19 | @@ -827,3 +827,4 @@ module_exit(hvs_exit); 20 | MODULE_DESCRIPTION("Hyper-V sockets"); 21 | MODULE_VERSION("1.0.0"); 22 | MODULE_LICENSE("GPL"); 23 | +MODULE_ALIAS_NETPROTO(PF_VSOCK); 24 | -------------------------------------------------------------------------------- /Legacy/4.15/0046-Boot-with-rcu-expedite-on.patch: -------------------------------------------------------------------------------- 1 | From b2760e679e1eb14b24d3963f0243c35746362c3d Mon Sep 17 00:00:00 2001 2 | From: Arjan van de Ven 3 | Date: Tue, 21 Jun 2016 21:23:52 +0000 4 | Subject: [PATCH 46/55] Boot with rcu expedite on 5 | 6 | Turn on rcu_expedite by default, we'll turn it back off at the end of the boot 7 | 8 | Signed-off-by: Arjan van de Ven 9 | Signed-off-by: Sasha Levin 10 | --- 11 | kernel/ksysfs.c | 2 +- 12 | 1 file changed, 1 insertion(+), 1 deletion(-) 13 | 14 | diff --git a/kernel/ksysfs.c b/kernel/ksysfs.c 15 | index 46ba853656f6..925c7fdd26c1 100644 16 | --- a/kernel/ksysfs.c 17 | +++ b/kernel/ksysfs.c 18 | @@ -149,7 +149,7 @@ static ssize_t fscaps_show(struct kobject *kobj, 19 | KERNEL_ATTR_RO(fscaps); 20 | 21 | #ifndef CONFIG_TINY_RCU 22 | -int rcu_expedited; 23 | +int rcu_expedited = 1; 24 | static ssize_t rcu_expedited_show(struct kobject *kobj, 25 | struct kobj_attribute *attr, char *buf) 26 | { 27 | -- 28 | 2.14.1 29 | 30 | -------------------------------------------------------------------------------- /Legacy/4.13/netvsc-align-buffer-sizing-with-net-next.patch: -------------------------------------------------------------------------------- 1 | From 52705cc0231fc0b35ff20d9afb1a88bb74562c89 Mon Sep 17 00:00:00 2001 2 | From: Stephen Hemminger 3 | Date: Thu, 10 Aug 2017 09:50:36 -0700 4 | Subject: [PATCH 76/98] netvsc: align buffer sizing with net-next 5 | 6 | Submission to net-next had different send buffer size. 7 | --- 8 | drivers/net/hyperv/netvsc_drv.c | 5 +++-- 9 | 1 file changed, 3 insertions(+), 2 deletions(-) 10 | 11 | --- a/drivers/net/hyperv/netvsc_drv.c 2017-12-05 16:23:27.227795276 -0800 12 | +++ b/drivers/net/hyperv/netvsc_drv.c 2017-12-05 16:23:27.223795326 -0800 13 | @@ -47,10 +47,11 @@ 14 | 15 | #define RING_SIZE_MIN 64 16 | #define NETVSC_MIN_TX_SECTIONS 10 17 | -#define NETVSC_DEFAULT_TX 160 /* ~1M */ 18 | +#define NETVSC_DEFAULT_TX 192 /* ~1M */ 19 | #define NETVSC_MIN_RX_SECTIONS 10 /* ~64K */ 20 | #define NETVSC_DEFAULT_RX 2048 /* ~4M */ 21 | -#define LINKCHANGE_INT (2 * HZ) 22 | + 23 | +#define LINKCHANGE_INT (2 * HZ) 24 | #define VF_TAKEOVER_INT (HZ / 10) 25 | 26 | static int ring_size = 128; 27 | -------------------------------------------------------------------------------- /Legacy/4.13/netvsc-Remove-redundant-use-of-ipv6_hdr.patch: -------------------------------------------------------------------------------- 1 | From 4153693ebf2423505e53d6e9fa5c38fe1a5d1de0 Mon Sep 17 00:00:00 2001 2 | From: Mohammed Gamal 3 | Date: Mon, 24 Jul 2017 10:57:26 -0700 4 | Subject: [PATCH 40/98] netvsc: Remove redundant use of ipv6_hdr() 5 | 6 | This condition already uses an object of type ipv6hdr in the line above. 7 | Use the object directly instead of calling ipv6_hdr 8 | 9 | Signed-off-by: Mohammed Gamal 10 | Signed-off-by: David S. Miller 11 | --- 12 | drivers/net/hyperv/netvsc_drv.c | 2 +- 13 | 1 file changed, 1 insertion(+), 1 deletion(-) 14 | 15 | --- a/drivers/net/hyperv/netvsc_drv.c 2017-10-05 14:20:51.011518350 -0700 16 | +++ b/drivers/net/hyperv/netvsc_drv.c 2017-10-05 14:20:51.007518300 -0700 17 | @@ -359,7 +359,7 @@ static u32 net_checksum_info(struct sk_b 18 | 19 | if (ip6->nexthdr == IPPROTO_TCP) 20 | return TRANSPORT_INFO_IPV6_TCP; 21 | - else if (ipv6_hdr(skb)->nexthdr == IPPROTO_UDP) 22 | + else if (ip6->nexthdr == IPPROTO_UDP) 23 | return TRANSPORT_INFO_IPV6_UDP; 24 | } 25 | 26 | -------------------------------------------------------------------------------- /Legacy/4.13/netvsc-fix-return-value-for-set_channels.patch: -------------------------------------------------------------------------------- 1 | From a24dae53c1ef26ec3175d5f3f8b74612ec1cc60d Mon Sep 17 00:00:00 2001 2 | From: stephen hemminger 3 | Date: Fri, 28 Jul 2017 08:59:41 -0700 4 | Subject: [PATCH 45/98] netvsc: fix return value for set_channels 5 | 6 | The error and normal case got swapped. 7 | 8 | Signed-off-by: Stephen Hemminger 9 | Signed-off-by: David S. Miller 10 | --- 11 | drivers/net/hyperv/netvsc_drv.c | 2 +- 12 | 1 file changed, 1 insertion(+), 1 deletion(-) 13 | 14 | --- a/drivers/net/hyperv/netvsc_drv.c 2017-10-05 14:20:51.503524411 -0700 15 | +++ b/drivers/net/hyperv/netvsc_drv.c 2017-10-05 14:20:51.499524362 -0700 16 | @@ -781,8 +781,8 @@ static int netvsc_set_channels(struct ne 17 | if (!IS_ERR(nvdev)) { 18 | netif_set_real_num_tx_queues(net, nvdev->num_chn); 19 | netif_set_real_num_rx_queues(net, nvdev->num_chn); 20 | - ret = PTR_ERR(nvdev); 21 | } else { 22 | + ret = PTR_ERR(nvdev); 23 | device_info.num_chn = orig; 24 | rndis_filter_device_add(dev, &device_info); 25 | } 26 | -------------------------------------------------------------------------------- /Legacy/4.13/hv-balloon-Initialize-last_post_time-on-star.patch: -------------------------------------------------------------------------------- 1 | From cc7e715c468e617eff7ed0177fe1233ce18b9d2a Mon Sep 17 00:00:00 2001 2 | From: Alex Ng 3 | Date: Sun, 6 Aug 2017 13:12:55 -0700 4 | Subject: [PATCH 64/98] Drivers: hv: balloon: Initialize last_post_time on 5 | startup 6 | 7 | When left uninitialized, this sometimes fails the following check in 8 | post_status(): 9 | 10 | if (!time_after(now, (last_post_time + HZ))) { 11 | return; 12 | } 13 | 14 | This causes unnecessary delays in reporting memory pressure to host after 15 | booting up. 16 | 17 | Signed-off-by: Alex Ng 18 | Signed-off-by: K. Y. Srinivasan 19 | --- 20 | drivers/hv/hv_balloon.c | 1 + 21 | 1 file changed, 1 insertion(+) 22 | 23 | --- a/drivers/hv/hv_balloon.c 2017-12-05 16:23:17.723916202 -0800 24 | +++ b/drivers/hv/hv_balloon.c 2017-12-05 16:23:17.719916254 -0800 25 | @@ -1655,6 +1655,7 @@ static int balloon_probe(struct hv_devic 26 | } 27 | 28 | dm_device.state = DM_INITIALIZED; 29 | + last_post_time = jiffies; 30 | 31 | return 0; 32 | 33 | -------------------------------------------------------------------------------- /Legacy/3.10.88/0001-hack-pci-res-code-to-make-OFED-driver-work.patch: -------------------------------------------------------------------------------- 1 | From 381b003a6e839374f34ba7b3a23c81c7c3d42ef9 Mon Sep 17 00:00:00 2001 2 | From: Dexuan Cui 3 | Date: Wed, 3 Jan 2018 11:45:08 -0800 4 | Subject: [PATCH 1/2] hack pci res code to make OFED driver work... 5 | 6 | Signed-off-by: Dexuan Cui 7 | --- 8 | drivers/pci/bus.c | 2 ++ 9 | 1 file changed, 2 insertions(+) 10 | 11 | diff --git a/drivers/pci/bus.c b/drivers/pci/bus.c 12 | index 32e66a6..d700a0e 100644 13 | --- a/drivers/pci/bus.c 14 | +++ b/drivers/pci/bus.c 15 | @@ -137,6 +137,7 @@ pci_bus_alloc_resource(struct pci_bus *bus, struct resource *res, 16 | if (!r) 17 | continue; 18 | 19 | +#if 0 20 | /* type_mask must match */ 21 | if ((res->flags ^ r->flags) & type_mask) 22 | continue; 23 | @@ -146,6 +147,7 @@ pci_bus_alloc_resource(struct pci_bus *bus, struct resource *res, 24 | if ((r->flags & IORESOURCE_PREFETCH) && 25 | !(res->flags & IORESOURCE_PREFETCH)) 26 | continue; 27 | +#endif 28 | 29 | /* Ok, try it out.. */ 30 | ret = allocate_resource(r, res, size, 31 | -- 32 | 2.7.4 33 | 34 | -------------------------------------------------------------------------------- /Legacy/4.13/hv_netvsc-Fix-the-channel-limit-in-netvsc_set_rxfh.patch: -------------------------------------------------------------------------------- 1 | From d193aab68f509b8972525fd708db2485e72654da Mon Sep 17 00:00:00 2001 2 | From: Haiyang Zhang 3 | Date: Fri, 1 Sep 2017 14:30:07 -0700 4 | Subject: [PATCH 93/98] hv_netvsc: Fix the channel limit in netvsc_set_rxfh() 5 | 6 | The limit of setting receive indirection table value should be 7 | the current number of channels, not the VRSS_CHANNEL_MAX. 8 | 9 | Signed-off-by: Haiyang Zhang 10 | Signed-off-by: David S. Miller 11 | --- 12 | drivers/net/hyperv/netvsc_drv.c | 2 +- 13 | 1 file changed, 1 insertion(+), 1 deletion(-) 14 | 15 | --- a/drivers/net/hyperv/netvsc_drv.c 2017-12-05 16:23:43.875583451 -0800 16 | +++ b/drivers/net/hyperv/netvsc_drv.c 2017-12-05 16:23:43.871583502 -0800 17 | @@ -1407,7 +1407,7 @@ static int netvsc_set_rxfh(struct net_de 18 | rndis_dev = ndev->extension; 19 | if (indir) { 20 | for (i = 0; i < ITAB_NUM; i++) 21 | - if (indir[i] >= VRSS_CHANNEL_MAX) 22 | + if (indir[i] >= ndev->num_chn) 23 | return -EINVAL; 24 | 25 | for (i = 0; i < ITAB_NUM; i++) 26 | -------------------------------------------------------------------------------- /Legacy/4.13/netvsc-don-t-signal-host-twice-if-empty.patch: -------------------------------------------------------------------------------- 1 | From b10e5553187a5a815cd782be7ae0886ebfa844cb Mon Sep 17 00:00:00 2001 2 | From: Stephen Hemminger 3 | Date: Mon, 7 Aug 2017 09:21:31 -0700 4 | Subject: [PATCH 66/98] netvsc: don't signal host twice if empty 5 | 6 | When hv_pkt_iter_next() returns NULL, it has already called 7 | hv_pkt_iter_close(). Calling it twice can lead to extra host signal. 8 | 9 | Signed-off-by: Stephen Hemminger 10 | --- 11 | drivers/net/hyperv/netvsc.c | 4 ---- 12 | 1 file changed, 4 deletions(-) 13 | 14 | --- a/drivers/net/hyperv/netvsc.c 2017-12-05 16:23:19.231897015 -0800 15 | +++ b/drivers/net/hyperv/netvsc.c 2017-12-05 16:23:19.227897067 -0800 16 | @@ -1194,10 +1194,6 @@ int netvsc_poll(struct napi_struct *napi 17 | nvchan->desc = hv_pkt_iter_next(channel, nvchan->desc); 18 | } 19 | 20 | - /* if ring is empty, signal host */ 21 | - if (!nvchan->desc) 22 | - hv_pkt_iter_close(channel); 23 | - 24 | /* If send of pending receive completions suceeded 25 | * and did not exhaust NAPI budget this time 26 | * and not doing busy poll 27 | -------------------------------------------------------------------------------- /Legacy/3.10.108/0002-hack-pci-res-code-to-make-OFED-driver-work.patch: -------------------------------------------------------------------------------- 1 | From 0672d3bf08e1fb6b807d7e4bc6c171fd5165948e Mon Sep 17 00:00:00 2001 2 | From: Dexuan Cui 3 | Date: Wed, 3 Jan 2018 11:45:08 -0800 4 | Subject: [PATCH 2/2] hack pci res code to make OFED driver work... 5 | 6 | Signed-off-by: Dexuan Cui 7 | --- 8 | drivers/pci/bus.c | 2 ++ 9 | 1 file changed, 2 insertions(+) 10 | 11 | diff --git a/drivers/pci/bus.c b/drivers/pci/bus.c 12 | index 32e66a6..d700a0e 100644 13 | --- a/drivers/pci/bus.c 14 | +++ b/drivers/pci/bus.c 15 | @@ -137,6 +137,7 @@ pci_bus_alloc_resource(struct pci_bus *bus, struct resource *res, 16 | if (!r) 17 | continue; 18 | 19 | +#if 0 20 | /* type_mask must match */ 21 | if ((res->flags ^ r->flags) & type_mask) 22 | continue; 23 | @@ -146,6 +147,7 @@ pci_bus_alloc_resource(struct pci_bus *bus, struct resource *res, 24 | if ((r->flags & IORESOURCE_PREFETCH) && 25 | !(res->flags & IORESOURCE_PREFETCH)) 26 | continue; 27 | +#endif 28 | 29 | /* Ok, try it out.. */ 30 | ret = allocate_resource(r, res, size, 31 | -- 32 | 2.7.4 33 | 34 | -------------------------------------------------------------------------------- /Legacy/4.13/vmbus-vmbus_open-reset-onchannel_callback-on-error.patch: -------------------------------------------------------------------------------- 1 | From 6ce3e92a90dae96db2f27b4264c53fda8eb1a04a Mon Sep 17 00:00:00 2001 2 | From: Dexuan Cui 3 | Date: Wed, 26 Jul 2017 12:31:50 -0600 4 | Subject: [PATCH 10/98] vmbus: vmbus_open(): reset onchannel_callback on error 5 | 6 | No real issue is observed without the patch, but let's add this 7 | just in case. 8 | 9 | Signed-off-by: Dexuan Cui 10 | Cc: K. Y. Srinivasan 11 | Cc: Haiyang Zhang 12 | Cc: Stephen Hemminger 13 | --- 14 | drivers/hv/channel.c | 2 ++ 15 | 1 file changed, 2 insertions(+) 16 | 17 | --- a/drivers/hv/channel.c 2017-12-05 16:14:45.402437274 -0800 18 | +++ b/drivers/hv/channel.c 2017-12-05 16:14:45.402437274 -0800 19 | @@ -225,6 +225,8 @@ error_free_pages: 20 | get_order(send_ringbuffer_size + recv_ringbuffer_size)); 21 | error_set_chnstate: 22 | newchannel->state = CHANNEL_OPEN_STATE; 23 | + newchannel->onchannel_callback = NULL; 24 | + newchannel->channel_callback_context = NULL; 25 | return err; 26 | } 27 | EXPORT_SYMBOL_GPL(vmbus_open); 28 | -------------------------------------------------------------------------------- /Legacy/4.13/hv_netvsc-avoid-unnecessary-wakeups-on-subchannel-cr.patch: -------------------------------------------------------------------------------- 1 | From 52bd91cd2497a3872bbe1876fbb9b5d2f9c52cdb Mon Sep 17 00:00:00 2001 2 | From: Stephen Hemminger 3 | Date: Wed, 6 Sep 2017 10:54:16 -0700 4 | Subject: [PATCH 96/98] hv_netvsc: avoid unnecessary wakeups on subchannel 5 | creation 6 | 7 | Only need to wakeup the initiator after all sub-channels 8 | are opened. 9 | 10 | Signed-off-by: Stephen Hemminger 11 | --- 12 | drivers/net/hyperv/rndis_filter.c | 4 ++-- 13 | 1 file changed, 2 insertions(+), 2 deletions(-) 14 | 15 | --- a/drivers/net/hyperv/rndis_filter.c 2017-10-05 14:20:56.595587146 -0700 16 | +++ b/drivers/net/hyperv/rndis_filter.c 2017-10-05 14:20:56.591587096 -0700 17 | @@ -1048,8 +1048,8 @@ static void netvsc_sc_open(struct vmbus_ 18 | else 19 | netdev_notice(ndev, "sub channel open failed: %d\n", ret); 20 | 21 | - atomic_inc(&nvscdev->open_chn); 22 | - wake_up(&nvscdev->subchan_open); 23 | + if (atomic_inc_return(&nvscdev->open_chn) == nvscdev->num_chn) 24 | + wake_up(&nvscdev->subchan_open); 25 | } 26 | 27 | /* Open sub-channels after completing the handling of the device probe. 28 | -------------------------------------------------------------------------------- /Legacy/4.15/0051-give-rdrand-some-credit.patch: -------------------------------------------------------------------------------- 1 | From dbd33cae803c5e6cb6b7aa837eaa08b164837513 Mon Sep 17 00:00:00 2001 2 | From: Arjan van de Ven 3 | Date: Fri, 29 Jul 2016 19:10:52 +0000 4 | Subject: [PATCH 51/55] give rdrand some credit 5 | 6 | try to credit rdrand/rdseed with some entropy 7 | 8 | In VMs we're super starved for entropy, and while we can 9 | and do wear a tin foil hat, it's very hard to argue that 10 | rdrand and rdtsc add zero entropy. 11 | 12 | Signed-off-by: Sasha Levin 13 | --- 14 | drivers/char/random.c | 2 ++ 15 | 1 file changed, 2 insertions(+) 16 | 17 | diff --git a/drivers/char/random.c b/drivers/char/random.c 18 | index ec42c8bb9b0d..a97c17899ebf 100644 19 | --- a/drivers/char/random.c 20 | +++ b/drivers/char/random.c 21 | @@ -1665,6 +1665,8 @@ static void init_std_data(struct entropy_store *r) 22 | if (!arch_get_random_seed_long(&rv) && 23 | !arch_get_random_long(&rv)) 24 | rv = random_get_entropy(); 25 | + else 26 | + credit_entropy_bits(r, 4); 27 | mix_pool_bytes(r, &rv, sizeof(rv)); 28 | } 29 | mix_pool_bytes(r, utsname(), sizeof(*(utsname()))); 30 | -- 31 | 2.14.1 32 | 33 | -------------------------------------------------------------------------------- /Legacy/4.15/0041-smpboot-reuse-timer-calibration.patch: -------------------------------------------------------------------------------- 1 | From 2c2128a47fb32ed24e2af4a0aec3da9b64342a26 Mon Sep 17 00:00:00 2001 2 | From: Arjan van de Ven 3 | Date: Wed, 11 Feb 2015 17:28:14 -0600 4 | Subject: [PATCH 41/55] smpboot: reuse timer calibration 5 | 6 | NO point recalibrating for known-constant tsc... saves 200ms+ of boot time. 7 | 8 | Author: Arjan van de Ven 9 | 10 | Signed-off-by: Miguel Bernal Marin 11 | Signed-off-by: Sasha Levin 12 | --- 13 | arch/x86/kernel/tsc.c | 3 +++ 14 | 1 file changed, 3 insertions(+) 15 | 16 | diff --git a/arch/x86/kernel/tsc.c b/arch/x86/kernel/tsc.c 17 | index e169e85db434..359742b26526 100644 18 | --- a/arch/x86/kernel/tsc.c 19 | +++ b/arch/x86/kernel/tsc.c 20 | @@ -1378,6 +1378,9 @@ unsigned long calibrate_delay_is_known(void) 21 | if (tsc_disabled || !constant_tsc || !mask) 22 | return 0; 23 | 24 | + if (cpu != 0) 25 | + return cpu_data(0).loops_per_jiffy; 26 | + 27 | sibling = cpumask_any_but(mask, cpu); 28 | if (sibling < nr_cpu_ids) 29 | return cpu_data(sibling).loops_per_jiffy; 30 | -- 31 | 2.14.1 32 | 33 | -------------------------------------------------------------------------------- /Legacy/4.4.116/0004-Add-INFINIBAND_ADDR_TRANS_CONFIGFS.patch: -------------------------------------------------------------------------------- 1 | From b4bd4dc2f3dc563afddb49761c2b032a2e226eef Mon Sep 17 00:00:00 2001 2 | From: your name 3 | Date: Tue, 6 Mar 2018 13:46:23 -0800 4 | Subject: [PATCH 4/4] Add INFINIBAND_ADDR_TRANS_CONFIGFS 5 | 6 | --- 7 | drivers/infiniband/Kconfig | 9 +++++++++ 8 | 1 file changed, 9 insertions(+) 9 | 10 | diff --git a/drivers/infiniband/Kconfig b/drivers/infiniband/Kconfig 11 | index aa26f3c..018685f 100644 12 | --- a/drivers/infiniband/Kconfig 13 | +++ b/drivers/infiniband/Kconfig 14 | @@ -54,6 +54,15 @@ config INFINIBAND_ADDR_TRANS 15 | depends on INFINIBAND 16 | default y 17 | 18 | +config INFINIBAND_ADDR_TRANS_CONFIGFS 19 | + bool 20 | + depends on INFINIBAND_ADDR_TRANS && CONFIGFS_FS && !(INFINIBAND=y && CONFIGFS_FS=m) 21 | + default y 22 | + ---help--- 23 | + ConfigFS support for RDMA communication manager (CM). 24 | + This allows the user to config the default GID type that the CM 25 | + uses for each device, when initiaing new connections. 26 | + 27 | source "drivers/infiniband/hw/mthca/Kconfig" 28 | source "drivers/infiniband/hw/qib/Kconfig" 29 | source "drivers/infiniband/hw/cxgb3/Kconfig" 30 | -- 31 | 2.7.4 32 | 33 | -------------------------------------------------------------------------------- /Legacy/4.13/netvsc-don-t-print-pointer-value-in-error-message.patch: -------------------------------------------------------------------------------- 1 | From f8200b95b54950defbb32c1278a78cbde3bc782e Mon Sep 17 00:00:00 2001 2 | From: stephen hemminger 3 | Date: Fri, 28 Jul 2017 08:59:43 -0700 4 | Subject: [PATCH 47/98] netvsc: don't print pointer value in error message 5 | 6 | Using %p to print pointer to packet meta-data doesn't give any 7 | good info, and exposes kernel memory offsets. 8 | 9 | Signed-off-by: Stephen Hemminger 10 | Signed-off-by: David S. Miller 11 | --- 12 | drivers/net/hyperv/netvsc.c | 6 ++++-- 13 | 1 file changed, 4 insertions(+), 2 deletions(-) 14 | 15 | --- a/drivers/net/hyperv/netvsc.c 2017-10-05 14:20:51.715527023 -0700 16 | +++ b/drivers/net/hyperv/netvsc.c 2017-10-05 14:20:51.711526974 -0700 17 | @@ -806,8 +806,10 @@ static inline int netvsc_send_pkt( 18 | ret = -ENOSPC; 19 | } 20 | } else { 21 | - netdev_err(ndev, "Unable to send packet %p ret %d\n", 22 | - packet, ret); 23 | + netdev_err(ndev, 24 | + "Unable to send packet pages %u len %u, ret %d\n", 25 | + packet->page_buf_cnt, packet->total_data_buflen, 26 | + ret); 27 | } 28 | 29 | return ret; 30 | -------------------------------------------------------------------------------- /Legacy/4.13/netvsc-remove-unnecessary-check-for-NULL-hdr.patch: -------------------------------------------------------------------------------- 1 | From 6a1ab381b61a000a441bf78e43c3ba844fac7c06 Mon Sep 17 00:00:00 2001 2 | From: Stephen Hemminger 3 | Date: Mon, 7 Aug 2017 15:13:35 -0700 4 | Subject: [PATCH 75/98] netvsc: remove unnecessary check for NULL hdr 5 | 6 | The function init_page_array is always called with a valid pointer 7 | to RNDIS header. No check for NULL is needed. 8 | 9 | Signed-off-by: Stephen Hemminger 10 | --- 11 | drivers/net/hyperv/netvsc_drv.c | 7 +++---- 12 | 1 file changed, 3 insertions(+), 4 deletions(-) 13 | 14 | --- a/drivers/net/hyperv/netvsc_drv.c 2017-12-05 16:23:26.263807541 -0800 15 | +++ b/drivers/net/hyperv/netvsc_drv.c 2017-12-05 16:23:26.259807591 -0800 16 | @@ -337,10 +337,9 @@ static u32 init_page_array(void *hdr, u3 17 | * 2. skb linear data 18 | * 3. skb fragment data 19 | */ 20 | - if (hdr != NULL) 21 | - slots_used += fill_pg_buf(virt_to_page(hdr), 22 | - offset_in_page(hdr), 23 | - len, &pb[slots_used]); 24 | + slots_used += fill_pg_buf(virt_to_page(hdr), 25 | + offset_in_page(hdr), 26 | + len, &pb[slots_used]); 27 | 28 | packet->rmsg_size = len; 29 | packet->rmsg_pgcnt = slots_used; 30 | -------------------------------------------------------------------------------- /Legacy/4.15/0019-uio_hv_generic-use-ISR-callback-method.patch: -------------------------------------------------------------------------------- 1 | From e2a19165c2f3271bd00378b6d52cdc23d7d91b61 Mon Sep 17 00:00:00 2001 2 | From: Stephen Hemminger 3 | Date: Thu, 4 Jan 2018 14:13:31 -0800 4 | Subject: [PATCH 19/55] uio_hv_generic: use ISR callback method 5 | 6 | The UIO IRQ handler doesn't need to be called from a tasklet. 7 | 8 | Signed-off-by: Stephen Hemminger 9 | Signed-off-by: Greg Kroah-Hartman 10 | Signed-off-by: Sasha Levin 11 | --- 12 | drivers/uio/uio_hv_generic.c | 2 +- 13 | 1 file changed, 1 insertion(+), 1 deletion(-) 14 | 15 | diff --git a/drivers/uio/uio_hv_generic.c b/drivers/uio/uio_hv_generic.c 16 | index 8d5f529a1dc1..a0c4c07a907f 100644 17 | --- a/drivers/uio/uio_hv_generic.c 18 | +++ b/drivers/uio/uio_hv_generic.c 19 | @@ -109,7 +109,7 @@ hv_uio_probe(struct hv_device *dev, 20 | goto fail; 21 | 22 | dev->channel->inbound.ring_buffer->interrupt_mask = 1; 23 | - set_channel_read_mode(dev->channel, HV_CALL_DIRECT); 24 | + set_channel_read_mode(dev->channel, HV_CALL_ISR); 25 | 26 | /* Fill general uio info */ 27 | pdata->info.name = "uio_hv_generic"; 28 | -- 29 | 2.14.1 30 | 31 | -------------------------------------------------------------------------------- /Legacy/4.14/hv_netvsc-tx-table-set-weight.patch: -------------------------------------------------------------------------------- 1 | From a6fb6aa3cfa9047b62653dbcfc9bcde6e2272b41 Mon Sep 17 00:00:00 2001 2 | From: Haiyang Zhang 3 | Date: Fri, 27 Oct 2017 12:36:38 -0700 4 | Subject: hv_netvsc: Set tx_table to equal weight after subchannels open 5 | 6 | In some cases, like internal vSwitch, the host doesn't provide 7 | send indirection table updates. This patch sets the table to be 8 | equal weight after subchannels are all open. Otherwise, all workload 9 | will be on one TX channel. 10 | 11 | As tested, this patch has largely increased the throughput over 12 | internal vSwitch. 13 | 14 | Signed-off-by: Haiyang Zhang 15 | Signed-off-by: David S. Miller 16 | 17 | --- a/drivers/net/hyperv/rndis_filter.c 2018-01-19 15:09:51.687619945 -0800 18 | +++ b/drivers/net/hyperv/rndis_filter.c 2018-01-19 15:10:03.000000000 -0800 19 | @@ -1117,6 +1117,9 @@ void rndis_set_subchannel(struct work_st 20 | netif_set_real_num_tx_queues(ndev, nvdev->num_chn); 21 | netif_set_real_num_rx_queues(ndev, nvdev->num_chn); 22 | 23 | + for (i = 0; i < VRSS_SEND_TAB_SIZE; i++) 24 | + ndev_ctx->tx_table[i] = i % nvdev->num_chn; 25 | + 26 | rtnl_unlock(); 27 | return; 28 | 29 | -------------------------------------------------------------------------------- /Legacy/4.13/netvsc-fix-use-after-free-in-transparent-VF-send.patch: -------------------------------------------------------------------------------- 1 | From f49738e44d501d2e1bf4633e8dc632fda3a21f84 Mon Sep 17 00:00:00 2001 2 | From: Stephen Hemminger 3 | Date: Mon, 31 Jul 2017 20:58:52 -0700 4 | Subject: [PATCH 55/98] netvsc: fix use after free in transparent VF send 5 | 6 | This was found by KASAN and fixed before submitting upstream. 7 | --- 8 | drivers/net/hyperv/netvsc_drv.c | 3 ++- 9 | 1 file changed, 2 insertions(+), 1 deletion(-) 10 | 11 | --- a/drivers/net/hyperv/netvsc_drv.c 2017-10-05 14:20:52.535537126 -0700 12 | +++ b/drivers/net/hyperv/netvsc_drv.c 2017-10-05 14:20:52.531537077 -0700 13 | @@ -410,6 +410,7 @@ static int netvsc_vf_xmit(struct net_dev 14 | struct sk_buff *skb) 15 | { 16 | struct net_device_context *ndev_ctx = netdev_priv(net); 17 | + unsigned int len = skb->len; 18 | int rc; 19 | 20 | skb->dev = vf_netdev; 21 | @@ -422,7 +423,7 @@ static int netvsc_vf_xmit(struct net_dev 22 | 23 | u64_stats_update_begin(&pcpu_stats->syncp); 24 | pcpu_stats->tx_packets++; 25 | - pcpu_stats->tx_bytes += skb->len; 26 | + pcpu_stats->tx_bytes += len; 27 | u64_stats_update_end(&pcpu_stats->syncp); 28 | } else { 29 | this_cpu_inc(ndev_ctx->vf_stats->tx_dropped); 30 | -------------------------------------------------------------------------------- /Legacy/4.13/netvsc-force-link-update-after-MTU-change.patch: -------------------------------------------------------------------------------- 1 | From 3943206ad3f117ad0548a3dd6ac239ca5fe46064 Mon Sep 17 00:00:00 2001 2 | From: stephen hemminger 3 | Date: Wed, 19 Jul 2017 11:53:12 -0700 4 | Subject: [PATCH 30/98] netvsc: force link update after MTU change 5 | 6 | If two MTU changes are in less than update interval (2 seconds), 7 | then the netvsc network device may get stuck with no carrier. 8 | 9 | The netvsc driver debounces link status events which is fine 10 | for unsolicited updates, but blocks getting the update after 11 | down/up from MTU reinitialization. 12 | 13 | Signed-off-by: Stephen Hemminger 14 | Signed-off-by: David S. Miller 15 | --- 16 | drivers/net/hyperv/netvsc_drv.c | 1 + 17 | 1 file changed, 1 insertion(+) 18 | 19 | --- a/drivers/net/hyperv/netvsc_drv.c 2017-10-05 14:20:49.919504896 -0700 20 | +++ b/drivers/net/hyperv/netvsc_drv.c 2017-10-05 14:20:49.919504896 -0700 21 | @@ -806,6 +806,7 @@ static int netvsc_set_channels(struct ne 22 | ret = netvsc_open(net); 23 | 24 | /* We may have missed link change notifications */ 25 | + net_device_ctx->last_reconfig = 0; 26 | schedule_delayed_work(&net_device_ctx->dwork, 0); 27 | 28 | return ret; 29 | -------------------------------------------------------------------------------- /Legacy/4.15/0052-free-initmem-asynchronously.patch: -------------------------------------------------------------------------------- 1 | From 3fbb93e0ce5f78cd7bb864b0dd2d686071b2759e Mon Sep 17 00:00:00 2001 2 | From: Arjan van de Ven 3 | Date: Thu, 4 Aug 2016 18:07:50 +0000 4 | Subject: [PATCH 52/55] free initmem asynchronously 5 | 6 | Signed-off-by: Sasha Levin 7 | --- 8 | init/main.c | 9 +++++++-- 9 | 1 file changed, 7 insertions(+), 2 deletions(-) 10 | 11 | diff --git a/init/main.c b/init/main.c 12 | index a8100b954839..6f7006acca3c 100644 13 | --- a/init/main.c 14 | +++ b/init/main.c 15 | @@ -992,6 +992,12 @@ static inline void mark_readonly(void) 16 | } 17 | #endif 18 | 19 | +static void async_free_initmem(void *data, async_cookie_t cookie) 20 | +{ 21 | + free_initmem(); 22 | + mark_readonly(); 23 | +} 24 | + 25 | static int __ref kernel_init(void *unused) 26 | { 27 | int ret; 28 | @@ -1000,8 +1006,7 @@ static int __ref kernel_init(void *unused) 29 | /* need to finish all async __init code before freeing the memory */ 30 | async_synchronize_full(); 31 | ftrace_free_init_mem(); 32 | - free_initmem(); 33 | - mark_readonly(); 34 | + async_schedule(async_free_initmem, NULL); 35 | system_state = SYSTEM_RUNNING; 36 | numa_default_policy(); 37 | 38 | -- 39 | 2.14.1 40 | 41 | -------------------------------------------------------------------------------- /Legacy/4.13/hv-balloon-Show-the-max-dynamic-memory-assig.patch: -------------------------------------------------------------------------------- 1 | From eda5e15b8e4d9e1d882a05c40d6c356f52dba4fa Mon Sep 17 00:00:00 2001 2 | From: Alex Ng 3 | Date: Sun, 6 Aug 2017 13:12:54 -0700 4 | Subject: [PATCH 63/98] Drivers: hv: balloon: Show the max dynamic memory 5 | assigned 6 | 7 | Previously we were only showing max number of pages. We should make it 8 | more clear that this value is the max amount of dynamic memory that the 9 | Hyper-V host is willing to assign to this guest. 10 | 11 | Signed-off-by: Alex Ng 12 | Signed-off-by: K. Y. Srinivasan 13 | --- 14 | drivers/hv/hv_balloon.c | 4 ++-- 15 | 1 file changed, 2 insertions(+), 2 deletions(-) 16 | 17 | --- a/drivers/hv/hv_balloon.c 2017-12-05 16:23:16.983925618 -0800 18 | +++ b/drivers/hv/hv_balloon.c 2017-12-05 16:23:16.979925669 -0800 19 | @@ -1035,8 +1035,8 @@ static void process_info(struct hv_dynme 20 | if (info_hdr->data_size == sizeof(__u64)) { 21 | __u64 *max_page_count = (__u64 *)&info_hdr[1]; 22 | 23 | - pr_info("INFO_TYPE_MAX_PAGE_CNT = %llu\n", 24 | - *max_page_count); 25 | + pr_info("Max. dynamic memory size: %llu MB\n", 26 | + (*max_page_count) >> (20 - PAGE_SHIFT)); 27 | } 28 | 29 | break; 30 | -------------------------------------------------------------------------------- /Legacy/4.13/vmbus-unregister-device_obj-channels_kset.patch: -------------------------------------------------------------------------------- 1 | From fa23039ea3be9d30bc96918d8b9f95674e2da6f8 Mon Sep 17 00:00:00 2001 2 | From: Dexuan Cui 3 | Date: Mon, 13 Nov 2017 01:53:33 +0000 4 | Subject: [PATCH 07/71] vmbus: unregister device_obj->channels_kset 5 | 6 | Fixes: c2e5df616e1a ("vmbus: add per-channel sysfs info") 7 | 8 | Without the patch, a device can't be thoroughly destroyed, because 9 | vmbus_device_register() -> kset_create_and_add() still holds a reference 10 | to the hv_device's device.kobj. 11 | 12 | Signed-off-by: Dexuan Cui 13 | Cc: Stephen Hemminger 14 | Cc: K. Y. Srinivasan 15 | --- 16 | drivers/hv/vmbus_drv.c | 2 ++ 17 | 1 file changed, 2 insertions(+) 18 | 19 | --- a/drivers/hv/vmbus_drv.c 2017-11-17 09:03:33.842929928 -0800 20 | +++ b/drivers/hv/vmbus_drv.c 2017-11-17 09:03:33.838929982 -0800 21 | @@ -1358,6 +1358,8 @@ void vmbus_device_unregister(struct hv_d 22 | pr_debug("child device %s unregistered\n", 23 | dev_name(&device_obj->device)); 24 | 25 | + kset_unregister(device_obj->channels_kset); 26 | + 27 | /* 28 | * Kick off the process of unregistering the device. 29 | * This will call vmbus_remove() and eventually vmbus_device_release() 30 | -------------------------------------------------------------------------------- /Legacy/4.14/vmbus-unregister-device_obj-channels_kset.patch: -------------------------------------------------------------------------------- 1 | From fa23039ea3be9d30bc96918d8b9f95674e2da6f8 Mon Sep 17 00:00:00 2001 2 | From: Dexuan Cui 3 | Date: Mon, 13 Nov 2017 01:53:33 +0000 4 | Subject: [PATCH 07/71] vmbus: unregister device_obj->channels_kset 5 | 6 | Fixes: c2e5df616e1a ("vmbus: add per-channel sysfs info") 7 | 8 | Without the patch, a device can't be thoroughly destroyed, because 9 | vmbus_device_register() -> kset_create_and_add() still holds a reference 10 | to the hv_device's device.kobj. 11 | 12 | Signed-off-by: Dexuan Cui 13 | Cc: Stephen Hemminger 14 | Cc: K. Y. Srinivasan 15 | --- 16 | drivers/hv/vmbus_drv.c | 2 ++ 17 | 1 file changed, 2 insertions(+) 18 | 19 | --- a/drivers/hv/vmbus_drv.c 2017-12-06 14:45:46.575550380 -0800 20 | +++ b/drivers/hv/vmbus_drv.c 2017-12-06 14:45:46.571550431 -0800 21 | @@ -1358,6 +1358,8 @@ void vmbus_device_unregister(struct hv_d 22 | pr_debug("child device %s unregistered\n", 23 | dev_name(&device_obj->device)); 24 | 25 | + kset_unregister(device_obj->channels_kset); 26 | + 27 | /* 28 | * Kick off the process of unregistering the device. 29 | * This will call vmbus_remove() and eventually vmbus_device_release() 30 | -------------------------------------------------------------------------------- /Legacy/4.13/netvsc-fix-error-unwind-on-device-setup-failure.patch: -------------------------------------------------------------------------------- 1 | From f9a094c19734bd8e87e2c6118c9f21ef78be8f1e Mon Sep 17 00:00:00 2001 2 | From: stephen hemminger 3 | Date: Fri, 28 Jul 2017 08:59:46 -0700 4 | Subject: [PATCH 50/98] netvsc: fix error unwind on device setup failure 5 | 6 | If setting receive buffer fails, the error unwind would cause 7 | kernel panic because it was not correctly doing RCU and NAPI 8 | unwind. RCU'd pointer needs to be reset to NULL, and NAPI needs 9 | to be disabled not deleted. 10 | 11 | Signed-off-by: Stephen Hemminger 12 | Signed-off-by: David S. Miller 13 | --- 14 | drivers/net/hyperv/netvsc.c | 3 ++- 15 | 1 file changed, 2 insertions(+), 1 deletion(-) 16 | 17 | --- a/drivers/net/hyperv/netvsc.c 2017-12-05 16:22:34.968460237 -0800 18 | +++ b/drivers/net/hyperv/netvsc.c 2017-12-05 16:22:34.964460287 -0800 19 | @@ -1302,7 +1302,8 @@ struct netvsc_device *netvsc_device_add( 20 | return net_device; 21 | 22 | close: 23 | - netif_napi_del(&net_device->chan_table[0].napi); 24 | + RCU_INIT_POINTER(net_device_ctx->nvdev, NULL); 25 | + napi_disable(&net_device->chan_table[0].napi); 26 | 27 | /* Now, we can close the channel safely */ 28 | vmbus_close(device->channel); 29 | -------------------------------------------------------------------------------- /Patches_Following_Mainline_History/4.4.211/0361-net-mlx4-remove-unused-array-zero_gid.patch: -------------------------------------------------------------------------------- 1 | From b354fc81c9cb375efe11de28b1df960681364f35 Mon Sep 17 00:00:00 2001 2 | From: Colin Ian King 3 | Date: Sun, 20 Mar 2016 17:44:56 +0000 4 | Subject: net/mlx4: remove unused array zero_gid[] 5 | Reply-To: joseph.salisbury@microsoft.com 6 | 7 | zero_gid is not used, so remove this redundant array. 8 | 9 | Signed-off-by: Colin Ian King 10 | Signed-off-by: David S. Miller 11 | (cherry picked from commit 5a779c4feda5d52e0f19e48af71b75dd1032a5b8) 12 | Signed-off-by: Joseph Salisbury 13 | --- 14 | drivers/net/ethernet/mellanox/mlx4/mcg.c | 2 -- 15 | 1 file changed, 2 deletions(-) 16 | 17 | diff --git a/drivers/net/ethernet/mellanox/mlx4/mcg.c b/drivers/net/ethernet/mellanox/mlx4/mcg.c 18 | index 0e05adcd72d8..536240b1f5a6 100644 19 | --- a/drivers/net/ethernet/mellanox/mlx4/mcg.c 20 | +++ b/drivers/net/ethernet/mellanox/mlx4/mcg.c 21 | @@ -40,8 +40,6 @@ 22 | 23 | #include "mlx4.h" 24 | 25 | -static const u8 zero_gid[16]; /* automatically initialized to 0 */ 26 | - 27 | int mlx4_get_mgm_entry_size(struct mlx4_dev *dev) 28 | { 29 | return 1 << dev->oper_log_mgm_entry_size; 30 | -- 31 | 2.17.1 32 | 33 | -------------------------------------------------------------------------------- /Legacy/4.13/hv_netvsc-replace-divide-with-mask-when-computing-pa.patch: -------------------------------------------------------------------------------- 1 | From af18a25118e8bcea959e3bec41a33828cc156fed Mon Sep 17 00:00:00 2001 2 | From: Stephen Hemminger 3 | Date: Thu, 5 Oct 2017 09:45:07 -0700 4 | Subject: [PATCH 134/156] hv_netvsc: replace divide with mask when computing 5 | padding 6 | 7 | Packet alignment is always a power of 2 therefore modulus can 8 | be replaced with a faster and operation 9 | 10 | Signed-off-by: Stephen Hemminger 11 | --- 12 | drivers/net/hyperv/netvsc.c | 3 ++- 13 | 1 file changed, 2 insertions(+), 1 deletion(-) 14 | 15 | --- a/drivers/net/hyperv/netvsc.c 2017-12-05 16:55:52.718593207 -0800 16 | +++ b/drivers/net/hyperv/netvsc.c 2017-12-05 16:55:52.714593258 -0800 17 | @@ -712,11 +712,12 @@ static void netvsc_copy_to_send_buf(stru 18 | + pend_size; 19 | int i; 20 | u32 padding = 0; 21 | - u32 remain = packet->total_data_buflen % net_device->pkt_align; 22 | u32 page_count = packet->cp_partial ? packet->rmsg_pgcnt : 23 | packet->page_buf_cnt; 24 | + u32 remain; 25 | 26 | /* Add padding */ 27 | + remain = packet->total_data_buflen & (net_device->pkt_align - 1); 28 | if (skb->xmit_more && remain && !packet->cp_partial) { 29 | padding = net_device->pkt_align - remain; 30 | rndis_msg->msg_len += padding; 31 | -------------------------------------------------------------------------------- /Legacy/4.14/hv_netvsc-replace-divide-with-mask-when-computing-pa.patch: -------------------------------------------------------------------------------- 1 | From 7b424978d1ed668a9b6afc559789eead049d9271 Mon Sep 17 00:00:00 2001 2 | From: Stephen Hemminger 3 | Date: Thu, 5 Oct 2017 09:45:07 -0700 4 | Subject: [PATCH 38/71] hv_netvsc: replace divide with mask when computing 5 | padding 6 | 7 | Packet alignment is always a power of 2 therefore modulus can 8 | be replaced with a faster and operation 9 | 10 | Signed-off-by: Stephen Hemminger 11 | --- 12 | drivers/net/hyperv/netvsc.c | 3 ++- 13 | 1 file changed, 2 insertions(+), 1 deletion(-) 14 | 15 | --- a/drivers/net/hyperv/netvsc.c 2018-01-19 15:22:37.249360193 -0800 16 | +++ b/drivers/net/hyperv/netvsc.c 2018-01-19 15:22:37.245360246 -0800 17 | @@ -708,11 +708,12 @@ static void netvsc_copy_to_send_buf(stru 18 | + pend_size; 19 | int i; 20 | u32 padding = 0; 21 | - u32 remain = packet->total_data_buflen % net_device->pkt_align; 22 | u32 page_count = packet->cp_partial ? packet->rmsg_pgcnt : 23 | packet->page_buf_cnt; 24 | + u32 remain; 25 | 26 | /* Add padding */ 27 | + remain = packet->total_data_buflen & (net_device->pkt_align - 1); 28 | if (skb->xmit_more && remain && !packet->cp_partial) { 29 | padding = net_device->pkt_align - remain; 30 | rndis_msg->msg_len += padding; 31 | -------------------------------------------------------------------------------- /Legacy/4.13/netvsc-fix-ptr_ret.cocci-warnings.patch: -------------------------------------------------------------------------------- 1 | From 10197cc7959081f4cea9bf323b8631f4414bb4dc Mon Sep 17 00:00:00 2001 2 | From: Wu Fengguang 3 | Date: Sat, 22 Jul 2017 02:54:43 +0800 4 | Subject: [PATCH 38/98] netvsc: fix ptr_ret.cocci warnings 5 | 6 | drivers/net/hyperv/netvsc_drv.c:737:8-14: WARNING: PTR_ERR_OR_ZERO can be used 7 | 8 | Use PTR_ERR_OR_ZERO rather than if(IS_ERR(...)) + PTR_ERR 9 | 10 | Generated by: scripts/coccinelle/api/ptr_ret.cocci 11 | 12 | Fixes: 9749fed5d43d ("netvsc: use ERR_PTR to avoid dereference issues") 13 | CC: stephen hemminger 14 | Signed-off-by: Fengguang Wu 15 | Signed-off-by: David S. Miller 16 | --- 17 | drivers/net/hyperv/netvsc_drv.c | 2 +- 18 | 1 file changed, 1 insertion(+), 1 deletion(-) 19 | 20 | --- a/drivers/net/hyperv/netvsc_drv.c 2017-10-05 14:20:50.799515738 -0700 21 | +++ b/drivers/net/hyperv/netvsc_drv.c 2017-10-05 14:20:50.799515738 -0700 22 | @@ -757,7 +757,7 @@ static int netvsc_set_queues(struct net_ 23 | return ret; 24 | 25 | net_device = rndis_filter_device_add(dev, &device_info); 26 | - return IS_ERR(net_device) ? PTR_ERR(net_device) : 0; 27 | + return PTR_ERR_OR_ZERO(net_device); 28 | } 29 | 30 | static int netvsc_set_channels(struct net_device *net, 31 | -------------------------------------------------------------------------------- /Patches_Following_Mainline_History/4.4.211/0455-IB-core-Make-all-casts-in-ib_device_cap_flags-enum-c.patch: -------------------------------------------------------------------------------- 1 | From fd58a58c122a62d3a4d61f2ba59f366e7e2267ee Mon Sep 17 00:00:00 2001 2 | From: Max Gurtovoy 3 | Date: Mon, 6 Jun 2016 19:34:40 +0300 4 | Subject: IB/core: Make all casts in ib_device_cap_flags enum consistent 5 | Reply-To: joseph.salisbury@microsoft.com 6 | 7 | Replace the few u64 casts with ULL to match the rest of the casts. 8 | 9 | Signed-off-by: Max Gurtovoy 10 | Signed-off-by: Doug Ledford 11 | (backported from commit c7e162a417488f3c79eb09f3c4f1d36f1e042463) 12 | Signed-off-by: Joseph Salisbury 13 | --- 14 | include/rdma/ib_verbs.h | 2 ++ 15 | 1 file changed, 2 insertions(+) 16 | 17 | diff --git a/include/rdma/ib_verbs.h b/include/rdma/ib_verbs.h 18 | index d943b49e4e9c..e8a6afb858d3 100644 19 | --- a/include/rdma/ib_verbs.h 20 | +++ b/include/rdma/ib_verbs.h 21 | @@ -204,6 +204,8 @@ enum ib_device_cap_flags { 22 | IB_DEVICE_SIGNATURE_HANDOVER = (1 << 30), 23 | IB_DEVICE_ON_DEMAND_PAGING = (1 << 31), 24 | IB_DEVICE_SG_GAPS_REG = (1ULL << 32), 25 | + IB_DEVICE_VIRTUAL_FUNCTION = (1ULL << 33), 26 | + IB_DEVICE_RAW_SCATTER_FCS = (1ULL << 34), 27 | }; 28 | 29 | enum ib_signature_prot_cap { 30 | -- 31 | 2.17.1 32 | 33 | -------------------------------------------------------------------------------- /Legacy/4.13/hv_netvsc-Clean-up-unused-parameter-from-netvsc_get_rss_hash_opts.patch: -------------------------------------------------------------------------------- 1 | From 3da79d5f068980492874b6ebcb96333a1653c931 Mon Sep 17 00:00:00 2001 2 | From: Haiyang Zhang 3 | Date: Mon, 21 Aug 2017 19:22:38 -0700 4 | Subject: [PATCH 81/98] hv_netvsc: Clean up unused parameter from 5 | netvsc_get_rss_hash_opts() 6 | 7 | The parameter "nvdev" is not in use. 8 | 9 | Signed-off-by: Haiyang Zhang 10 | Signed-off-by: David S. Miller 11 | --- 12 | drivers/net/hyperv/netvsc_drv.c | 5 ++--- 13 | 1 file changed, 2 insertions(+), 3 deletions(-) 14 | 15 | --- a/drivers/net/hyperv/netvsc_drv.c 2017-12-05 16:23:31.731737967 -0800 16 | +++ b/drivers/net/hyperv/netvsc_drv.c 2017-12-05 16:23:31.727738019 -0800 17 | @@ -1228,8 +1228,7 @@ static void netvsc_get_strings(struct ne 18 | } 19 | 20 | static int 21 | -netvsc_get_rss_hash_opts(struct netvsc_device *nvdev, 22 | - struct ethtool_rxnfc *info) 23 | +netvsc_get_rss_hash_opts(struct ethtool_rxnfc *info) 24 | { 25 | info->data = RXH_IP_SRC | RXH_IP_DST; 26 | 27 | @@ -1267,7 +1266,7 @@ netvsc_get_rxnfc(struct net_device *dev, 28 | return 0; 29 | 30 | case ETHTOOL_GRXFH: 31 | - return netvsc_get_rss_hash_opts(nvdev, info); 32 | + return netvsc_get_rss_hash_opts(info); 33 | } 34 | return -EOPNOTSUPP; 35 | } 36 | -------------------------------------------------------------------------------- /Legacy/4.13/vmbus-add-prefetch-to-ring-buffer-iterator.patch: -------------------------------------------------------------------------------- 1 | From dee8a34f4a2faab3061faa05f1ecdc3bf16b63b6 Mon Sep 17 00:00:00 2001 2 | From: Stephen Hemminger 3 | Date: Wed, 19 Apr 2017 08:44:13 -0700 4 | Subject: [PATCH 09/98] vmbus: add prefetch to ring buffer iterator 5 | 6 | When iterating over incoming ring elements from the host, prefetch 7 | the next descriptor so that it is cache hot. 8 | 9 | Signed-off-by: Stephen Hemminger 10 | --- 11 | drivers/hv/ring_buffer.c | 7 ++++++- 12 | 1 file changed, 6 insertions(+), 1 deletion(-) 13 | 14 | --- a/drivers/hv/ring_buffer.c 2017-12-05 16:31:34.241429802 -0800 15 | +++ b/drivers/hv/ring_buffer.c 2017-12-05 16:31:42.565321237 -0800 16 | @@ -357,11 +357,15 @@ static u32 hv_pkt_iter_avail(const struc 17 | struct vmpacket_descriptor *hv_pkt_iter_first(struct vmbus_channel *channel) 18 | { 19 | struct hv_ring_buffer_info *rbi = &channel->inbound; 20 | + struct vmpacket_descriptor *desc; 21 | 22 | if (hv_pkt_iter_avail(rbi) < sizeof(struct vmpacket_descriptor)) 23 | return NULL; 24 | 25 | - return hv_get_ring_buffer(rbi) + rbi->priv_read_index; 26 | + desc = hv_get_ring_buffer(rbi) + rbi->priv_read_index; 27 | + prefetch((char *)desc + (desc->len8 << 3)); 28 | + 29 | + return desc; 30 | } 31 | EXPORT_SYMBOL_GPL(hv_pkt_iter_first); 32 | 33 | -------------------------------------------------------------------------------- /Legacy/4.13/netvsc-include-rtnetlink.h.patch: -------------------------------------------------------------------------------- 1 | From 70907ff44dc835283028533267055ee5b95720b1 Mon Sep 17 00:00:00 2001 2 | From: stephen hemminger 3 | Date: Mon, 24 Jul 2017 10:57:29 -0700 4 | Subject: [PATCH 43/98] netvsc: include rtnetlink.h 5 | 6 | Since these files use rtnl_derefernce make sure and include rtnetlink.h 7 | 8 | Signed-off-by: Stephen Hemminger 9 | Signed-off-by: David S. Miller 10 | --- 11 | drivers/net/hyperv/netvsc_drv.c | 2 ++ 12 | drivers/net/hyperv/rndis_filter.c | 1 + 13 | 2 files changed, 3 insertions(+) 14 | 15 | --- a/drivers/net/hyperv/netvsc_drv.c 2017-10-05 14:20:51.299521898 -0700 16 | +++ b/drivers/net/hyperv/netvsc_drv.c 2017-10-05 14:20:51.295521849 -0700 17 | @@ -33,6 +33,8 @@ 18 | #include 19 | #include 20 | #include 21 | +#include 22 | + 23 | #include 24 | #include 25 | #include 26 | --- a/drivers/net/hyperv/rndis_filter.c 2017-10-05 14:20:51.299521898 -0700 27 | +++ b/drivers/net/hyperv/rndis_filter.c 2017-10-05 14:20:51.295521849 -0700 28 | @@ -28,6 +28,7 @@ 29 | #include 30 | #include 31 | #include 32 | +#include 33 | 34 | #include "hyperv_net.h" 35 | 36 | -------------------------------------------------------------------------------- /Patches_Following_Mainline_History/4.4.211/0585-net-mlx5-Update-struct-mlx5_ifc_xrqc_bits.patch: -------------------------------------------------------------------------------- 1 | From bd0ccb159b686e14efc66f2a9ab80823c6561d39 Mon Sep 17 00:00:00 2001 2 | From: Artemy Kovalyov 3 | Date: Sun, 3 Jul 2016 14:57:33 +0300 4 | Subject: net/mlx5: Update struct mlx5_ifc_xrqc_bits 5 | Reply-To: joseph.salisbury@microsoft.com 6 | 7 | Update struct mlx5_ifc_xrqc_bits according to last specification 8 | 9 | Signed-off-by: Artemy Kovalyov 10 | Signed-off-by: Saeed Mahameed 11 | Signed-off-by: Leon Romanovsky 12 | (cherry picked from commit 2e353b3468ecb1d12a44aaf35888f7de47d5c047) 13 | Signed-off-by: Joseph Salisbury 14 | --- 15 | include/linux/mlx5/mlx5_ifc.h | 2 +- 16 | 1 file changed, 1 insertion(+), 1 deletion(-) 17 | 18 | diff --git a/include/linux/mlx5/mlx5_ifc.h b/include/linux/mlx5/mlx5_ifc.h 19 | index 038dd2b6e7af..3aaeddfb5455 100644 20 | --- a/include/linux/mlx5/mlx5_ifc.h 21 | +++ b/include/linux/mlx5/mlx5_ifc.h 22 | @@ -2828,7 +2828,7 @@ struct mlx5_ifc_xrqc_bits { 23 | 24 | struct mlx5_ifc_tag_matching_topology_context_bits tag_matching_topology_context; 25 | 26 | - u8 reserved_at_180[0x180]; 27 | + u8 reserved_at_180[0x200]; 28 | 29 | struct mlx5_ifc_wq_bits wq; 30 | }; 31 | -- 32 | 2.17.1 33 | 34 | -------------------------------------------------------------------------------- /Legacy/4.13/hv-kvp-Use-MAX_ADAPTER_ID_SIZE-for-translati.patch: -------------------------------------------------------------------------------- 1 | From fba513bdc29e73169e9d6fa0cc918732a596b279 Mon Sep 17 00:00:00 2001 2 | From: Alex Ng 3 | Date: Sun, 6 Aug 2017 13:12:56 -0700 4 | Subject: [PATCH 65/98] Drivers: hv: kvp: Use MAX_ADAPTER_ID_SIZE for 5 | translating adapter id 6 | 7 | There's a bug which passes the output buffer size as MAX_IP_ADDR_SIZE, 8 | when converting the adapter_id field to UTF16. This is much larger than 9 | the actual size (MAX_ADAPTER_ID_SIZE). Fix this by passing the proper 10 | size. 11 | 12 | Fortunately, the translation is limited by the length of the input. This 13 | explains why we haven't seen output buffer overflow conditions. 14 | 15 | Signed-off-by: Alex Ng 16 | Signed-off-by: K. Y. Srinivasan 17 | --- 18 | drivers/hv/hv_kvp.c | 2 +- 19 | 1 file changed, 1 insertion(+), 1 deletion(-) 20 | 21 | --- a/drivers/hv/hv_kvp.c 2017-12-05 16:23:18.467906736 -0800 22 | +++ b/drivers/hv/hv_kvp.c 2017-12-05 16:23:18.463906786 -0800 23 | @@ -304,7 +304,7 @@ static int process_ob_ipinfo(void *in_ms 24 | strlen((char *)in->body.kvp_ip_val.adapter_id), 25 | UTF16_HOST_ENDIAN, 26 | (wchar_t *)out->kvp_ip_val.adapter_id, 27 | - MAX_IP_ADDR_SIZE); 28 | + MAX_ADAPTER_ID_SIZE); 29 | if (len < 0) 30 | return len; 31 | 32 | -------------------------------------------------------------------------------- /Legacy/4.14/hv_netvsc-hide-warnings-about-rndis-device.patch: -------------------------------------------------------------------------------- 1 | From b5eb819dcbcbeca7a047573a5218cb8f703709c9 Mon Sep 17 00:00:00 2001 2 | From: Vitaly Kuznetsov 3 | Date: Thu, 2 Nov 2017 11:35:31 +0100 4 | Subject: hv_netvsc: hide warnings about uninitialized/missing rndis device 5 | 6 | Hyper-V hosts are known to send RNDIS messages even after we halt the 7 | device in rndis_filter_halt_device(). Remove user visible messages 8 | as they are not really useful. 9 | 10 | Signed-off-by: Vitaly Kuznetsov 11 | Signed-off-by: David S. Miller 12 | 13 | --- a/drivers/net/hyperv/rndis_filter.c 2018-01-19 15:09:51.711619636 -0800 14 | +++ b/drivers/net/hyperv/rndis_filter.c 2018-01-19 15:10:01.000000000 -0800 15 | @@ -410,13 +410,13 @@ int rndis_filter_receive(struct net_devi 16 | 17 | /* Make sure the rndis device state is initialized */ 18 | if (unlikely(!rndis_dev)) { 19 | - netif_err(net_device_ctx, rx_err, ndev, 20 | + netif_dbg(net_device_ctx, rx_err, ndev, 21 | "got rndis message but no rndis device!\n"); 22 | return NVSP_STAT_FAIL; 23 | } 24 | 25 | if (unlikely(rndis_dev->state == RNDIS_DEV_UNINITIALIZED)) { 26 | - netif_err(net_device_ctx, rx_err, ndev, 27 | + netif_dbg(net_device_ctx, rx_err, ndev, 28 | "got rndis message uninitialized\n"); 29 | return NVSP_STAT_FAIL; 30 | } 31 | -------------------------------------------------------------------------------- /Patches_Following_Mainline_History/4.4.211/0265-cpu-hotplug-Remove-redundant-state-check.patch: -------------------------------------------------------------------------------- 1 | From fd4163ef79400fdfdf23f3c6f32b1aa413f1e0b9 Mon Sep 17 00:00:00 2001 2 | From: Thomas Gleixner 3 | Date: Thu, 3 Mar 2016 12:24:10 +0100 4 | Subject: cpu/hotplug: Remove redundant state check 5 | Reply-To: joseph.salisbury@microsoft.com 6 | 7 | The check for the AP range in cpuhp_is_ap_state() is redundant after commit 8 | 8df3e07e7f21 "cpu/hotplug: Let upcoming cpu bring itself fully up" because all 9 | states above CPUHP_BRINGUP_CPU are invoked on the hotplugged cpu. Remove it. 10 | 11 | Reported-by: Richard Cochran 12 | Signed-off-by: Thomas Gleixner 13 | (cherry picked from commit 5d8eb84253333f8f63ec704276e3f0a8ec8f3189) 14 | Signed-off-by: Joseph Salisbury 15 | --- 16 | kernel/cpu.c | 2 -- 17 | 1 file changed, 2 deletions(-) 18 | 19 | diff --git a/kernel/cpu.c b/kernel/cpu.c 20 | index de4c3277f7d6..d0fb7e080a6f 100644 21 | --- a/kernel/cpu.c 22 | +++ b/kernel/cpu.c 23 | @@ -1238,8 +1238,6 @@ static int cpuhp_cb_check(enum cpuhp_state state) 24 | 25 | static bool cpuhp_is_ap_state(enum cpuhp_state state) 26 | { 27 | - if (state >= CPUHP_AP_OFFLINE && state <= CPUHP_AP_ONLINE) 28 | - return true; 29 | return state > CPUHP_BRINGUP_CPU; 30 | } 31 | 32 | -- 33 | 2.17.1 34 | 35 | -------------------------------------------------------------------------------- /Legacy/4.13/hv_netvsc-don-t-need-local-xmit_more.patch: -------------------------------------------------------------------------------- 1 | From ba5fc0aecf7206e3fcf0b39bc76e828df2c5ddf5 Mon Sep 17 00:00:00 2001 2 | From: Stephen Hemminger 3 | Date: Thu, 5 Oct 2017 09:43:28 -0700 4 | Subject: [PATCH 133/156] hv_netvsc: don't need local xmit_more 5 | 6 | Since skb is always non-NULL in the copy portion of netvsc_send 7 | do not need local variable. 8 | 9 | Signed-off-by: Stephen Hemminger 10 | --- 11 | drivers/net/hyperv/netvsc.c | 3 +-- 12 | 1 file changed, 1 insertion(+), 2 deletions(-) 13 | 14 | --- a/drivers/net/hyperv/netvsc.c 2017-12-05 16:55:52.526595671 -0800 15 | +++ b/drivers/net/hyperv/netvsc.c 2017-12-05 16:55:52.522595723 -0800 16 | @@ -847,7 +847,6 @@ int netvsc_send(struct net_device *ndev, 17 | struct hv_netvsc_packet *msd_send = NULL, *cur_send = NULL; 18 | struct sk_buff *msd_skb = NULL; 19 | bool try_batch; 20 | - bool xmit_more = (skb != NULL) ? skb->xmit_more : false; 21 | 22 | /* If device is rescinded, return error and packet will get dropped. */ 23 | if (unlikely(!net_device || net_device->destroy)) 24 | @@ -922,7 +921,7 @@ int netvsc_send(struct net_device *ndev, 25 | if (msdp->skb) 26 | dev_consume_skb_any(msdp->skb); 27 | 28 | - if (xmit_more && !packet->cp_partial) { 29 | + if (skb->xmit_more && !packet->cp_partial) { 30 | msdp->skb = skb; 31 | msdp->pkt = packet; 32 | msdp->count++; 33 | -------------------------------------------------------------------------------- /Legacy/4.14/hv_netvsc-don-t-need-local-xmit_more.patch: -------------------------------------------------------------------------------- 1 | From a788e5410ae7a0cb7d10c2b52f6190ff5fc7d083 Mon Sep 17 00:00:00 2001 2 | From: Stephen Hemminger 3 | Date: Thu, 5 Oct 2017 09:43:28 -0700 4 | Subject: [PATCH 37/71] hv_netvsc: don't need local xmit_more 5 | 6 | Since skb is always non-NULL in the copy portion of netvsc_send 7 | do not need local variable. 8 | 9 | Signed-off-by: Stephen Hemminger 10 | --- 11 | drivers/net/hyperv/netvsc.c | 3 +-- 12 | 1 file changed, 1 insertion(+), 2 deletions(-) 13 | 14 | --- a/drivers/net/hyperv/netvsc.c 2018-01-19 15:22:36.293372965 -0800 15 | +++ b/drivers/net/hyperv/netvsc.c 2018-01-19 15:22:36.289373018 -0800 16 | @@ -839,7 +839,6 @@ int netvsc_send(struct net_device_contex 17 | struct hv_netvsc_packet *msd_send = NULL, *cur_send = NULL; 18 | struct sk_buff *msd_skb = NULL; 19 | bool try_batch; 20 | - bool xmit_more = (skb != NULL) ? skb->xmit_more : false; 21 | 22 | /* If device is rescinded, return error and packet will get dropped. */ 23 | if (unlikely(!net_device || net_device->destroy)) 24 | @@ -913,7 +912,7 @@ int netvsc_send(struct net_device_contex 25 | if (msdp->skb) 26 | dev_consume_skb_any(msdp->skb); 27 | 28 | - if (xmit_more && !packet->cp_partial) { 29 | + if (skb->xmit_more && !packet->cp_partial) { 30 | msdp->skb = skb; 31 | msdp->pkt = packet; 32 | msdp->count++; 33 | -------------------------------------------------------------------------------- /Patches_Following_Mainline_History/4.4.211/0384-net-mlx5e-Remove-redundant-barrier.patch: -------------------------------------------------------------------------------- 1 | From eae1feb0e4d98eb5a9357ed107b9811e97302835 Mon Sep 17 00:00:00 2001 2 | From: Tariq Toukan 3 | Date: Wed, 20 Apr 2016 22:02:17 +0300 4 | Subject: net/mlx5e: Remove redundant barrier 5 | Reply-To: joseph.salisbury@microsoft.com 6 | 7 | The bit-op operation one line before is an explicit barrier 8 | by itself. 9 | 10 | Signed-off-by: Tariq Toukan 11 | Signed-off-by: Saeed Mahameed 12 | Signed-off-by: David S. Miller 13 | (cherry picked from commit 1bfec31627bf9b351b93b8cef4520b90f48ca276) 14 | Signed-off-by: Joseph Salisbury 15 | --- 16 | drivers/net/ethernet/mellanox/mlx5/core/en_txrx.c | 1 - 17 | 1 file changed, 1 deletion(-) 18 | 19 | diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en_txrx.c b/drivers/net/ethernet/mellanox/mlx5/core/en_txrx.c 20 | index a3fd0f55ce2e..c38781fa567d 100644 21 | --- a/drivers/net/ethernet/mellanox/mlx5/core/en_txrx.c 22 | +++ b/drivers/net/ethernet/mellanox/mlx5/core/en_txrx.c 23 | @@ -147,7 +147,6 @@ void mlx5e_completion_event(struct mlx5_core_cq *mcq) 24 | struct mlx5e_cq *cq = container_of(mcq, struct mlx5e_cq, mcq); 25 | 26 | set_bit(MLX5E_CHANNEL_NAPI_SCHED, &cq->channel->flags); 27 | - barrier(); 28 | napi_schedule(cq->napi); 29 | } 30 | 31 | -- 32 | 2.17.1 33 | 34 | -------------------------------------------------------------------------------- /Patches_Following_Mainline_History/4.4.211/0046-mlxsw-core-Change-BUG-to-WARN-in-hwmon-code.patch: -------------------------------------------------------------------------------- 1 | From 6668cf2d4333bff71a44fa42ee40243b370f10c2 Mon Sep 17 00:00:00 2001 2 | From: Jiri Pirko 3 | Date: Thu, 3 Dec 2015 10:12:03 +0100 4 | Subject: mlxsw: core: Change BUG to WARN in hwmon code 5 | Reply-To: joseph.salisbury@microsoft.com 6 | 7 | Better to just warn the user that something really odd is going on and 8 | continue to run. 9 | 10 | Suggested-by: Or Gerlitz 11 | Signed-off-by: Jiri Pirko 12 | Signed-off-by: David S. Miller 13 | (cherry picked from commit 6b20da4d8f3f6a3be9f67e3207f435cfaa5f7f97) 14 | Signed-off-by: Joseph Salisbury 15 | --- 16 | drivers/net/ethernet/mellanox/mlxsw/core_hwmon.c | 2 +- 17 | 1 file changed, 1 insertion(+), 1 deletion(-) 18 | 19 | diff --git a/drivers/net/ethernet/mellanox/mlxsw/core_hwmon.c b/drivers/net/ethernet/mellanox/mlxsw/core_hwmon.c 20 | index ad8b27418a7f..4dad146b41ae 100644 21 | --- a/drivers/net/ethernet/mellanox/mlxsw/core_hwmon.c 22 | +++ b/drivers/net/ethernet/mellanox/mlxsw/core_hwmon.c 23 | @@ -215,7 +215,7 @@ static void mlxsw_hwmon_attr_add(struct mlxsw_hwmon *mlxsw_hwmon, 24 | "pwm%u", num + 1); 25 | break; 26 | default: 27 | - BUG(); 28 | + WARN_ON(1); 29 | } 30 | 31 | mlxsw_hwmon_attr->type_index = type_index; 32 | -- 33 | 2.17.1 34 | 35 | -------------------------------------------------------------------------------- /Patches_Following_Mainline_History/4.4.211/0053-mlxsw-core-remove-an-unneeded-condition.patch: -------------------------------------------------------------------------------- 1 | From 7c4f380ff2a957e76123de6909cfd89495d3819c Mon Sep 17 00:00:00 2001 2 | From: Dan Carpenter 3 | Date: Wed, 9 Dec 2015 13:41:29 +0300 4 | Subject: mlxsw: core: remove an unneeded condition 5 | Reply-To: joseph.salisbury@microsoft.com 6 | 7 | We already know "err" is zero so there is no need to check. 8 | 9 | Signed-off-by: Dan Carpenter 10 | Acked-by: Jiri Pirko 11 | Signed-off-by: David S. Miller 12 | (cherry picked from commit 515123e286b686d32256342318f20ff932ebac1b) 13 | Signed-off-by: Joseph Salisbury 14 | --- 15 | drivers/net/ethernet/mellanox/mlxsw/core_hwmon.c | 2 +- 16 | 1 file changed, 1 insertion(+), 1 deletion(-) 17 | 18 | diff --git a/drivers/net/ethernet/mellanox/mlxsw/core_hwmon.c b/drivers/net/ethernet/mellanox/mlxsw/core_hwmon.c 19 | index 4dad146b41ae..913106d37bb0 100644 20 | --- a/drivers/net/ethernet/mellanox/mlxsw/core_hwmon.c 21 | +++ b/drivers/net/ethernet/mellanox/mlxsw/core_hwmon.c 22 | @@ -169,7 +169,7 @@ static ssize_t mlxsw_hwmon_pwm_store(struct device *dev, 23 | dev_err(mlxsw_hwmon->bus_info->dev, "Failed to write PWM\n"); 24 | return err; 25 | } 26 | - return err ? err : len; 27 | + return len; 28 | } 29 | 30 | enum mlxsw_hwmon_attr_type { 31 | -- 32 | 2.17.1 33 | 34 | -------------------------------------------------------------------------------- /Patches_Following_Mainline_History/4.4.211/0458-net-mlx5-Update-command-strings.patch: -------------------------------------------------------------------------------- 1 | From 0e68a3134de17fdda69c1cf50987984435a3cbd1 Mon Sep 17 00:00:00 2001 2 | From: Eli Cohen 3 | Date: Mon, 27 Jun 2016 12:08:32 +0300 4 | Subject: net/mlx5: Update command strings 5 | Reply-To: joseph.salisbury@microsoft.com 6 | 7 | Add command string for MODIFY_FLOW_TABLE which is used by the driver. 8 | 9 | Signed-off-by: Eli Cohen 10 | Signed-off-by: Saeed Mahameed 11 | Signed-off-by: David S. Miller 12 | (cherry picked from commit 5be1ea899da4f11de92897d2ea706e0820609b9e) 13 | Signed-off-by: Joseph Salisbury 14 | --- 15 | drivers/net/ethernet/mellanox/mlx5/core/cmd.c | 1 + 16 | 1 file changed, 1 insertion(+) 17 | 18 | diff --git a/drivers/net/ethernet/mellanox/mlx5/core/cmd.c b/drivers/net/ethernet/mellanox/mlx5/core/cmd.c 19 | index 7e19c5734471..42672e554c6f 100644 20 | --- a/drivers/net/ethernet/mellanox/mlx5/core/cmd.c 21 | +++ b/drivers/net/ethernet/mellanox/mlx5/core/cmd.c 22 | @@ -559,6 +559,7 @@ const char *mlx5_command_str(int command) 23 | MLX5_COMMAND_STR_CASE(ALLOC_FLOW_COUNTER); 24 | MLX5_COMMAND_STR_CASE(DEALLOC_FLOW_COUNTER); 25 | MLX5_COMMAND_STR_CASE(QUERY_FLOW_COUNTER); 26 | + MLX5_COMMAND_STR_CASE(MODIFY_FLOW_TABLE); 27 | default: return "unknown command opcode"; 28 | } 29 | } 30 | -- 31 | 2.17.1 32 | 33 | -------------------------------------------------------------------------------- /Patches_Following_Mainline_History/4.4.211/0620-PCI-hv-Remove-the-unused-wrk-in-struct-hv_pcibus_dev.patch: -------------------------------------------------------------------------------- 1 | From 9f2e92ad3d8dd874403127abee998acd54b933fd Mon Sep 17 00:00:00 2001 2 | From: Dexuan Cui 3 | Date: Tue, 23 Aug 2016 04:47:23 +0000 4 | Subject: PCI: hv: Remove the unused 'wrk' in struct hv_pcibus_device 5 | Reply-To: joseph.salisbury@microsoft.com 6 | 7 | Remove the unused 'wrk' member in struct hv_pcibus_device. 8 | 9 | Signed-off-by: Dexuan Cui 10 | Signed-off-by: Bjorn Helgaas 11 | Acked-by: KY Srinivasan 12 | CC: Jake Oshins 13 | CC: Haiyang Zhang 14 | CC: Vitaly Kuznetsov 15 | (cherry picked from commit 617ceb62eaa1a180e8af1be9903d960c3a0b2ebc) 16 | Signed-off-by: Joseph Salisbury 17 | --- 18 | drivers/pci/host/pci-hyperv.c | 1 - 19 | 1 file changed, 1 deletion(-) 20 | 21 | diff --git a/drivers/pci/host/pci-hyperv.c b/drivers/pci/host/pci-hyperv.c 22 | index 9dc5f904ff1f..eb7e4025a27a 100644 23 | --- a/drivers/pci/host/pci-hyperv.c 24 | +++ b/drivers/pci/host/pci-hyperv.c 25 | @@ -374,7 +374,6 @@ struct hv_pcibus_device { 26 | 27 | struct list_head children; 28 | struct list_head dr_list; 29 | - struct work_struct wrk; 30 | 31 | struct msi_domain_info msi_info; 32 | struct msi_controller msi_chip; 33 | -- 34 | 2.17.1 35 | 36 | -------------------------------------------------------------------------------- /Legacy/4.13/hv_netvsc-Add-initialization-of-tx_table-in-netvsc_d.patch: -------------------------------------------------------------------------------- 1 | From 0e7bae7d42d3f3874253f05238c38527f0ed48a5 Mon Sep 17 00:00:00 2001 2 | From: Haiyang Zhang 3 | Date: Fri, 13 Oct 2017 12:28:05 -0700 4 | Subject: [PATCH 130/156] hv_netvsc: Add initialization of tx_table in 5 | netvsc_device_add() 6 | 7 | tx_table is part of the private data of kernel net_device. It is only 8 | zero-ed out when allocating net_device. 9 | 10 | We may recreate netvsc_device w/o recreating net_device, so the private 11 | netdev data, including tx_table, are not zeroed. It may contain channel 12 | numbers for the older netvsc_device. 13 | 14 | This patch adds initialization of tx_table each time we recreate 15 | netvsc_device. 16 | 17 | Signed-off-by: Haiyang Zhang 18 | Signed-off-by: David S. Miller 19 | --- 20 | drivers/net/hyperv/netvsc.c | 3 +++ 21 | 1 file changed, 3 insertions(+) 22 | 23 | --- a/drivers/net/hyperv/netvsc.c 2017-12-05 16:55:51.890603833 -0800 24 | +++ b/drivers/net/hyperv/netvsc.c 2017-12-05 16:55:51.886603885 -0800 25 | @@ -1252,6 +1252,9 @@ struct netvsc_device *netvsc_device_add( 26 | if (!net_device) 27 | return ERR_PTR(-ENOMEM); 28 | 29 | + for (i = 0; i < VRSS_SEND_TAB_SIZE; i++) 30 | + net_device_ctx->tx_table[i] = 0; 31 | + 32 | net_device->ring_size = ring_size; 33 | 34 | /* Because the device uses NAPI, all the interrupt batching and 35 | -------------------------------------------------------------------------------- /Legacy/4.13/pci-hyperv-Use-only-16-bit-integer-for-PCI-domain.patch: -------------------------------------------------------------------------------- 1 | From 25cb1e5b4589472aa3b310f422a23e1a1f21d3d9 Mon Sep 17 00:00:00 2001 2 | From: Haiyang Zhang 3 | Date: Thu, 20 Apr 2017 09:35:23 -0700 4 | Subject: [PATCH 04/98] pci-hyperv: Use only 16 bit integer for PCI domain 5 | 6 | This patch uses the lower 16 bits of the serial number as PCI 7 | domain, otherwise some drivers may not be able to handle it. 8 | 9 | Signed-off-by: Haiyang Zhang 10 | --- 11 | drivers/pci/host/pci-hyperv.c | 4 +++- 12 | 1 file changed, 3 insertions(+), 1 deletion(-) 13 | 14 | --- a/drivers/pci/host/pci-hyperv.c 2017-10-05 14:20:47.347473207 -0700 15 | +++ b/drivers/pci/host/pci-hyperv.c 2017-10-05 14:20:47.347473207 -0700 16 | @@ -1578,9 +1578,11 @@ static struct hv_pci_dev *new_pcichild_d 17 | * can have shorter names than based on the bus instance UUID. 18 | * Only the first device serial number is used for domain, so the 19 | * domain number will not change after the first device is added. 20 | + * The lower 16 bits of the serial number is used, otherwise some 21 | + * drivers may not be able to handle it. 22 | */ 23 | if (list_empty(&hbus->children)) 24 | - hbus->sysdata.domain = desc->ser; 25 | + hbus->sysdata.domain = desc->ser & 0xFFFF; 26 | list_add_tail(&hpdev->list_entry, &hbus->children); 27 | spin_unlock_irqrestore(&hbus->device_list_lock, flags); 28 | return hpdev; 29 | -------------------------------------------------------------------------------- /Legacy/4.14/hv_netvsc-Add-initialization-of-tx_table-in-netvsc_d.patch: -------------------------------------------------------------------------------- 1 | From 647bd50046ba0dddc91173b4fda962fa31f6e3b1 Mon Sep 17 00:00:00 2001 2 | From: Haiyang Zhang 3 | Date: Fri, 13 Oct 2017 12:28:05 -0700 4 | Subject: [PATCH 33/71] hv_netvsc: Add initialization of tx_table in 5 | netvsc_device_add() 6 | 7 | tx_table is part of the private data of kernel net_device. It is only 8 | zero-ed out when allocating net_device. 9 | 10 | We may recreate netvsc_device w/o recreating net_device, so the private 11 | netdev data, including tx_table, are not zeroed. It may contain channel 12 | numbers for the older netvsc_device. 13 | 14 | This patch adds initialization of tx_table each time we recreate 15 | netvsc_device. 16 | 17 | Signed-off-by: Haiyang Zhang 18 | Signed-off-by: David S. Miller 19 | --- 20 | drivers/net/hyperv/netvsc.c | 3 +++ 21 | 1 file changed, 3 insertions(+) 22 | 23 | --- a/drivers/net/hyperv/netvsc.c 2018-01-19 15:22:32.513423466 -0800 24 | +++ b/drivers/net/hyperv/netvsc.c 2018-01-19 15:22:32.509423520 -0800 25 | @@ -1255,6 +1255,9 @@ struct netvsc_device *netvsc_device_add( 26 | if (!net_device) 27 | return ERR_PTR(-ENOMEM); 28 | 29 | + for (i = 0; i < VRSS_SEND_TAB_SIZE; i++) 30 | + net_device_ctx->tx_table[i] = 0; 31 | + 32 | net_device->ring_size = ring_size; 33 | 34 | /* Because the device uses NAPI, all the interrupt batching and 35 | -------------------------------------------------------------------------------- /Legacy/4.14/pci-hyperv-Use-only-16-bit-integer-for-PCI-domain.patch: -------------------------------------------------------------------------------- 1 | From d11aab8dd5ea9c4cff9877df34404de3753a27b4 Mon Sep 17 00:00:00 2001 2 | From: Haiyang Zhang 3 | Date: Thu, 20 Apr 2017 09:35:23 -0700 4 | Subject: [PATCH 03/71] pci-hyperv: Use only 16 bit integer for PCI domain 5 | 6 | This patch uses the lower 16 bits of the serial number as PCI 7 | domain, otherwise some drivers may not be able to handle it. 8 | 9 | Signed-off-by: Haiyang Zhang 10 | --- 11 | drivers/pci/host/pci-hyperv.c | 4 +++- 12 | 1 file changed, 3 insertions(+), 1 deletion(-) 13 | 14 | --- a/drivers/pci/host/pci-hyperv.c 2017-12-06 14:45:45.959558276 -0800 15 | +++ b/drivers/pci/host/pci-hyperv.c 2017-12-06 14:45:45.955558328 -0800 16 | @@ -1540,9 +1540,11 @@ static struct hv_pci_dev *new_pcichild_d 17 | * can have shorter names than based on the bus instance UUID. 18 | * Only the first device serial number is used for domain, so the 19 | * domain number will not change after the first device is added. 20 | + * The lower 16 bits of the serial number is used, otherwise some 21 | + * drivers may not be able to handle it. 22 | */ 23 | if (list_empty(&hbus->children)) 24 | - hbus->sysdata.domain = desc->ser; 25 | + hbus->sysdata.domain = desc->ser & 0xFFFF; 26 | list_add_tail(&hpdev->list_entry, &hbus->children); 27 | spin_unlock_irqrestore(&hbus->device_list_lock, flags); 28 | return hpdev; 29 | -------------------------------------------------------------------------------- /Legacy/4.13/hv_netvsc-use-hv_get_bytes_to_write.patch: -------------------------------------------------------------------------------- 1 | From 2853b2224a6eda88ba4fe0a6bffb652e602a4b95 Mon Sep 17 00:00:00 2001 2 | From: Stephen Hemminger 3 | Date: Tue, 14 Nov 2017 10:42:32 -0800 4 | Subject: [PATCH 147/156] hv_netvsc: use hv_get_bytes_to_write 5 | 6 | Don't need to know bytes avail_to_read when computing space. 7 | 8 | Signed-off-by: Stephen Hemminger 9 | --- 10 | drivers/net/hyperv/netvsc.c | 9 +++------ 11 | 1 file changed, 3 insertions(+), 6 deletions(-) 12 | 13 | --- a/drivers/net/hyperv/netvsc.c 2017-12-05 16:55:55.382559016 -0800 14 | +++ b/drivers/net/hyperv/netvsc.c 2017-12-05 16:55:55.378559067 -0800 15 | @@ -587,14 +587,11 @@ void netvsc_device_remove(struct hv_devi 16 | * Get the percentage of available bytes to write in the ring. 17 | * The return value is in range from 0 to 100. 18 | */ 19 | -static inline u32 hv_ringbuf_avail_percent( 20 | - struct hv_ring_buffer_info *ring_info) 21 | +static inline u32 hv_ringbuf_avail_percent(const struct hv_ring_buffer_info *rbi) 22 | { 23 | - u32 avail_read, avail_write; 24 | + u32 avail_write = hv_get_bytes_to_write(rbi); 25 | 26 | - hv_get_ringbuffer_availbytes(ring_info, &avail_read, &avail_write); 27 | - 28 | - return avail_write * 100 / ring_info->ring_datasize; 29 | + return (avail_write * 100)/ rbi->ring_datasize; 30 | } 31 | 32 | static inline void netvsc_free_send_slot(struct netvsc_device *net_device, 33 | -------------------------------------------------------------------------------- /Legacy/4.14/hv_netvsc-use-hv_get_bytes_to_write.patch: -------------------------------------------------------------------------------- 1 | From a00b4f1ead7cd27ca1152ce8eb2a4b82c0e615fc Mon Sep 17 00:00:00 2001 2 | From: Stephen Hemminger 3 | Date: Tue, 14 Nov 2017 10:42:32 -0800 4 | Subject: [PATCH 59/71] hv_netvsc: use hv_get_bytes_to_write 5 | 6 | Don't need to know bytes avail_to_read when computing space. 7 | 8 | Signed-off-by: Stephen Hemminger 9 | --- 10 | drivers/net/hyperv/netvsc.c | 9 +++------ 11 | 1 file changed, 3 insertions(+), 6 deletions(-) 12 | 13 | --- a/drivers/net/hyperv/netvsc.c 2018-01-19 15:23:38.604540811 -0800 14 | +++ b/drivers/net/hyperv/netvsc.c 2018-01-19 15:23:38.600540864 -0800 15 | @@ -585,14 +585,11 @@ void netvsc_device_remove(struct hv_devi 16 | * Get the percentage of available bytes to write in the ring. 17 | * The return value is in range from 0 to 100. 18 | */ 19 | -static inline u32 hv_ringbuf_avail_percent( 20 | - struct hv_ring_buffer_info *ring_info) 21 | +static inline u32 hv_ringbuf_avail_percent(const struct hv_ring_buffer_info *rbi) 22 | { 23 | - u32 avail_read, avail_write; 24 | + u32 avail_write = hv_get_bytes_to_write(rbi); 25 | 26 | - hv_get_ringbuffer_availbytes(ring_info, &avail_read, &avail_write); 27 | - 28 | - return avail_write * 100 / ring_info->ring_datasize; 29 | + return (avail_write * 100)/ rbi->ring_datasize; 30 | } 31 | 32 | static inline void netvsc_free_send_slot(struct netvsc_device *net_device, 33 | -------------------------------------------------------------------------------- /Patches_Following_Mainline_History/4.4.211/0751-netvsc-fix-return-value-for-set_channels.patch: -------------------------------------------------------------------------------- 1 | From 7c0341ef4ab623ef56940beb3836515fd5235951 Mon Sep 17 00:00:00 2001 2 | From: stephen hemminger 3 | Date: Fri, 28 Jul 2017 08:59:41 -0700 4 | Subject: netvsc: fix return value for set_channels 5 | Reply-To: joseph.salisbury@microsoft.com 6 | 7 | The error and normal case got swapped. 8 | 9 | Signed-off-by: Stephen Hemminger 10 | Signed-off-by: David S. Miller 11 | (cherry picked from commit d6aac1f218873f2266de23280bffb909b4a98fbf) 12 | Signed-off-by: Joseph Salisbury 13 | --- 14 | drivers/net/hyperv/netvsc_drv.c | 2 +- 15 | 1 file changed, 1 insertion(+), 1 deletion(-) 16 | 17 | diff --git a/drivers/net/hyperv/netvsc_drv.c b/drivers/net/hyperv/netvsc_drv.c 18 | index 008b3fec510f..4db5407abe87 100644 19 | --- a/drivers/net/hyperv/netvsc_drv.c 20 | +++ b/drivers/net/hyperv/netvsc_drv.c 21 | @@ -713,8 +713,8 @@ static int netvsc_set_channels(struct net_device *net, 22 | if (!IS_ERR(nvdev)) { 23 | netif_set_real_num_tx_queues(net, nvdev->num_chn); 24 | netif_set_real_num_rx_queues(net, nvdev->num_chn); 25 | - ret = PTR_ERR(nvdev); 26 | } else { 27 | + ret = PTR_ERR(nvdev); 28 | device_info.num_chn = orig; 29 | device_info.max_num_vrss_chns = count; 30 | rndis_filter_device_add(dev, &device_info); 31 | -- 32 | 2.17.1 33 | 34 | -------------------------------------------------------------------------------- /Patches_Following_Mainline_History/4.4.211/0776-hv_netvsc-Fix-the-channel-limit-in-netvsc_set_rxfh.patch: -------------------------------------------------------------------------------- 1 | From a31c7a58131abd4ba17169da969f4019f5ad3afc Mon Sep 17 00:00:00 2001 2 | From: Haiyang Zhang 3 | Date: Fri, 1 Sep 2017 14:30:07 -0700 4 | Subject: hv_netvsc: Fix the channel limit in netvsc_set_rxfh() 5 | Reply-To: joseph.salisbury@microsoft.com 6 | 7 | The limit of setting receive indirection table value should be 8 | the current number of channels, not the VRSS_CHANNEL_MAX. 9 | 10 | Signed-off-by: Haiyang Zhang 11 | Signed-off-by: David S. Miller 12 | (backported from commit db3cd7af9d0f174475cbcc02c0e96a5408fe2dc2) 13 | Signed-off-by: Joseph Salisbury 14 | --- 15 | drivers/net/hyperv/netvsc_drv.c | 2 +- 16 | 1 file changed, 1 insertion(+), 1 deletion(-) 17 | 18 | diff --git a/drivers/net/hyperv/netvsc_drv.c b/drivers/net/hyperv/netvsc_drv.c 19 | index 9c754225e85d..39db303c2f2b 100644 20 | --- a/drivers/net/hyperv/netvsc_drv.c 21 | +++ b/drivers/net/hyperv/netvsc_drv.c 22 | @@ -1371,7 +1371,7 @@ static int netvsc_set_rxfh(struct net_device *dev, const u32 *indir, 23 | rndis_dev = ndev->extension; 24 | if (indir) { 25 | for (i = 0; i < ITAB_NUM; i++) 26 | - if (indir[i] >= dev->num_rx_queues) 27 | + if (indir[i] >= ndev->num_chn) 28 | return -EINVAL; 29 | 30 | for (i = 0; i < ITAB_NUM; i++) 31 | -- 32 | 2.17.1 33 | 34 | -------------------------------------------------------------------------------- /Legacy/4.15/0053-remove-clear-ioapic.patch: -------------------------------------------------------------------------------- 1 | From 7fdc1cb28b6b59c7c1442a9167c05b53ab1f7d0a Mon Sep 17 00:00:00 2001 2 | From: Matthew Johnson 3 | Date: Mon, 15 Aug 2016 15:57:28 +0000 4 | Subject: [PATCH 53/55] remove clear ioapic 5 | 6 | Remove call to clear_IO_APIC in early boot 7 | 8 | In hyper-v we can expect the IOAPIC to be empty on boot. The call 9 | to clear_IO_APIC is then not necessary or desirable because it can 10 | cause significant boot delays in hyper-v. We were seeing up to 300 ms 11 | delays with this call on 32-core systems. 12 | 13 | Signed-off-by: Sasha Levin 14 | --- 15 | arch/x86/kernel/apic/io_apic.c | 7 +++++-- 16 | 1 file changed, 5 insertions(+), 2 deletions(-) 17 | 18 | diff --git a/arch/x86/kernel/apic/io_apic.c b/arch/x86/kernel/apic/io_apic.c 19 | index 8a7963421460..069b5ad51ac2 100644 20 | --- a/arch/x86/kernel/apic/io_apic.c 21 | +++ b/arch/x86/kernel/apic/io_apic.c 22 | @@ -1405,9 +1405,12 @@ void __init enable_IO_APIC(void) 23 | } 24 | 25 | /* 26 | - * Do not trust the IO-APIC being empty at bootup 27 | + * In hyper-v we can trust that IO_APIC will be cleared on boot. A call to 28 | + * clear_IO_APIC is therefore not necessary or desirable since it can 29 | + * cause significant delays in boot time. 30 | + * 31 | + * clear_IO_APIC(); 32 | */ 33 | - clear_IO_APIC(); 34 | } 35 | 36 | void native_disable_io_apic(void) 37 | -- 38 | 2.14.1 39 | 40 | -------------------------------------------------------------------------------- /Patches_Following_Mainline_History/4.4.211/0617-PCI-hv-Use-list_move_tail-instead-of-list_del-list_a.patch: -------------------------------------------------------------------------------- 1 | From 85189ad685b03b94949182f4ccba10bd9a11edd1 Mon Sep 17 00:00:00 2001 2 | From: Wei Yongjun 3 | Date: Thu, 28 Jul 2016 16:16:48 +0000 4 | Subject: PCI: hv: Use list_move_tail() instead of list_del() + list_add_tail() 5 | Reply-To: joseph.salisbury@microsoft.com 6 | 7 | Use list_move_tail() instead of list_del() + list_add_tail(). No 8 | functional change intended 9 | 10 | Signed-off-by: Wei Yongjun 11 | Signed-off-by: Bjorn Helgaas 12 | (cherry picked from commit 4f1cb01a7892582d18483986fbc268cdef1b1dee) 13 | Signed-off-by: Joseph Salisbury 14 | --- 15 | drivers/pci/host/pci-hyperv.c | 3 +-- 16 | 1 file changed, 1 insertion(+), 2 deletions(-) 17 | 18 | diff --git a/drivers/pci/host/pci-hyperv.c b/drivers/pci/host/pci-hyperv.c 19 | index f2559b649746..88f6d136214f 100644 20 | --- a/drivers/pci/host/pci-hyperv.c 21 | +++ b/drivers/pci/host/pci-hyperv.c 22 | @@ -1450,8 +1450,7 @@ static void pci_devices_present_work(struct work_struct *work) 23 | if (hpdev->reported_missing) { 24 | found = true; 25 | put_pcichild(hpdev, hv_pcidev_ref_childlist); 26 | - list_del(&hpdev->list_entry); 27 | - list_add_tail(&hpdev->list_entry, &removed); 28 | + list_move_tail(&hpdev->list_entry, &removed); 29 | break; 30 | } 31 | } 32 | -- 33 | 2.17.1 34 | 35 | -------------------------------------------------------------------------------- /Patches_Following_Mainline_History/4.4.211/0705-hv_netvsc-change-netvsc-device-default-duplex-to-FUL.patch: -------------------------------------------------------------------------------- 1 | From 992a73835541b033bbd8bb17f93beb56f194ab1a Mon Sep 17 00:00:00 2001 2 | From: Simon Xiao 3 | Date: Fri, 14 Apr 2017 14:42:58 -0700 4 | Subject: hv_netvsc: change netvsc device default duplex to FULL 5 | Reply-To: joseph.salisbury@microsoft.com 6 | 7 | The netvsc device supports full duplex by default. 8 | This warnings in log from bonding device which did not like 9 | seeing UNKNOWN duplex. 10 | 11 | Signed-off-by: Simon Xiao 12 | Signed-off-by: David S. Miller 13 | (cherry picked from commit f3c9d40ee12926f330a1dfebce0bebadd1406ba6) 14 | Signed-off-by: Joseph Salisbury 15 | --- 16 | drivers/net/hyperv/netvsc_drv.c | 2 +- 17 | 1 file changed, 1 insertion(+), 1 deletion(-) 18 | 19 | diff --git a/drivers/net/hyperv/netvsc_drv.c b/drivers/net/hyperv/netvsc_drv.c 20 | index 1c0c82881f9d..bb8ab024eb41 100644 21 | --- a/drivers/net/hyperv/netvsc_drv.c 22 | +++ b/drivers/net/hyperv/netvsc_drv.c 23 | @@ -783,7 +783,7 @@ static void netvsc_init_settings(struct net_device *dev) 24 | struct net_device_context *ndc = netdev_priv(dev); 25 | 26 | ndc->speed = SPEED_UNKNOWN; 27 | - ndc->duplex = DUPLEX_UNKNOWN; 28 | + ndc->duplex = DUPLEX_FULL; 29 | } 30 | 31 | static int netvsc_get_settings(struct net_device *dev, struct ethtool_cmd *cmd) 32 | -- 33 | 2.17.1 34 | 35 | -------------------------------------------------------------------------------- /Patches_Following_Mainline_History/4.9.184/0042-hv_netvsc-change-netvsc-device-default-duplex-to-FUL.patch: -------------------------------------------------------------------------------- 1 | From e28e1ac90cd3d2d4959b40d9d1b3c851a42730c5 Mon Sep 17 00:00:00 2001 2 | From: Simon Xiao 3 | Date: Fri, 14 Apr 2017 14:42:58 -0700 4 | Subject: hv_netvsc: change netvsc device default duplex to FULL 5 | Reply-To: joseph.salisbury@microsoft.com 6 | 7 | The netvsc device supports full duplex by default. 8 | This warnings in log from bonding device which did not like 9 | seeing UNKNOWN duplex. 10 | 11 | Signed-off-by: Simon Xiao 12 | Signed-off-by: David S. Miller 13 | (cherry picked from commit f3c9d40ee12926f330a1dfebce0bebadd1406ba6) 14 | Signed-off-by: Joseph Salisbury 15 | --- 16 | drivers/net/hyperv/netvsc_drv.c | 2 +- 17 | 1 file changed, 1 insertion(+), 1 deletion(-) 18 | 19 | diff --git a/drivers/net/hyperv/netvsc_drv.c b/drivers/net/hyperv/netvsc_drv.c 20 | index a8f8f57375bb..ce7a4a442df4 100644 21 | --- a/drivers/net/hyperv/netvsc_drv.c 22 | +++ b/drivers/net/hyperv/netvsc_drv.c 23 | @@ -818,7 +818,7 @@ static void netvsc_init_settings(struct net_device *dev) 24 | struct net_device_context *ndc = netdev_priv(dev); 25 | 26 | ndc->speed = SPEED_UNKNOWN; 27 | - ndc->duplex = DUPLEX_UNKNOWN; 28 | + ndc->duplex = DUPLEX_FULL; 29 | } 30 | 31 | static int netvsc_get_settings(struct net_device *dev, struct ethtool_cmd *cmd) 32 | -- 33 | 2.17.1 34 | 35 | -------------------------------------------------------------------------------- /Patches_Following_Mainline_History/4.19.87/README-4.19.87.txt: -------------------------------------------------------------------------------- 1 | HOWTO: These patches will enable accelerated networking on the upstrem stable 4.19.87 kernel for Linux VM on Azure. 2 | 3 | 1. Apply the below patches to make SR-IOV work with the 4.19.87 kernel 4 | 5 | 6 | 1.1 checkout the upstream 4.19.87 kernel and set HEAD to 4.19.87 7 | git clone https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable.git 8 | cd ~/linux-stable 9 | git reset --hard v4.19.87 10 | git clean -dxf 11 | 12 | 1.2 Apply the patches 13 | First change to top of the 4.19.87 kernel tree: 14 | git am -k ~/azure-linux-kernel/4.19.87/*.patch 15 | 16 | 2. Confirm Mellanox card is seen 17 | 18 | 2.1 run "lspci" in this VM, and you will get: 19 | 0002:00:02.0 Ethernet controller: Mellanox Technologies MT27500/MT27520 Family [ConnectX-3/ConnectX-3 Pro Virtual Function] 20 | 21 | 2.2 The following command should give you similar output: 22 | 'sudo ifconfig -a' should show the VF interface starting with "en". 23 | enP41257s1: flags=6211 mtu 1500 24 | 25 | 'ethtool -S eth0 | grep vf_' should show activity on the VF (virtual function): 26 | vf_rx_packets: 8941 27 | vf_rx_bytes: 65642040 28 | vf_tx_packets: 34601 29 | vf_tx_bytes: 9600462 30 | vf_tx_dropped: 0 31 | cpu0_vf_rx_packets: 1828 32 | cpu0_vf_rx_bytes: 15852293 33 | cpu0_vf_tx_packets: 5509 34 | cpu0_vf_tx_bytes: 1570508 35 | cpu1_vf_rx_packets: 2782 36 | 37 | -------------------------------------------------------------------------------- /Patches_Following_Mainline_History/4.4.211/0274-Drivers-hv-vmbus-add-a-helper-function-to-set-a-chan.patch: -------------------------------------------------------------------------------- 1 | From 0fd21c0476649c34ee72bae7a0c209a2f1464d8d Mon Sep 17 00:00:00 2001 2 | From: Dexuan Cui 3 | Date: Wed, 27 Jan 2016 22:29:37 -0800 4 | Subject: Drivers: hv: vmbus: add a helper function to set a channel's pending 5 | send size 6 | Reply-To: joseph.salisbury@microsoft.com 7 | 8 | This will be used by the coming net/hvsock driver. 9 | 10 | Signed-off-by: Dexuan Cui 11 | Signed-off-by: K. Y. Srinivasan 12 | Signed-off-by: Greg Kroah-Hartman 13 | (cherry picked from commit 3c75354d043ad546148d6992e40033ecaefc5ea5) 14 | Signed-off-by: Joseph Salisbury 15 | --- 16 | include/linux/hyperv.h | 6 ++++++ 17 | 1 file changed, 6 insertions(+) 18 | 19 | diff --git a/include/linux/hyperv.h b/include/linux/hyperv.h 20 | index dee3717134be..6fdbc835b6c9 100644 21 | --- a/include/linux/hyperv.h 22 | +++ b/include/linux/hyperv.h 23 | @@ -818,6 +818,12 @@ static inline void *get_per_channel_state(struct vmbus_channel *c) 24 | return c->per_channel_state; 25 | } 26 | 27 | +static inline void set_channel_pending_send_size(struct vmbus_channel *c, 28 | + u32 size) 29 | +{ 30 | + c->outbound.ring_buffer->pending_send_sz = size; 31 | +} 32 | + 33 | void vmbus_onmessage(void *context); 34 | 35 | int vmbus_request_offers(void); 36 | -- 37 | 2.17.1 38 | 39 | -------------------------------------------------------------------------------- /Legacy/4.13/hv_sock-avoid-double-FINs-if-shutdown-is-called.patch: -------------------------------------------------------------------------------- 1 | From 94b7cbd0662ea8efc089436ee380b5cb55caaf1f Mon Sep 17 00:00:00 2001 2 | From: Dexuan Cui 3 | Date: Wed, 26 Jul 2017 12:32:08 -0600 4 | Subject: [PATCH 27/98] hv_sock: avoid double FINs if shutdown() is called 5 | 6 | The host expects a single FIN according to Hyperv-V team. 7 | With the patch, the connection may not be cleanly closed. 8 | 9 | Signed-off-by: Dexuan Cui 10 | Cc: K. Y. Srinivasan 11 | Cc: Haiyang Zhang 12 | Cc: Stephen Hemminger 13 | --- 14 | net/vmw_vsock/hyperv_transport.c | 6 ++++++ 15 | 1 file changed, 6 insertions(+) 16 | 17 | --- a/net/vmw_vsock/hyperv_transport.c 2017-10-05 14:20:49.623501249 -0700 18 | +++ b/net/vmw_vsock/hyperv_transport.c 2017-10-05 14:20:49.623501249 -0700 19 | @@ -95,6 +95,9 @@ struct hvsock { 20 | u32 recv_data_len; 21 | /* The offset of the payload */ 22 | u32 recv_data_off; 23 | + 24 | + /* Have we sent the zero-length packet (FIN)? */ 25 | + unsigned long fin_sent; 26 | }; 27 | 28 | /* In the VM, we support Hyper-V Sockets with AF_VSOCK, and the endpoint is 29 | @@ -423,6 +426,9 @@ static int hvs_shutdown(struct vsock_soc 30 | 31 | hvs = vsk->trans; 32 | 33 | + if (test_and_set_bit(0, &hvs->fin_sent)) 34 | + return 0; 35 | + 36 | send_buf = (struct hvs_send_buf *)&hdr; 37 | 38 | /* It can't fail: see hvs_channel_writable_bytes(). */ 39 | -------------------------------------------------------------------------------- /Patches_Following_Mainline_History/4.4.211/0485-net-mlx5e-Add-missing-50G-baseSR2-link-mode.patch: -------------------------------------------------------------------------------- 1 | From a2f488162f5c8a30dfb14f488a4c6451c7c6887e Mon Sep 17 00:00:00 2001 2 | From: Gal Pressman 3 | Date: Thu, 23 Jun 2016 17:02:44 +0300 4 | Subject: net/mlx5e: Add missing 50G baseSR2 link mode 5 | Reply-To: joseph.salisbury@microsoft.com 6 | 7 | Add MLX5E_50GBASE_SR2 as ETHTOOL_LINK_MODE_50000baseSR2_Full_BIT. 8 | 9 | Signed-off-by: Gal Pressman 10 | Signed-off-by: Saeed Mahameed 11 | Cc: Ben Hutchings 12 | Cc: David Decotigny 13 | Signed-off-by: David S. Miller 14 | (cherry picked from commit 4a50e35b04c9008558a73ed4e349b3b483ef6739) 15 | Signed-off-by: Joseph Salisbury 16 | --- 17 | drivers/net/ethernet/mellanox/mlx5/core/en.h | 1 + 18 | 1 file changed, 1 insertion(+) 19 | 20 | diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en.h b/drivers/net/ethernet/mellanox/mlx5/core/en.h 21 | index d420e5c91bf3..b82f6f797ab4 100644 22 | --- a/drivers/net/ethernet/mellanox/mlx5/core/en.h 23 | +++ b/drivers/net/ethernet/mellanox/mlx5/core/en.h 24 | @@ -615,6 +615,7 @@ enum mlx5e_link_mode { 25 | MLX5E_10GBASE_ER = 14, 26 | MLX5E_40GBASE_SR4 = 15, 27 | MLX5E_40GBASE_LR4 = 16, 28 | + MLX5E_50GBASE_SR2 = 18, 29 | MLX5E_100GBASE_CR4 = 20, 30 | MLX5E_100GBASE_SR4 = 21, 31 | MLX5E_100GBASE_KR4 = 22, 32 | -- 33 | 2.17.1 34 | 35 | -------------------------------------------------------------------------------- /Legacy/4.13/netvsc-fix-rtnl-deadlock-on-unregister-of-vf.patch: -------------------------------------------------------------------------------- 1 | From 45442ca9095af14f1862ba1b91f56c27817579d5 Mon Sep 17 00:00:00 2001 2 | From: Stephen Hemminger 3 | Date: Thu, 10 Aug 2017 09:42:34 -0700 4 | Subject: [PATCH 70/98] netvsc: fix rtnl deadlock on unregister of vf 5 | 6 | With new transparent VF support, it is possible to get a deadlock 7 | when some of the deferred work is running and the unregister_vf 8 | is trying to cancel the work element. The solution is to use 9 | trylock and reschedule (similar to bonding and team device). 10 | 11 | Reported-by: Vitaly Kuznetsov 12 | Fixes: 0c195567a8f6 ("netvsc: transparent VF management") 13 | Signed-off-by: Stephen Hemminger 14 | Signed-off-by: David S. Miller 15 | --- 16 | drivers/net/hyperv/netvsc_drv.c | 6 +++++- 17 | 1 file changed, 5 insertions(+), 1 deletion(-) 18 | 19 | --- a/drivers/net/hyperv/netvsc_drv.c 2017-12-05 16:23:21.323870396 -0800 20 | +++ b/drivers/net/hyperv/netvsc_drv.c 2017-12-05 16:23:21.319870447 -0800 21 | @@ -1728,7 +1728,11 @@ static void netvsc_vf_setup(struct work_ 22 | struct net_device *ndev = hv_get_drvdata(ndev_ctx->device_ctx); 23 | struct net_device *vf_netdev; 24 | 25 | - rtnl_lock(); 26 | + if (!rtnl_trylock()) { 27 | + schedule_work(w); 28 | + return; 29 | + } 30 | + 31 | vf_netdev = rtnl_dereference(ndev_ctx->vf_netdev); 32 | if (vf_netdev) 33 | __netvsc_vf_setup(ndev, vf_netdev); 34 | -------------------------------------------------------------------------------- /Patches_Following_Mainline_History/4.4.211/0813-hv_netvsc-only-wake-transmit-queue-if-link-is-up.patch: -------------------------------------------------------------------------------- 1 | From 285ea30ad762e05ba204ec690c5cf8aed30bb778 Mon Sep 17 00:00:00 2001 2 | From: Stephen Hemminger 3 | Date: Fri, 2 Mar 2018 13:49:02 -0800 4 | Subject: hv_netvsc: only wake transmit queue if link is up 5 | Reply-To: joseph.salisbury@microsoft.com 6 | 7 | Don't wake transmit queues if link is not up yet. 8 | 9 | Signed-off-by: Stephen Hemminger 10 | Signed-off-by: David S. Miller 11 | (backported from commit f4950e4586dfc957e0a28226eeb992ddc049b5a2) 12 | Signed-off-by: Joseph Salisbury 13 | --- 14 | drivers/net/hyperv/netvsc_drv.c | 9 ++++----- 15 | 1 file changed, 4 insertions(+), 5 deletions(-) 16 | 17 | diff --git a/drivers/net/hyperv/netvsc_drv.c b/drivers/net/hyperv/netvsc_drv.c 18 | index 70892e799081..eec759355ddd 100644 19 | --- a/drivers/net/hyperv/netvsc_drv.c 20 | +++ b/drivers/net/hyperv/netvsc_drv.c 21 | @@ -91,12 +91,11 @@ static int netvsc_open(struct net_device *net) 22 | return ret; 23 | } 24 | 25 | - netif_tx_wake_all_queues(net); 26 | - 27 | rdev = nvdev->extension; 28 | - 29 | - if (!rdev->link_state) 30 | - netif_carrier_on(net); 31 | + if (!rdev->link_state) { 32 | + netif_carrier_on(net); 33 | + netif_tx_wake_all_queues(net); 34 | + } 35 | 36 | if (vf_netdev) { 37 | /* Setting synthetic device up transparently sets 38 | -- 39 | 2.17.1 40 | 41 | -------------------------------------------------------------------------------- /Legacy/4.13/hv_netvsc-Clean-up-unsed-parameter-from-netvsc_get_hash.patch: -------------------------------------------------------------------------------- 1 | From 2c9ef7e743442f4f3ec400f50b7bc914f56a82bf Mon Sep 17 00:00:00 2001 2 | From: Haiyang Zhang 3 | Date: Mon, 21 Aug 2017 19:22:37 -0700 4 | Subject: [PATCH 80/98] hv_netvsc: Clean up unused parameter from 5 | netvsc_get_hash() 6 | 7 | The parameter "sk" is not in use. 8 | 9 | Signed-off-by: Haiyang Zhang 10 | Signed-off-by: David S. Miller 11 | --- 12 | drivers/net/hyperv/netvsc_drv.c | 4 ++-- 13 | 1 file changed, 2 insertions(+), 2 deletions(-) 14 | 15 | --- a/drivers/net/hyperv/netvsc_drv.c 2017-12-05 16:23:30.847749215 -0800 16 | +++ b/drivers/net/hyperv/netvsc_drv.c 2017-12-05 16:23:30.843749267 -0800 17 | @@ -193,7 +193,7 @@ static void *init_ppi_data(struct rndis_ 18 | /* Azure hosts don't support non-TCP port numbers in hashing yet. We compute 19 | * hash for non-TCP traffic with only IP numbers. 20 | */ 21 | -static inline u32 netvsc_get_hash(struct sk_buff *skb, struct sock *sk) 22 | +static inline u32 netvsc_get_hash(struct sk_buff *skb) 23 | { 24 | struct flow_keys flow; 25 | u32 hash; 26 | @@ -227,7 +227,7 @@ static inline int netvsc_get_tx_queue(st 27 | struct sock *sk = skb->sk; 28 | int q_idx; 29 | 30 | - q_idx = ndc->tx_send_table[netvsc_get_hash(skb, sk) & 31 | + q_idx = ndc->tx_send_table[netvsc_get_hash(skb) & 32 | (VRSS_SEND_TAB_SIZE - 1)]; 33 | 34 | /* If queue index changed record the new value */ 35 | -------------------------------------------------------------------------------- /Legacy/4.13/hv_netvsc-Simplify-the-limit-check-in-netvsc_set_cha.patch: -------------------------------------------------------------------------------- 1 | From 4482874afb16ea9572250b537f1b1808fb50bc80 Mon Sep 17 00:00:00 2001 2 | From: Haiyang Zhang 3 | Date: Fri, 1 Sep 2017 14:30:06 -0700 4 | Subject: [PATCH 92/98] hv_netvsc: Simplify the limit check in 5 | netvsc_set_channels() 6 | 7 | Because of the following code, net->num_tx_queues equals to 8 | VRSS_CHANNEL_MAX, and max_chn is less than or equals to VRSS_CHANNEL_MAX. 9 | 10 | netvsc_drv.c: 11 | alloc_etherdev_mq(sizeof(struct net_device_context), 12 | VRSS_CHANNEL_MAX); 13 | rndis_filter.c: 14 | net_device->max_chn = min_t(u32, VRSS_CHANNEL_MAX, num_possible_rss_qs); 15 | 16 | So this patch removes the unnecessary limit check before comparing 17 | with "max_chn". 18 | 19 | Signed-off-by: Haiyang Zhang 20 | Signed-off-by: David S. Miller 21 | --- 22 | drivers/net/hyperv/netvsc_drv.c | 3 --- 23 | 1 file changed, 3 deletions(-) 24 | 25 | --- a/drivers/net/hyperv/netvsc_drv.c 2017-12-05 16:23:42.919595615 -0800 26 | +++ b/drivers/net/hyperv/netvsc_drv.c 2017-12-05 16:23:42.915595665 -0800 27 | @@ -830,9 +830,6 @@ static int netvsc_set_channels(struct ne 28 | channels->rx_count || channels->tx_count || channels->other_count) 29 | return -EINVAL; 30 | 31 | - if (count > net->num_tx_queues || count > VRSS_CHANNEL_MAX) 32 | - return -EINVAL; 33 | - 34 | if (!nvdev || nvdev->destroy) 35 | return -ENODEV; 36 | 37 | -------------------------------------------------------------------------------- /Legacy/4.15/0022-uio_hv_generic-check-that-host-supports-monitor-page.patch: -------------------------------------------------------------------------------- 1 | From f39ba233faee31cc03bd3716939a817a6d917a40 Mon Sep 17 00:00:00 2001 2 | From: Stephen Hemminger 3 | Date: Tue, 9 Jan 2018 12:57:31 -0800 4 | Subject: [PATCH 22/55] uio_hv_generic: check that host supports monitor page 5 | 6 | In order for userspace application to signal host, it needs the 7 | host to support the monitor page property. Check for the flag 8 | and fail if this is not supported. 9 | 10 | Signed-off-by: Stephen Hemminger 11 | Signed-off-by: Greg Kroah-Hartman 12 | Signed-off-by: Sasha Levin 13 | --- 14 | drivers/uio/uio_hv_generic.c | 7 +++++++ 15 | 1 file changed, 7 insertions(+) 16 | 17 | diff --git a/drivers/uio/uio_hv_generic.c b/drivers/uio/uio_hv_generic.c 18 | index dcd80aad9636..ee6d862ef4bd 100644 19 | --- a/drivers/uio/uio_hv_generic.c 20 | +++ b/drivers/uio/uio_hv_generic.c 21 | @@ -133,6 +133,13 @@ hv_uio_probe(struct hv_device *dev, 22 | if (ret) 23 | goto fail; 24 | 25 | + /* Communicating with host has to be via shared memory not hypercall */ 26 | + if (!dev->channel->offermsg.monitor_allocated) { 27 | + dev_err(&dev->device, "vmbus channel requires hypercall\n"); 28 | + ret = -ENOTSUPP; 29 | + goto fail_close; 30 | + } 31 | + 32 | dev->channel->inbound.ring_buffer->interrupt_mask = 1; 33 | set_channel_read_mode(dev->channel, HV_CALL_ISR); 34 | 35 | -- 36 | 2.14.1 37 | 38 | -------------------------------------------------------------------------------- /Patches_Following_Mainline_History/4.4.211/README-4.4.211: -------------------------------------------------------------------------------- 1 | HOWTO: These patches will enable accelerated networking on the upstrem stable 4.4.211 kernel for Linux VM on Hyper-V. 2 | 3 | 1. Apply the below patches to make SR-IOV work with the 4.4.211 kernel 4 | 5 | 6 | 1.1 checkout the upstream 4.4.211 kernel and set HEAD to 4.4.211 7 | git clone https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable.git 8 | cd ~/linux-stable 9 | git checkout linux-4.4.y 10 | git reset --hard v4.4.211 11 | git clean -dxf 12 | 13 | 1.2 Apply the patches 14 | First change to top of the 4.4.211 kernel tree: 15 | git am -k ~/azure-linux-kernel/4.4.211/*.patch 16 | 17 | 2. Confirm Mellanox card is seen 18 | 19 | 2.1 run "lspci" in this VM, and you will get: 20 | 0002:00:02.0 Ethernet controller: Mellanox Technologies MT27500/MT27520 Family [ConnectX-3/ConnectX-3 Pro Virtual Function] 21 | 22 | 2.2 The following command should give you similar output: 23 | 'sudo ifconfig -a' should show the VF interface starting with "en". 24 | enP41257s1: flags=6211 mtu 1500 25 | 26 | 'ethtool -S eth0 | grep vf_' should show activity on the VF (virtual function): 27 | vf_rx_packets: 8941 28 | vf_rx_bytes: 65642040 29 | vf_tx_packets: 34601 30 | vf_tx_bytes: 9600462 31 | vf_tx_dropped: 0 32 | cpu0_vf_rx_packets: 1828 33 | cpu0_vf_rx_bytes: 15852293 34 | cpu0_vf_tx_packets: 5509 35 | cpu0_vf_tx_bytes: 1570508 36 | cpu1_vf_rx_packets: 2782 37 | 38 | -------------------------------------------------------------------------------- /Patches_Following_Mainline_History/4.9.184/0101-hv_netvsc-disable-NAPI-before-channel-close.patch: -------------------------------------------------------------------------------- 1 | From c26fa95532acffe7912230a34483a708f1525eae Mon Sep 17 00:00:00 2001 2 | From: Stephen Hemminger 3 | Date: Tue, 20 Mar 2018 15:03:02 -0700 4 | Subject: hv_netvsc: disable NAPI before channel close 5 | Reply-To: joseph.salisbury@microsoft.com 6 | 7 | This makes sure that no CPU is still process packets when 8 | the channel is closed. 9 | 10 | Fixes: 76bb5db5c749 ("netvsc: fix use after free on module removal") 11 | Signed-off-by: Stephen Hemminger 12 | Signed-off-by: David S. Miller 13 | (backported from commit 8348e0460ab1473f06c8b824699dd2eed3c1979d) 14 | Signed-off-by: Joseph Salisbury 15 | --- 16 | drivers/net/hyperv/netvsc.c | 4 ++++ 17 | 1 file changed, 4 insertions(+) 18 | 19 | diff --git a/drivers/net/hyperv/netvsc.c b/drivers/net/hyperv/netvsc.c 20 | index 4bd560edfc6a..8c3410a923b7 100644 21 | --- a/drivers/net/hyperv/netvsc.c 22 | +++ b/drivers/net/hyperv/netvsc.c 23 | @@ -559,6 +559,10 @@ void netvsc_device_remove(struct hv_device *device) 24 | 25 | RCU_INIT_POINTER(net_device_ctx->nvdev, NULL); 26 | 27 | + /* And disassociate NAPI context from device */ 28 | + for (i = 0; i < net_device->num_chn; i++) 29 | + netif_napi_del(&net_device->chan_table[i].napi); 30 | + 31 | /* 32 | * At this point, no one should be accessing net_device 33 | * except in here 34 | -- 35 | 2.17.1 36 | 37 | -------------------------------------------------------------------------------- /Legacy/4.13/netvsc-signal-host-if-receive-ring-is-emptied.patch: -------------------------------------------------------------------------------- 1 | From a28beda2cf8bc260e633388c9ac8f376d8094d71 Mon Sep 17 00:00:00 2001 2 | From: stephen hemminger 3 | Date: Fri, 28 Jul 2017 08:59:47 -0700 4 | Subject: [PATCH 51/98] netvsc: signal host if receive ring is emptied 5 | 6 | Latency improvement related to NAPI conversion. 7 | If all packets are processed from receive ring then need 8 | to signal host. 9 | 10 | Signed-off-by: Stephen Hemminger 11 | Signed-off-by: David S. Miller 12 | --- 13 | drivers/net/hyperv/netvsc.c | 9 +++++++-- 14 | 1 file changed, 7 insertions(+), 2 deletions(-) 15 | 16 | --- a/drivers/net/hyperv/netvsc.c 2017-12-05 16:22:39.716399822 -0800 17 | +++ b/drivers/net/hyperv/netvsc.c 2017-12-05 16:22:39.712399872 -0800 18 | @@ -1193,10 +1193,15 @@ int netvsc_poll(struct napi_struct *napi 19 | nvchan->desc = hv_pkt_iter_next(channel, nvchan->desc); 20 | } 21 | 22 | + /* if ring is empty, signal host */ 23 | + if (!nvchan->desc) 24 | + hv_pkt_iter_close(channel); 25 | + 26 | /* If send of pending receive completions suceeded 27 | - * and did not exhaust NAPI budget 28 | + * and did not exhaust NAPI budget this time 29 | * and not doing busy poll 30 | - * then reschedule if more data has arrived from host 31 | + * then re-enable host interrupts 32 | + * and reschedule if ring is not empty. 33 | */ 34 | if (send_recv_completions(nvchan) == 0 && 35 | work_done < budget && 36 | -------------------------------------------------------------------------------- /Patches_Following_Mainline_History/4.14.141/README-4.14.141: -------------------------------------------------------------------------------- 1 | HOWTO: These patches will enable accelerated networking on the upstrem stable 4.14.141 kernel for Linux VM on Hyper-V. 2 | 3 | 1. Apply the below patches to make SR-IOV work with the 4.14.141 kernel 4 | 5 | 6 | 1.1 checkout the upstream 4.14.141 kernel and set HEAD to 4.14.141 7 | git clone https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable.git 8 | cd ~/linux-stable 9 | git checkout linux-4.14.y 10 | git reset --hard v4.14.141 11 | git clean -dxf 12 | 13 | 1.2 Apply the patches 14 | First change to top of the 4.14.141 kernel tree: 15 | git am -k ~/azure-linux-kernel/4.14.141/*.patch 16 | 17 | 2. Confirm Mellanox card is seen 18 | 19 | 2.1 run "lspci" in this VM, and you will get: 20 | 0002:00:02.0 Ethernet controller: Mellanox Technologies MT27500/MT27520 Family [ConnectX-3/ConnectX-3 Pro Virtual Function] 21 | 22 | 2.2 The following command should give you similar output: 23 | 'sudo ifconfig -a' should show the VF interface starting with "en". 24 | enP41257s1: flags=6211 mtu 1500 25 | 26 | 'ethtool -S eth0 | grep vf_' should show activity on the VF (virtual function): 27 | vf_rx_packets: 8941 28 | vf_rx_bytes: 65642040 29 | vf_tx_packets: 34601 30 | vf_tx_bytes: 9600462 31 | vf_tx_dropped: 0 32 | cpu0_vf_rx_packets: 1828 33 | cpu0_vf_rx_bytes: 15852293 34 | cpu0_vf_tx_packets: 5509 35 | cpu0_vf_tx_bytes: 1570508 36 | cpu1_vf_rx_packets: 2782 37 | 38 | -------------------------------------------------------------------------------- /Patches_Following_Mainline_History/4.4.211/0063-mlxsw-reg-Fix-max-temperature-getting.patch: -------------------------------------------------------------------------------- 1 | From e51612d0e10c792e27f70f174ab65c8a13ddd769 Mon Sep 17 00:00:00 2001 2 | From: Jiri Pirko 3 | Date: Fri, 11 Dec 2015 16:10:39 +0100 4 | Subject: mlxsw: reg: Fix max temperature getting 5 | Reply-To: joseph.salisbury@microsoft.com 6 | 7 | Fix copy & paste error in MTPM unpack helper. 8 | 9 | Fixes: 85926f877040 ("mlxsw: reg: Add definition of temperature management registers") 10 | Signed-off-by: Jiri Pirko 11 | Signed-off-by: David S. Miller 12 | (cherry picked from commit acf35a4ec6f75bcb1c20c7aa02586de6220d76c5) 13 | Signed-off-by: Joseph Salisbury 14 | --- 15 | drivers/net/ethernet/mellanox/mlxsw/reg.h | 2 +- 16 | 1 file changed, 1 insertion(+), 1 deletion(-) 17 | 18 | diff --git a/drivers/net/ethernet/mellanox/mlxsw/reg.h b/drivers/net/ethernet/mellanox/mlxsw/reg.h 19 | index 2453f2aa48d9..820d846725b5 100644 20 | --- a/drivers/net/ethernet/mellanox/mlxsw/reg.h 21 | +++ b/drivers/net/ethernet/mellanox/mlxsw/reg.h 22 | @@ -2684,7 +2684,7 @@ static inline void mlxsw_reg_mtmp_unpack(char *payload, unsigned int *p_temp, 23 | *p_temp = MLXSW_REG_MTMP_TEMP_TO_MC(temp); 24 | } 25 | if (p_max_temp) { 26 | - temp = mlxsw_reg_mtmp_temperature_get(payload); 27 | + temp = mlxsw_reg_mtmp_max_temperature_get(payload); 28 | *p_max_temp = MLXSW_REG_MTMP_TEMP_TO_MC(temp); 29 | } 30 | if (sensor_name) 31 | -- 32 | 2.17.1 33 | 34 | -------------------------------------------------------------------------------- /Legacy/4.15/0049-init_task-faster-timerslack.patch: -------------------------------------------------------------------------------- 1 | From 776e3f6a71f8ca4e482aa6a58e0f55636f6f107b Mon Sep 17 00:00:00 2001 2 | From: Arjan van de Ven 3 | Date: Wed, 23 Mar 2016 14:52:41 +0000 4 | Subject: [PATCH 49/55] init_task: faster timerslack 5 | 6 | the default tuning is a compromise between client power and server 7 | performance; 8 | for a server distro like Clear Linux, we don't need to compromise. 9 | (for non-server usages we have different kernel binaries) 10 | 11 | in principle this can be done as a patch to systemd as well, but we have 12 | a shared 13 | systemd between usages while we have different kernels, so the logistics 14 | for where the patch goes work out better here 15 | 16 | Signed-off-by: Sasha Levin 17 | --- 18 | include/linux/init_task.h | 2 +- 19 | 1 file changed, 1 insertion(+), 1 deletion(-) 20 | 21 | diff --git a/include/linux/init_task.h b/include/linux/init_task.h 22 | index 6a532629c983..6f6a9afa29a3 100644 23 | --- a/include/linux/init_task.h 24 | +++ b/include/linux/init_task.h 25 | @@ -274,7 +274,7 @@ extern struct cred init_cred; 26 | .journal_info = NULL, \ 27 | INIT_CPU_TIMERS(tsk) \ 28 | .pi_lock = __RAW_SPIN_LOCK_UNLOCKED(tsk.pi_lock), \ 29 | - .timer_slack_ns = 50000, /* 50 usec default slack */ \ 30 | + .timer_slack_ns = 1000, /* 1 usec default slack */ \ 31 | .pids = { \ 32 | [PIDTYPE_PID] = INIT_PID_LINK(PIDTYPE_PID), \ 33 | [PIDTYPE_PGID] = INIT_PID_LINK(PIDTYPE_PGID), \ 34 | -- 35 | 2.14.1 36 | 37 | -------------------------------------------------------------------------------- /Patches_Following_Mainline_History/4.4.211/0110-mlxsw-fix-SWITCHDEV_OBJ_ID_PORT_MDB.patch: -------------------------------------------------------------------------------- 1 | From 75e574f6230ffe6236b4eab44af5321e1254be46 Mon Sep 17 00:00:00 2001 2 | From: Dan Carpenter 3 | Date: Wed, 13 Jan 2016 15:28:23 +0300 4 | Subject: mlxsw: fix SWITCHDEV_OBJ_ID_PORT_MDB 5 | Reply-To: joseph.salisbury@microsoft.com 6 | 7 | There is a missing break statement so we always return -EOPNOTSUPP. 8 | 9 | Fixes: 3a49b4fde2a1 ('mlxsw: Adding layer 2 multicast support') 10 | Signed-off-by: Dan Carpenter 11 | Acked-by: Jiri Pirko 12 | Signed-off-by: David S. Miller 13 | (cherry picked from commit 00ae40e71d85ea3fed1b906951ffd80e0321a96d) 14 | Signed-off-by: Joseph Salisbury 15 | --- 16 | drivers/net/ethernet/mellanox/mlxsw/spectrum_switchdev.c | 1 + 17 | 1 file changed, 1 insertion(+) 18 | 19 | diff --git a/drivers/net/ethernet/mellanox/mlxsw/spectrum_switchdev.c b/drivers/net/ethernet/mellanox/mlxsw/spectrum_switchdev.c 20 | index 51caf417b30d..722d65fffbf0 100644 21 | --- a/drivers/net/ethernet/mellanox/mlxsw/spectrum_switchdev.c 22 | +++ b/drivers/net/ethernet/mellanox/mlxsw/spectrum_switchdev.c 23 | @@ -1021,6 +1021,7 @@ static int mlxsw_sp_port_obj_del(struct net_device *dev, 24 | case SWITCHDEV_OBJ_ID_PORT_MDB: 25 | err = mlxsw_sp_port_mdb_del(mlxsw_sp_port, 26 | SWITCHDEV_OBJ_PORT_MDB(obj)); 27 | + break; 28 | default: 29 | err = -EOPNOTSUPP; 30 | break; 31 | -- 32 | 2.17.1 33 | 34 | -------------------------------------------------------------------------------- /Legacy/4.13/hv_netvsc-Fix-the-real-number-of-queues-of-non-vRSS-.patch: -------------------------------------------------------------------------------- 1 | From 0ae0adde629c6e6d9dbf9ac426b3eebe2732fcf6 Mon Sep 17 00:00:00 2001 2 | From: Haiyang Zhang 3 | Date: Fri, 22 Sep 2017 15:31:38 -0700 4 | Subject: [PATCH 124/156] hv_netvsc: Fix the real number of queues of non-vRSS 5 | cases 6 | 7 | For older hosts without multi-channel (vRSS) support, and some error 8 | cases, we still need to set the real number of queues to one. 9 | This patch adds this missing setting. 10 | 11 | Fixes: 8195b1396ec8 ("hv_netvsc: fix deadlock on hotplug") 12 | Signed-off-by: Haiyang Zhang 13 | Reviewed-by: Stephen Hemminger 14 | Signed-off-by: David S. Miller 15 | --- 16 | drivers/net/hyperv/netvsc_drv.c | 6 ++++++ 17 | 1 file changed, 6 insertions(+) 18 | 19 | --- a/drivers/net/hyperv/netvsc_drv.c 2017-12-05 16:55:50.678619389 -0800 20 | +++ b/drivers/net/hyperv/netvsc_drv.c 2017-12-05 16:55:50.674619441 -0800 21 | @@ -1929,6 +1929,12 @@ static int netvsc_probe(struct hv_device 22 | /* We always need headroom for rndis header */ 23 | net->needed_headroom = RNDIS_AND_PPI_SIZE; 24 | 25 | + /* Initialize the number of queues to be 1, we may change it if more 26 | + * channels are offered later. 27 | + */ 28 | + netif_set_real_num_tx_queues(net, 1); 29 | + netif_set_real_num_rx_queues(net, 1); 30 | + 31 | /* Notify the netvsc driver of the new device */ 32 | memset(&device_info, 0, sizeof(device_info)); 33 | device_info.ring_size = ring_size; 34 | -------------------------------------------------------------------------------- /Legacy/4.13/hv_netvsc-Simplify-num_chn-checking-in-rndis_filter_.patch: -------------------------------------------------------------------------------- 1 | From 1c2bbeeff0057d5a735543f5e1f2f7845b22e514 Mon Sep 17 00:00:00 2001 2 | From: Haiyang Zhang 3 | Date: Fri, 1 Sep 2017 14:30:05 -0700 4 | Subject: [PATCH 91/98] hv_netvsc: Simplify num_chn checking in 5 | rndis_filter_device_add() 6 | 7 | The minus one and assignment to a local variable is not necessary. 8 | This patch simplifies it. 9 | 10 | Signed-off-by: Haiyang Zhang 11 | Signed-off-by: David S. Miller 12 | --- 13 | drivers/net/hyperv/rndis_filter.c | 6 +++--- 14 | 1 file changed, 3 insertions(+), 3 deletions(-) 15 | 16 | --- a/drivers/net/hyperv/rndis_filter.c 2017-12-05 16:23:41.875608898 -0800 17 | +++ b/drivers/net/hyperv/rndis_filter.c 2017-12-05 16:23:41.875608898 -0800 18 | @@ -1067,7 +1067,7 @@ struct netvsc_device *rndis_filter_devic 19 | struct ndis_recv_scale_cap rsscap; 20 | u32 rsscap_size = sizeof(struct ndis_recv_scale_cap); 21 | unsigned int gso_max_size = GSO_MAX_SIZE; 22 | - u32 mtu, size, num_rss_qs; 23 | + u32 mtu, size; 24 | const struct cpumask *node_cpu_mask; 25 | u32 num_possible_rss_qs; 26 | int i, ret; 27 | @@ -1215,8 +1215,8 @@ struct netvsc_device *rndis_filter_devic 28 | net_device->num_chn); 29 | 30 | atomic_set(&net_device->open_chn, 1); 31 | - num_rss_qs = net_device->num_chn - 1; 32 | - if (num_rss_qs == 0) 33 | + 34 | + if (net_device->num_chn == 1) 35 | return net_device; 36 | 37 | for (i = 1; i < net_device->num_chn; i++) { 38 | -------------------------------------------------------------------------------- /Legacy/4.14/hv_netvsc-Fix-the-real-number-of-queues-of-non-vRSS-.patch: -------------------------------------------------------------------------------- 1 | From bbfb9ae301eddb4310fb7448503a1cbab431de5b Mon Sep 17 00:00:00 2001 2 | From: Haiyang Zhang 3 | Date: Fri, 22 Sep 2017 15:31:38 -0700 4 | Subject: [PATCH 26/71] hv_netvsc: Fix the real number of queues of non-vRSS 5 | cases 6 | 7 | For older hosts without multi-channel (vRSS) support, and some error 8 | cases, we still need to set the real number of queues to one. 9 | This patch adds this missing setting. 10 | 11 | Fixes: 8195b1396ec8 ("hv_netvsc: fix deadlock on hotplug") 12 | Signed-off-by: Haiyang Zhang 13 | Reviewed-by: Stephen Hemminger 14 | Signed-off-by: David S. Miller 15 | --- 16 | drivers/net/hyperv/netvsc_drv.c | 6 ++++++ 17 | 1 file changed, 6 insertions(+) 18 | 19 | --- a/drivers/net/hyperv/netvsc_drv.c 2018-01-19 15:22:25.469517581 -0800 20 | +++ b/drivers/net/hyperv/netvsc_drv.c 2018-01-19 15:22:25.465517634 -0800 21 | @@ -1935,6 +1935,12 @@ static int netvsc_probe(struct hv_device 22 | /* We always need headroom for rndis header */ 23 | net->needed_headroom = RNDIS_AND_PPI_SIZE; 24 | 25 | + /* Initialize the number of queues to be 1, we may change it if more 26 | + * channels are offered later. 27 | + */ 28 | + netif_set_real_num_tx_queues(net, 1); 29 | + netif_set_real_num_rx_queues(net, 1); 30 | + 31 | /* Notify the netvsc driver of the new device */ 32 | memset(&device_info, 0, sizeof(device_info)); 33 | device_info.ring_size = ring_size; 34 | -------------------------------------------------------------------------------- /Patches_Following_Mainline_History/4.4.211/0170-net-mlx5e-Remove-select-queue-ndo-initialization.patch: -------------------------------------------------------------------------------- 1 | From 743bbe956f23b7fadda48333cdc6efbff69468dd Mon Sep 17 00:00:00 2001 2 | From: Saeed Mahameed 3 | Date: Tue, 9 Feb 2016 14:57:43 +0200 4 | Subject: net/mlx5e: Remove select queue ndo initialization 5 | Reply-To: joseph.salisbury@microsoft.com 6 | 7 | Currently mlx5e_select_queue is redundant since num_tc is always 1. 8 | 9 | Signed-off-by: Saeed Mahameed 10 | Signed-off-by: David S. Miller 11 | (cherry picked from commit b236872739df6410c7c60874ff8f3fb188ffb9d0) 12 | Signed-off-by: Joseph Salisbury 13 | --- 14 | drivers/net/ethernet/mellanox/mlx5/core/en_main.c | 3 --- 15 | 1 file changed, 3 deletions(-) 16 | 17 | diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en_main.c b/drivers/net/ethernet/mellanox/mlx5/core/en_main.c 18 | index e7c54883fca7..e3ff644c4de6 100644 19 | --- a/drivers/net/ethernet/mellanox/mlx5/core/en_main.c 20 | +++ b/drivers/net/ethernet/mellanox/mlx5/core/en_main.c 21 | @@ -2160,9 +2160,6 @@ static void mlx5e_build_netdev(struct net_device *netdev) 22 | 23 | SET_NETDEV_DEV(netdev, &mdev->pdev->dev); 24 | 25 | - if (priv->params.num_tc > 1) 26 | - mlx5e_netdev_ops.ndo_select_queue = mlx5e_select_queue; 27 | - 28 | if (MLX5_CAP_GEN(mdev, vport_group_manager)) { 29 | mlx5e_netdev_ops.ndo_set_vf_mac = mlx5e_set_vf_mac; 30 | mlx5e_netdev_ops.ndo_set_vf_vlan = mlx5e_set_vf_vlan; 31 | -- 32 | 2.17.1 33 | 34 | -------------------------------------------------------------------------------- /Legacy/4.15/0003-hv_netvsc-replace-divide-with-mask-when-computing-pa.patch: -------------------------------------------------------------------------------- 1 | From 46a6ddfa4c7bee872ddf6f8464b96893e39bdb73 Mon Sep 17 00:00:00 2001 2 | From: Stephen Hemminger 3 | Date: Fri, 1 Dec 2017 11:01:46 -0800 4 | Subject: [PATCH 03/55] hv_netvsc: replace divide with mask when computing 5 | padding 6 | 7 | Packet alignment is always a power of 2 therefore modulus can 8 | be replaced with a faster and operation 9 | 10 | Signed-off-by: Stephen Hemminger 11 | Signed-off-by: David S. Miller 12 | Signed-off-by: Sasha Levin 13 | --- 14 | drivers/net/hyperv/netvsc.c | 3 ++- 15 | 1 file changed, 2 insertions(+), 1 deletion(-) 16 | 17 | diff --git a/drivers/net/hyperv/netvsc.c b/drivers/net/hyperv/netvsc.c 18 | index ee31faa67cad..4b931f017a25 100644 19 | --- a/drivers/net/hyperv/netvsc.c 20 | +++ b/drivers/net/hyperv/netvsc.c 21 | @@ -712,11 +712,12 @@ static u32 netvsc_copy_to_send_buf(struct netvsc_device *net_device, 22 | int i; 23 | u32 msg_size = 0; 24 | u32 padding = 0; 25 | - u32 remain = packet->total_data_buflen % net_device->pkt_align; 26 | u32 page_count = packet->cp_partial ? packet->rmsg_pgcnt : 27 | packet->page_buf_cnt; 28 | + u32 remain; 29 | 30 | /* Add padding */ 31 | + remain = packet->total_data_buflen & (net_device->pkt_align - 1); 32 | if (skb->xmit_more && remain && !packet->cp_partial) { 33 | padding = net_device->pkt_align - remain; 34 | rndis_msg->msg_len += padding; 35 | -- 36 | 2.14.1 37 | 38 | -------------------------------------------------------------------------------- /Patches_Following_Mainline_History/4.4.211/0079-mlxsw-spectrum-Initialize-PVID-only-once.patch: -------------------------------------------------------------------------------- 1 | From ae920cdc86ec1d7daedb5b1c4fd67c83a1968aaa Mon Sep 17 00:00:00 2001 2 | From: Ido Schimmel 3 | Date: Mon, 4 Jan 2016 10:42:23 +0100 4 | Subject: mlxsw: spectrum: Initialize PVID only once 5 | Reply-To: joseph.salisbury@microsoft.com 6 | 7 | We set PVID to 1 in mlxsw_sp_port_vlan_init(), so we can remove this 8 | statement. 9 | 10 | Signed-off-by: Ido Schimmel 11 | Signed-off-by: Jiri Pirko 12 | Signed-off-by: David S. Miller 13 | (cherry picked from commit 7b31abe70b29edb3005a6466f51b7a10f8413a01) 14 | Signed-off-by: Joseph Salisbury 15 | --- 16 | drivers/net/ethernet/mellanox/mlxsw/spectrum.c | 1 - 17 | 1 file changed, 1 deletion(-) 18 | 19 | diff --git a/drivers/net/ethernet/mellanox/mlxsw/spectrum.c b/drivers/net/ethernet/mellanox/mlxsw/spectrum.c 20 | index 0e452fbe10d8..a40ed17575ee 100644 21 | --- a/drivers/net/ethernet/mellanox/mlxsw/spectrum.c 22 | +++ b/drivers/net/ethernet/mellanox/mlxsw/spectrum.c 23 | @@ -1368,7 +1368,6 @@ static int mlxsw_sp_port_create(struct mlxsw_sp *mlxsw_sp, u8 local_port) 24 | mlxsw_sp_port->learning = 1; 25 | mlxsw_sp_port->learning_sync = 1; 26 | mlxsw_sp_port->uc_flood = 1; 27 | - mlxsw_sp_port->pvid = 1; 28 | bytes = DIV_ROUND_UP(VLAN_N_VID, BITS_PER_BYTE); 29 | mlxsw_sp_port->active_vlans = kzalloc(bytes, GFP_KERNEL); 30 | if (!mlxsw_sp_port->active_vlans) { 31 | -- 32 | 2.17.1 33 | 34 | -------------------------------------------------------------------------------- /Patches_Following_Mainline_History/4.14.141/0023-vmbus-don-t-return-values-for-uninitalized-channels.patch: -------------------------------------------------------------------------------- 1 | From 9168f109ad3c94e90211f50f74629f062f62c777 Mon Sep 17 00:00:00 2001 2 | From: Stephen Hemminger 3 | Date: Mon, 20 Aug 2018 21:16:40 +0000 4 | Subject: vmbus: don't return values for uninitalized channels 5 | Reply-To: joseph.salisbury@microsoft.com 6 | 7 | For unsupported device types, the vmbus channel ringbuffer is never 8 | initialized, and therefore reading the sysfs files will return garbage 9 | or cause a kernel OOPS. 10 | 11 | Fixes: c2e5df616e1a ("vmbus: add per-channel sysfs info") 12 | 13 | Signed-off-by: Stephen Hemminger 14 | Signed-off-by: K. Y. Srinivasan 15 | Cc: # 4.15 16 | Signed-off-by: Greg Kroah-Hartman 17 | (cherry picked from commit 6712cc9c22117a8af9f3df272b4a44fd2e4201cd) 18 | Signed-off-by: Joseph Salisbury 19 | --- 20 | drivers/hv/vmbus_drv.c | 3 +++ 21 | 1 file changed, 3 insertions(+) 22 | 23 | diff --git a/drivers/hv/vmbus_drv.c b/drivers/hv/vmbus_drv.c 24 | index 6e103b71698d..84ab54332913 100644 25 | --- a/drivers/hv/vmbus_drv.c 26 | +++ b/drivers/hv/vmbus_drv.c 27 | @@ -1227,6 +1227,9 @@ static ssize_t vmbus_chan_attr_show(struct kobject *kobj, 28 | if (!attribute->show) 29 | return -EIO; 30 | 31 | + if (chan->state != CHANNEL_OPENED_STATE) 32 | + return -EINVAL; 33 | + 34 | return attribute->show(chan, buf); 35 | } 36 | 37 | -- 38 | 2.17.1 39 | 40 | -------------------------------------------------------------------------------- /Patches_Following_Mainline_History/4.4.211/0088-mlxsw-Fixing-vlans-init-range.patch: -------------------------------------------------------------------------------- 1 | From 38e31dba8d3cd868b6643f2ef02bcd981ab85527 Mon Sep 17 00:00:00 2001 2 | From: Elad Raz 3 | Date: Wed, 6 Jan 2016 13:01:08 +0100 4 | Subject: mlxsw: Fixing vlans init range 5 | Reply-To: joseph.salisbury@microsoft.com 6 | 7 | Initialize VLANs 0..4095 (Remove init for VID 4096). 8 | 9 | Signed-off-by: Elad Raz 10 | Signed-off-by: Jiri Pirko 11 | Signed-off-by: David S. Miller 12 | (cherry picked from commit 29edf44f858a3f923c16f9f5b1aa790e44b8feb9) 13 | Signed-off-by: Joseph Salisbury 14 | --- 15 | drivers/net/ethernet/mellanox/mlxsw/spectrum_switchdev.c | 3 ++- 16 | 1 file changed, 2 insertions(+), 1 deletion(-) 17 | 18 | diff --git a/drivers/net/ethernet/mellanox/mlxsw/spectrum_switchdev.c b/drivers/net/ethernet/mellanox/mlxsw/spectrum_switchdev.c 19 | index 1ffe2dac84dd..d95ae4de39b1 100644 20 | --- a/drivers/net/ethernet/mellanox/mlxsw/spectrum_switchdev.c 21 | +++ b/drivers/net/ethernet/mellanox/mlxsw/spectrum_switchdev.c 22 | @@ -1209,7 +1209,8 @@ int mlxsw_sp_port_vlan_init(struct mlxsw_sp_port *mlxsw_sp_port) 23 | * with VID 1. 24 | */ 25 | mlxsw_sp_port->pvid = 1; 26 | - err = __mlxsw_sp_port_vlans_del(mlxsw_sp_port, 0, VLAN_N_VID, true); 27 | + err = __mlxsw_sp_port_vlans_del(mlxsw_sp_port, 0, VLAN_N_VID - 1, 28 | + true); 29 | if (err) { 30 | netdev_err(dev, "Unable to init VLANs\n"); 31 | return err; 32 | -- 33 | 2.17.1 34 | 35 | -------------------------------------------------------------------------------- /Patches_Following_Mainline_History/4.4.211/0786-hv_netvsc-avoid-unnecessary-wakeups-on-subchannel-cr.patch: -------------------------------------------------------------------------------- 1 | From a3edb9ee728ba67a17a739583e647e90fd81892b Mon Sep 17 00:00:00 2001 2 | From: Stephen Hemminger 3 | Date: Wed, 6 Sep 2017 13:53:06 -0700 4 | Subject: hv_netvsc: avoid unnecessary wakeups on subchannel creation 5 | Reply-To: joseph.salisbury@microsoft.com 6 | 7 | Only need to wakeup the initiator after all sub-channels 8 | are opened. 9 | 10 | Signed-off-by: Stephen Hemminger 11 | Signed-off-by: David S. Miller 12 | (backported from commit 8f2bb1de73344dbedd4195016b782bee7bf3598f) 13 | Signed-off-by: Joseph Salisbury 14 | --- 15 | drivers/net/hyperv/rndis_filter.c | 4 ++-- 16 | 1 file changed, 2 insertions(+), 2 deletions(-) 17 | 18 | diff --git a/drivers/net/hyperv/rndis_filter.c b/drivers/net/hyperv/rndis_filter.c 19 | index e204216e3dad..12f0d78e446f 100644 20 | --- a/drivers/net/hyperv/rndis_filter.c 21 | +++ b/drivers/net/hyperv/rndis_filter.c 22 | @@ -1049,8 +1049,8 @@ static void netvsc_sc_open(struct vmbus_channel *new_sc) 23 | else 24 | netdev_notice(ndev, "sub channel open failed: %d\n", ret); 25 | 26 | - if (refcount_dec_and_test(&nvscdev->sc_offered)) 27 | - complete(&nvscdev->channel_init_wait); 28 | + if (atomic_inc_return(&nvscdev->open_chn) == nvscdev->num_chn) 29 | + wake_up(&nvscdev->subchan_open); 30 | } 31 | 32 | /* Open sub-channels after completing the handling of the device probe. 33 | -- 34 | 2.17.1 35 | 36 | -------------------------------------------------------------------------------- /Patches_Following_Mainline_History/4.4.211/0843-vmbus-don-t-return-values-for-uninitalized-channels.patch: -------------------------------------------------------------------------------- 1 | From 5cb942db59bedd2420745e3f29abd9a7891548a8 Mon Sep 17 00:00:00 2001 2 | From: Stephen Hemminger 3 | Date: Mon, 20 Aug 2018 21:16:40 +0000 4 | Subject: vmbus: don't return values for uninitalized channels 5 | Reply-To: joseph.salisbury@microsoft.com 6 | 7 | For unsupported device types, the vmbus channel ringbuffer is never 8 | initialized, and therefore reading the sysfs files will return garbage 9 | or cause a kernel OOPS. 10 | 11 | Fixes: c2e5df616e1a ("vmbus: add per-channel sysfs info") 12 | 13 | Signed-off-by: Stephen Hemminger 14 | Signed-off-by: K. Y. Srinivasan 15 | Cc: # 4.15 16 | Signed-off-by: Greg Kroah-Hartman 17 | (cherry picked from commit 6712cc9c22117a8af9f3df272b4a44fd2e4201cd) 18 | Signed-off-by: Joseph Salisbury 19 | --- 20 | drivers/hv/vmbus_drv.c | 3 +++ 21 | 1 file changed, 3 insertions(+) 22 | 23 | diff --git a/drivers/hv/vmbus_drv.c b/drivers/hv/vmbus_drv.c 24 | index d582813b290d..5bb311291d45 100644 25 | --- a/drivers/hv/vmbus_drv.c 26 | +++ b/drivers/hv/vmbus_drv.c 27 | @@ -1072,6 +1072,9 @@ static ssize_t vmbus_chan_attr_show(struct kobject *kobj, 28 | if (!attribute->show) 29 | return -EIO; 30 | 31 | + if (chan->state != CHANNEL_OPENED_STATE) 32 | + return -EINVAL; 33 | + 34 | return attribute->show(chan, buf); 35 | } 36 | 37 | -- 38 | 2.17.1 39 | 40 | -------------------------------------------------------------------------------- /Patches_Following_Mainline_History/4.4.211/0846-netvsc-fix-rcu-dereference-warning-from-ethtool.patch: -------------------------------------------------------------------------------- 1 | From 37fe951029187ab7992313b2c9d07f28ef0819b6 Mon Sep 17 00:00:00 2001 2 | From: stephen hemminger 3 | Date: Wed, 7 Jun 2017 15:53:47 -0700 4 | Subject: netvsc: fix rcu dereference warning from ethtool 5 | Reply-To: joseph.salisbury@microsoft.com 6 | 7 | The ethtool info command calls the netvsc get_sset_count with RTNL 8 | but not with RCU. Which causes warning: 9 | 10 | drivers/net/hyperv/netvsc_drv.c:1010 suspicious rcu_dereference_check() usage! 11 | 12 | Signed-off-by: Stephen Hemminger 13 | Signed-off-by: David S. Miller 14 | (cherry picked from commit fbd4c7e768f1719bea340e40148800279d230922) 15 | Signed-off-by: Joseph Salisbury 16 | --- 17 | drivers/net/hyperv/netvsc_drv.c | 2 +- 18 | 1 file changed, 1 insertion(+), 1 deletion(-) 19 | 20 | diff --git a/drivers/net/hyperv/netvsc_drv.c b/drivers/net/hyperv/netvsc_drv.c 21 | index 888578d7db59..00fd7928ddb9 100644 22 | --- a/drivers/net/hyperv/netvsc_drv.c 23 | +++ b/drivers/net/hyperv/netvsc_drv.c 24 | @@ -1231,7 +1231,7 @@ static const struct { 25 | static int netvsc_get_sset_count(struct net_device *dev, int string_set) 26 | { 27 | struct net_device_context *ndc = netdev_priv(dev); 28 | - struct netvsc_device *nvdev = rcu_dereference(ndc->nvdev); 29 | + struct netvsc_device *nvdev = rtnl_dereference(ndc->nvdev); 30 | 31 | if (!nvdev) 32 | return -ENODEV; 33 | -- 34 | 2.17.1 35 | 36 | -------------------------------------------------------------------------------- /Patches_Following_Mainline_History/4.9.184/0117-vmbus-don-t-return-values-for-uninitalized-channels.patch: -------------------------------------------------------------------------------- 1 | From 4e828a925493df41851d237884976ef312381947 Mon Sep 17 00:00:00 2001 2 | From: Stephen Hemminger 3 | Date: Mon, 20 Aug 2018 21:16:40 +0000 4 | Subject: vmbus: don't return values for uninitalized channels 5 | Reply-To: joseph.salisbury@microsoft.com 6 | 7 | For unsupported device types, the vmbus channel ringbuffer is never 8 | initialized, and therefore reading the sysfs files will return garbage 9 | or cause a kernel OOPS. 10 | 11 | Fixes: c2e5df616e1a ("vmbus: add per-channel sysfs info") 12 | 13 | Signed-off-by: Stephen Hemminger 14 | Signed-off-by: K. Y. Srinivasan 15 | Cc: # 4.15 16 | Signed-off-by: Greg Kroah-Hartman 17 | (cherry picked from commit 6712cc9c22117a8af9f3df272b4a44fd2e4201cd) 18 | Signed-off-by: Joseph Salisbury 19 | --- 20 | drivers/hv/vmbus_drv.c | 3 +++ 21 | 1 file changed, 3 insertions(+) 22 | 23 | diff --git a/drivers/hv/vmbus_drv.c b/drivers/hv/vmbus_drv.c 24 | index b899f6b17e7c..3da8c72767b4 100644 25 | --- a/drivers/hv/vmbus_drv.c 26 | +++ b/drivers/hv/vmbus_drv.c 27 | @@ -1044,6 +1044,9 @@ static ssize_t vmbus_chan_attr_show(struct kobject *kobj, 28 | if (!attribute->show) 29 | return -EIO; 30 | 31 | + if (chan->state != CHANNEL_OPENED_STATE) 32 | + return -EINVAL; 33 | + 34 | return attribute->show(chan, buf); 35 | } 36 | 37 | -- 38 | 2.17.1 39 | 40 | -------------------------------------------------------------------------------- /Legacy/4.14/trace-vmbus_on_message.patch: -------------------------------------------------------------------------------- 1 | From 4c595020c7e550219b90c7943e225813c02c269c Mon Sep 17 00:00:00 2001 2 | From: Vitaly Kuznetsov 3 | Date: Thu, 5 Oct 2017 16:50:29 +0200 4 | Subject: [PATCH 09/71] hyper-v: trace vmbus_on_message() 5 | 6 | Add tracepoint to vmbus_on_message() which is called when we start 7 | processing a blocking from work context. 8 | 9 | Signed-off-by: Vitaly Kuznetsov 10 | --- 11 | drivers/hv/channel_mgmt.c | 2 ++ 12 | drivers/hv/hv_trace.h | 5 +++++ 13 | 2 files changed, 7 insertions(+) 14 | 15 | --- a/drivers/hv/channel_mgmt.c 2018-01-19 15:21:45.734048647 -0800 16 | +++ b/drivers/hv/channel_mgmt.c 2018-01-19 15:21:45.730048699 -0800 17 | @@ -1177,6 +1177,8 @@ void vmbus_onmessage(void *context) 18 | hdr = (struct vmbus_channel_message_header *)msg->u.payload; 19 | size = msg->header.payload_size; 20 | 21 | + trace_vmbus_on_message(hdr); 22 | + 23 | if (hdr->msgtype >= CHANNELMSG_COUNT) { 24 | pr_err("Received invalid channel message type %d size %d\n", 25 | hdr->msgtype, size); 26 | --- a/drivers/hv/hv_trace.h 2018-01-19 15:21:45.734048647 -0800 27 | +++ b/drivers/hv/hv_trace.h 2018-01-19 15:21:45.730048699 -0800 28 | @@ -19,6 +19,11 @@ DEFINE_EVENT(vmbus_hdr_msg, vmbus_on_msg 29 | TP_ARGS(hdr) 30 | ); 31 | 32 | +DEFINE_EVENT(vmbus_hdr_msg, vmbus_on_message, 33 | + TP_PROTO(const struct vmbus_channel_message_header *hdr), 34 | + TP_ARGS(hdr) 35 | +); 36 | + 37 | #undef TRACE_INCLUDE_PATH 38 | #define TRACE_INCLUDE_PATH . 39 | #undef TRACE_INCLUDE_FILE 40 | -------------------------------------------------------------------------------- /Patches_Following_Mainline_History/4.4.211/0052-mlxsw-spectrum-fix-some-error-handling.patch: -------------------------------------------------------------------------------- 1 | From 492049e7eecba24cab5fc77ab8eeb1bd2efa029a Mon Sep 17 00:00:00 2001 2 | From: Dan Carpenter 3 | Date: Wed, 9 Dec 2015 13:33:51 +0300 4 | Subject: mlxsw: spectrum: fix some error handling 5 | Reply-To: joseph.salisbury@microsoft.com 6 | 7 | The "err = " assignment is missing here. 8 | 9 | Fixes: 0d65fc13042f ('mlxsw: spectrum: Implement LAG port join/leave') 10 | Signed-off-by: Dan Carpenter 11 | Acked-by: Jiri Pirko 12 | Signed-off-by: David S. Miller 13 | (cherry picked from commit 82a06429ae215b39320e925dfae72419865d6029) 14 | Signed-off-by: Joseph Salisbury 15 | --- 16 | drivers/net/ethernet/mellanox/mlxsw/spectrum.c | 2 +- 17 | 1 file changed, 1 insertion(+), 1 deletion(-) 18 | 19 | diff --git a/drivers/net/ethernet/mellanox/mlxsw/spectrum.c b/drivers/net/ethernet/mellanox/mlxsw/spectrum.c 20 | index 6940762a6799..352923b765ae 100644 21 | --- a/drivers/net/ethernet/mellanox/mlxsw/spectrum.c 22 | +++ b/drivers/net/ethernet/mellanox/mlxsw/spectrum.c 23 | @@ -2092,7 +2092,7 @@ static int mlxsw_sp_port_lag_leave(struct mlxsw_sp_port *mlxsw_sp_port, 24 | err = mlxsw_sp_lag_col_port_disable(mlxsw_sp_port, lag_id); 25 | if (err) 26 | return err; 27 | - mlxsw_sp_lag_col_port_remove(mlxsw_sp_port, lag_id); 28 | + err = mlxsw_sp_lag_col_port_remove(mlxsw_sp_port, lag_id); 29 | if (err) 30 | return err; 31 | 32 | -- 33 | 2.17.1 34 | 35 | -------------------------------------------------------------------------------- /Patches_Following_Mainline_History/4.4.211/0054-net-mlx5-Fix-query-E-Switch-capabilities.patch: -------------------------------------------------------------------------------- 1 | From b700214a2ec225d808fd959c89857f0b94dd6d01 Mon Sep 17 00:00:00 2001 2 | From: Saeed Mahameed 3 | Date: Thu, 10 Dec 2015 17:12:37 +0200 4 | Subject: net/mlx5: Fix query E-Switch capabilities 5 | Reply-To: joseph.salisbury@microsoft.com 6 | 7 | E-Switch capabilities should be queried only if E-Switch flow table 8 | is supported and not only when vport group manager. 9 | 10 | Fixes: d6666753c6e8 ("net/mlx5: E-Switch, Introduce HCA cap and E-Switch vport context") 11 | Signed-off-by: Saeed Mahameed 12 | Signed-off-by: David S. Miller 13 | (cherry picked from commit 9bd0a185c2c48226a50e6e5b639edaa9e8ab6c51) 14 | Signed-off-by: Joseph Salisbury 15 | --- 16 | drivers/net/ethernet/mellanox/mlx5/core/fw.c | 2 +- 17 | 1 file changed, 1 insertion(+), 1 deletion(-) 18 | 19 | diff --git a/drivers/net/ethernet/mellanox/mlx5/core/fw.c b/drivers/net/ethernet/mellanox/mlx5/core/fw.c 20 | index 1c9f9a54a873..aa1ab4702385 100644 21 | --- a/drivers/net/ethernet/mellanox/mlx5/core/fw.c 22 | +++ b/drivers/net/ethernet/mellanox/mlx5/core/fw.c 23 | @@ -173,7 +173,7 @@ int mlx5_query_hca_caps(struct mlx5_core_dev *dev) 24 | return err; 25 | } 26 | 27 | - if (MLX5_CAP_GEN(dev, vport_group_manager)) { 28 | + if (MLX5_CAP_GEN(dev, eswitch_flow_table)) { 29 | err = mlx5_core_get_caps(dev, MLX5_CAP_ESWITCH, 30 | HCA_CAP_OPMOD_GET_CUR); 31 | if (err) 32 | -- 33 | 2.17.1 34 | 35 | -------------------------------------------------------------------------------- /Patches_Following_Mainline_History/4.4.211/0741-netvsc-force-link-update-after-MTU-change.patch: -------------------------------------------------------------------------------- 1 | From 9c71c36ae968465fe2397e82b8bccb3e8908bb66 Mon Sep 17 00:00:00 2001 2 | From: stephen hemminger 3 | Date: Wed, 19 Jul 2017 11:53:12 -0700 4 | Subject: netvsc: force link update after MTU change 5 | Reply-To: joseph.salisbury@microsoft.com 6 | 7 | If two MTU changes are in less than update interval (2 seconds), 8 | then the netvsc network device may get stuck with no carrier. 9 | 10 | The netvsc driver debounces link status events which is fine 11 | for unsolicited updates, but blocks getting the update after 12 | down/up from MTU reinitialization. 13 | 14 | Signed-off-by: Stephen Hemminger 15 | Signed-off-by: David S. Miller 16 | (cherry picked from commit 1b01994aa6f9bad60d2b162c17dca530c21e2687) 17 | Signed-off-by: Joseph Salisbury 18 | --- 19 | drivers/net/hyperv/netvsc_drv.c | 1 + 20 | 1 file changed, 1 insertion(+) 21 | 22 | diff --git a/drivers/net/hyperv/netvsc_drv.c b/drivers/net/hyperv/netvsc_drv.c 23 | index 9a01d4962baa..1ac7a08458e8 100644 24 | --- a/drivers/net/hyperv/netvsc_drv.c 25 | +++ b/drivers/net/hyperv/netvsc_drv.c 26 | @@ -732,6 +732,7 @@ static int netvsc_set_channels(struct net_device *net, 27 | ret = netvsc_open(net); 28 | 29 | /* We may have missed link change notifications */ 30 | + net_device_ctx->last_reconfig = 0; 31 | schedule_delayed_work(&net_device_ctx->dwork, 0); 32 | 33 | return ret; 34 | -- 35 | 2.17.1 36 | 37 | -------------------------------------------------------------------------------- /Patches_Following_Mainline_History/4.4.211/0814-hv_netvsc-fix-error-unwind-handling-if-vmbus_open-fa.patch: -------------------------------------------------------------------------------- 1 | From 19605024ba5f925ce4a652cafce9f890d8ee3b7a Mon Sep 17 00:00:00 2001 2 | From: Stephen Hemminger 3 | Date: Fri, 2 Mar 2018 13:49:03 -0800 4 | Subject: hv_netvsc: fix error unwind handling if vmbus_open fails 5 | Reply-To: joseph.salisbury@microsoft.com 6 | 7 | Need to delete NAPI association if vmbus_open fails. 8 | 9 | Signed-off-by: Stephen Hemminger 10 | Signed-off-by: David S. Miller 11 | (cherry picked from commit fcfb4a00d1e514e8313277a01ef919de1113025b) 12 | Signed-off-by: Joseph Salisbury 13 | --- 14 | drivers/net/hyperv/netvsc.c | 2 +- 15 | 1 file changed, 1 insertion(+), 1 deletion(-) 16 | 17 | diff --git a/drivers/net/hyperv/netvsc.c b/drivers/net/hyperv/netvsc.c 18 | index 3334188d3583..d58201f816fb 100644 19 | --- a/drivers/net/hyperv/netvsc.c 20 | +++ b/drivers/net/hyperv/netvsc.c 21 | @@ -1298,7 +1298,6 @@ struct netvsc_device *netvsc_device_add(struct hv_device *device, 22 | net_device->chan_table); 23 | 24 | if (ret != 0) { 25 | - netif_napi_del(&net_device->chan_table[0].napi); 26 | netdev_err(ndev, "unable to open channel: %d\n", ret); 27 | goto cleanup; 28 | } 29 | @@ -1331,6 +1330,7 @@ close: 30 | vmbus_close(device->channel); 31 | 32 | cleanup: 33 | + netif_napi_del(&net_device->chan_table[0].napi); 34 | free_netvsc_device(&net_device->rcu); 35 | 36 | return ERR_PTR(ret); 37 | -- 38 | 2.17.1 39 | 40 | -------------------------------------------------------------------------------- /Legacy/4.13/hyper-v-trace-vmbus_on_message.patch: -------------------------------------------------------------------------------- 1 | From 0f209e14c282d3387dc33726911d0a6da2c05f53 Mon Sep 17 00:00:00 2001 2 | From: Vitaly Kuznetsov 3 | Date: Thu, 5 Oct 2017 16:50:29 +0200 4 | Subject: [PATCH 107/156] hyper-v: trace vmbus_on_message() 5 | 6 | Add tracepoint to vmbus_on_message() which is called when we start 7 | processing a blocking from work context. 8 | 9 | Signed-off-by: Vitaly Kuznetsov 10 | --- 11 | drivers/hv/channel_mgmt.c | 2 ++ 12 | drivers/hv/hv_trace.h | 5 +++++ 13 | 2 files changed, 7 insertions(+) 14 | 15 | --- a/drivers/hv/channel_mgmt.c 2017-12-05 16:55:47.278663028 -0800 16 | +++ b/drivers/hv/channel_mgmt.c 2017-12-05 16:55:47.274663079 -0800 17 | @@ -1173,6 +1173,8 @@ void vmbus_onmessage(void *context) 18 | hdr = (struct vmbus_channel_message_header *)msg->u.payload; 19 | size = msg->header.payload_size; 20 | 21 | + trace_vmbus_on_message(hdr); 22 | + 23 | if (hdr->msgtype >= CHANNELMSG_COUNT) { 24 | pr_err("Received invalid channel message type %d size %d\n", 25 | hdr->msgtype, size); 26 | --- a/drivers/hv/hv_trace.h 2017-12-05 16:55:47.278663028 -0800 27 | +++ b/drivers/hv/hv_trace.h 2017-12-05 16:55:47.274663079 -0800 28 | @@ -19,6 +19,11 @@ DEFINE_EVENT(vmbus_hdr_msg, vmbus_on_msg 29 | TP_ARGS(hdr) 30 | ); 31 | 32 | +DEFINE_EVENT(vmbus_hdr_msg, vmbus_on_message, 33 | + TP_PROTO(const struct vmbus_channel_message_header *hdr), 34 | + TP_ARGS(hdr) 35 | +); 36 | + 37 | #undef TRACE_INCLUDE_PATH 38 | #define TRACE_INCLUDE_PATH . 39 | #undef TRACE_INCLUDE_FILE 40 | -------------------------------------------------------------------------------- /Patches_Following_Mainline_History/4.4.211/0362-net-mlx5_core-Fix-caching-ATOMIC-endian-mode-capabil.patch: -------------------------------------------------------------------------------- 1 | From 6ea2dacede42469afc136f3e55252dff0b2878d3 Mon Sep 17 00:00:00 2001 2 | From: Leon Romanovsky 3 | Date: Tue, 23 Feb 2016 10:25:21 +0200 4 | Subject: net/mlx5_core: Fix caching ATOMIC endian mode capability 5 | Reply-To: joseph.salisbury@microsoft.com 6 | 7 | Add caching of maximum device capability of ATOMIC endian mode. 8 | 9 | Fixes: f91e6d8941bf ('net/mlx5_core: Add setting ATOMIC endian mode') 10 | Signed-off-by: Leon Romanovsky 11 | Reviewed-by: Saeed Mahameed 12 | Signed-off-by: Doug Ledford 13 | (cherry picked from commit 91d9ed8443b88cc50b81cf5ec900172515270f6f) 14 | Signed-off-by: Joseph Salisbury 15 | --- 16 | drivers/net/ethernet/mellanox/mlx5/core/main.c | 4 ++++ 17 | 1 file changed, 4 insertions(+) 18 | 19 | diff --git a/drivers/net/ethernet/mellanox/mlx5/core/main.c b/drivers/net/ethernet/mellanox/mlx5/core/main.c 20 | index 08742895785a..8c154f2ef923 100644 21 | --- a/drivers/net/ethernet/mellanox/mlx5/core/main.c 22 | +++ b/drivers/net/ethernet/mellanox/mlx5/core/main.c 23 | @@ -424,6 +424,10 @@ static int handle_hca_cap_atomic(struct mlx5_core_dev *dev) 24 | HCA_CAP_OPMOD_GET_CUR); 25 | if (err) 26 | return err; 27 | + err = mlx5_core_get_caps(dev, MLX5_CAP_ATOMIC, 28 | + HCA_CAP_OPMOD_GET_MAX); 29 | + if (err) 30 | + return err; 31 | } else { 32 | return 0; 33 | } 34 | -- 35 | 2.17.1 36 | 37 | -------------------------------------------------------------------------------- /Legacy/4.15/0045-Make-a-few-key-drivers-probe-asynchronous.patch: -------------------------------------------------------------------------------- 1 | From 3429c697d41ba079aef77e96d34f36b34d48f96b Mon Sep 17 00:00:00 2001 2 | From: Arjan van de Ven 3 | Date: Thu, 21 Jul 2016 13:52:44 -0500 4 | Subject: [PATCH 45/55] Make a few key drivers probe asynchronous 5 | 6 | To help boot time, several drivers can safely be marked for probing asynchronously... 7 | 8 | Signed-off-by: Sasha Levin 9 | --- 10 | drivers/net/ethernet/intel/e1000e/netdev.c | 1 + 11 | sound/pci/hda/hda_intel.c | 1 + 12 | 2 files changed, 2 insertions(+) 13 | 14 | diff --git a/drivers/net/ethernet/intel/e1000e/netdev.c b/drivers/net/ethernet/intel/e1000e/netdev.c 15 | index 61030234d2c7..4e1ced6ea4ab 100644 16 | --- a/drivers/net/ethernet/intel/e1000e/netdev.c 17 | +++ b/drivers/net/ethernet/intel/e1000e/netdev.c 18 | @@ -7587,6 +7587,7 @@ static struct pci_driver e1000_driver = { 19 | .remove = e1000_remove, 20 | .driver = { 21 | .pm = &e1000_pm_ops, 22 | + .probe_type = PROBE_PREFER_ASYNCHRONOUS, 23 | }, 24 | .shutdown = e1000_shutdown, 25 | .err_handler = &e1000_err_handler 26 | diff --git a/sound/pci/hda/hda_intel.c b/sound/pci/hda/hda_intel.c 27 | index c71dcacea807..ec2a84d9cd9b 100644 28 | --- a/sound/pci/hda/hda_intel.c 29 | +++ b/sound/pci/hda/hda_intel.c 30 | @@ -2613,6 +2613,7 @@ static struct pci_driver azx_driver = { 31 | .shutdown = azx_shutdown, 32 | .driver = { 33 | .pm = AZX_PM_OPS, 34 | + .probe_type = PROBE_PREFER_ASYNCHRONOUS, 35 | }, 36 | }; 37 | 38 | -- 39 | 2.14.1 40 | 41 | -------------------------------------------------------------------------------- /Legacy/4.13/hv_netvsc-make-const-array-ver_list-static-reduces-o.patch: -------------------------------------------------------------------------------- 1 | From 9bad8caa5b93021a1424fa668ba7feccd6136f75 Mon Sep 17 00:00:00 2001 2 | From: Colin Ian King 3 | Date: Fri, 22 Sep 2017 16:50:23 +0100 4 | Subject: [PATCH 123/156] hv_netvsc: make const array ver_list static, reduces 5 | object code size 6 | 7 | Don't populate const array ver_list on the stack, instead make it 8 | static. Makes the object code smaller by over 400 bytes: 9 | 10 | Before: 11 | text data bss dec hex filename 12 | 18444 3168 320 21932 55ac drivers/net/hyperv/netvsc.o 13 | 14 | After: 15 | text data bss dec hex filename 16 | 17950 3224 320 21494 53f6 drivers/net/hyperv/netvsc.o 17 | 18 | (gcc 6.3.0, x86-64) 19 | 20 | Signed-off-by: Colin Ian King 21 | Reviewed-by: Haiyang Zhang 22 | Signed-off-by: David S. Miller 23 | --- 24 | drivers/net/hyperv/netvsc.c | 2 +- 25 | 1 file changed, 1 insertion(+), 1 deletion(-) 26 | 27 | --- a/drivers/net/hyperv/netvsc.c 2017-12-05 16:55:50.486621854 -0800 28 | +++ b/drivers/net/hyperv/netvsc.c 2017-12-05 16:55:50.482621905 -0800 29 | @@ -485,7 +485,7 @@ static int netvsc_connect_vsp(struct hv_ 30 | struct netvsc_device *net_device, 31 | const struct netvsc_device_info *device_info) 32 | { 33 | - const u32 ver_list[] = { 34 | + static const u32 ver_list[] = { 35 | NVSP_PROTOCOL_VERSION_1, NVSP_PROTOCOL_VERSION_2, 36 | NVSP_PROTOCOL_VERSION_4, NVSP_PROTOCOL_VERSION_5 37 | }; 38 | -------------------------------------------------------------------------------- /Legacy/4.14/hv_netvsc-make-const-array-ver_list-static-reduces-o.patch: -------------------------------------------------------------------------------- 1 | From f053a6aa0ca16e3d5a9e51ca2d1552427246ee7c Mon Sep 17 00:00:00 2001 2 | From: Colin Ian King 3 | Date: Fri, 22 Sep 2017 16:50:23 +0100 4 | Subject: [PATCH 25/71] hv_netvsc: make const array ver_list static, reduces 5 | object code size 6 | 7 | Don't populate const array ver_list on the stack, instead make it 8 | static. Makes the object code smaller by over 400 bytes: 9 | 10 | Before: 11 | text data bss dec hex filename 12 | 18444 3168 320 21932 55ac drivers/net/hyperv/netvsc.o 13 | 14 | After: 15 | text data bss dec hex filename 16 | 17950 3224 320 21494 53f6 drivers/net/hyperv/netvsc.o 17 | 18 | (gcc 6.3.0, x86-64) 19 | 20 | Signed-off-by: Colin Ian King 21 | Reviewed-by: Haiyang Zhang 22 | Signed-off-by: David S. Miller 23 | --- 24 | drivers/net/hyperv/netvsc.c | 2 +- 25 | 1 file changed, 1 insertion(+), 1 deletion(-) 26 | 27 | --- a/drivers/net/hyperv/netvsc.c 2018-01-19 15:22:24.369532278 -0800 28 | +++ b/drivers/net/hyperv/netvsc.c 2018-01-19 15:22:24.365532333 -0800 29 | @@ -484,7 +484,7 @@ static int netvsc_connect_vsp(struct hv_ 30 | struct netvsc_device *net_device, 31 | const struct netvsc_device_info *device_info) 32 | { 33 | - const u32 ver_list[] = { 34 | + static const u32 ver_list[] = { 35 | NVSP_PROTOCOL_VERSION_1, NVSP_PROTOCOL_VERSION_2, 36 | NVSP_PROTOCOL_VERSION_4, NVSP_PROTOCOL_VERSION_5 37 | }; 38 | -------------------------------------------------------------------------------- /Patches_Following_Mainline_History/4.4.211/0681-Drivers-hv-restore-TSC-page-cleanup-before-kexec.patch: -------------------------------------------------------------------------------- 1 | From d7c2d4bebdd82907102c2076968431a8002de280 Mon Sep 17 00:00:00 2001 2 | From: Vitaly Kuznetsov 3 | Date: Sat, 28 Jan 2017 12:37:15 -0700 4 | Subject: Drivers: hv: restore TSC page cleanup before kexec 5 | Reply-To: joseph.salisbury@microsoft.com 6 | 7 | We need to cleanup the TSC page before doing kexec/kdump or the new kernel 8 | may crash if it tries to use it. 9 | 10 | Fixes: 63ed4e0c67df ("Drivers: hv: vmbus: Consolidate all Hyper-V specific clocksource code") 11 | Signed-off-by: Vitaly Kuznetsov 12 | Signed-off-by: K. Y. Srinivasan 13 | Signed-off-by: Greg Kroah-Hartman 14 | (cherry picked from commit 5647dbf8f0807a35421bd0232247b02413ef2cab) 15 | Signed-off-by: Joseph Salisbury 16 | --- 17 | arch/x86/hyperv/hv_init.c | 4 ++++ 18 | 1 file changed, 4 insertions(+) 19 | 20 | diff --git a/arch/x86/hyperv/hv_init.c b/arch/x86/hyperv/hv_init.c 21 | index d6b018b86c42..b371d0e984a9 100644 22 | --- a/arch/x86/hyperv/hv_init.c 23 | +++ b/arch/x86/hyperv/hv_init.c 24 | @@ -178,6 +178,10 @@ void hyperv_cleanup(void) 25 | /* Reset the hypercall page */ 26 | hypercall_msr.as_uint64 = 0; 27 | wrmsrl(HV_X64_MSR_HYPERCALL, hypercall_msr.as_uint64); 28 | + 29 | + /* Reset the TSC page */ 30 | + hypercall_msr.as_uint64 = 0; 31 | + wrmsrl(HV_X64_MSR_REFERENCE_TSC, hypercall_msr.as_uint64); 32 | } 33 | EXPORT_SYMBOL_GPL(hyperv_cleanup); 34 | 35 | -- 36 | 2.17.1 37 | 38 | -------------------------------------------------------------------------------- /Patches_Following_Mainline_History/4.9.184/0028-Drivers-hv-restore-TSC-page-cleanup-before-kexec.patch: -------------------------------------------------------------------------------- 1 | From 09ef1b60e5a8fb79b70f33d0f6fbd88ee1e54bd0 Mon Sep 17 00:00:00 2001 2 | From: Vitaly Kuznetsov 3 | Date: Sat, 28 Jan 2017 12:37:15 -0700 4 | Subject: Drivers: hv: restore TSC page cleanup before kexec 5 | Reply-To: joseph.salisbury@microsoft.com 6 | 7 | We need to cleanup the TSC page before doing kexec/kdump or the new kernel 8 | may crash if it tries to use it. 9 | 10 | Fixes: 63ed4e0c67df ("Drivers: hv: vmbus: Consolidate all Hyper-V specific clocksource code") 11 | Signed-off-by: Vitaly Kuznetsov 12 | Signed-off-by: K. Y. Srinivasan 13 | Signed-off-by: Greg Kroah-Hartman 14 | (cherry picked from commit 5647dbf8f0807a35421bd0232247b02413ef2cab) 15 | Signed-off-by: Joseph Salisbury 16 | --- 17 | arch/x86/hyperv/hv_init.c | 4 ++++ 18 | 1 file changed, 4 insertions(+) 19 | 20 | diff --git a/arch/x86/hyperv/hv_init.c b/arch/x86/hyperv/hv_init.c 21 | index d6b018b86c42..b371d0e984a9 100644 22 | --- a/arch/x86/hyperv/hv_init.c 23 | +++ b/arch/x86/hyperv/hv_init.c 24 | @@ -178,6 +178,10 @@ void hyperv_cleanup(void) 25 | /* Reset the hypercall page */ 26 | hypercall_msr.as_uint64 = 0; 27 | wrmsrl(HV_X64_MSR_HYPERCALL, hypercall_msr.as_uint64); 28 | + 29 | + /* Reset the TSC page */ 30 | + hypercall_msr.as_uint64 = 0; 31 | + wrmsrl(HV_X64_MSR_REFERENCE_TSC, hypercall_msr.as_uint64); 32 | } 33 | EXPORT_SYMBOL_GPL(hyperv_cleanup); 34 | 35 | -- 36 | 2.17.1 37 | 38 | -------------------------------------------------------------------------------- /Legacy/4.13/vmbus-suppress-uevents-for-hv_sock-devices.patch: -------------------------------------------------------------------------------- 1 | From 833a82c49e60ceda5b73861bb58d7c7acde6a9f8 Mon Sep 17 00:00:00 2001 2 | From: Dexuan Cui 3 | Date: Wed, 16 Aug 2017 03:39:17 +0000 4 | Subject: [PATCH 79/98] vmbus: suppress uevents for hv_sock devices 5 | 6 | hv_sock driver is automatically loaded when an application creates an 7 | AF_VSOCK socket, so we don't really need to trigger uevents to the user 8 | space udevd. 9 | 10 | And hv_sock devices can appear and disappear frequency, e.g. 100 per 11 | second, so triggering the udevents can cause a high cpu utilization of 12 | udevd, e.g. 30% on a 2-cpu virtual machine. So let's suppress the 13 | uevents to avoid this. 14 | 15 | Signed-off-by: Dexuan Cui 16 | Cc: K. Y. Srinivasan 17 | Cc: Haiyang Zhang 18 | Cc: Stephen Hemminger 19 | --- 20 | drivers/hv/vmbus_drv.c | 2 ++ 21 | 1 file changed, 2 insertions(+) 22 | 23 | --- a/drivers/hv/vmbus_drv.c 2017-12-05 16:23:29.847761940 -0800 24 | +++ b/drivers/hv/vmbus_drv.c 2017-12-05 16:23:29.843761990 -0800 25 | @@ -1173,6 +1173,8 @@ int vmbus_device_register(struct hv_devi 26 | child_device_obj->device.parent = &hv_acpi_dev->dev; 27 | child_device_obj->device.release = vmbus_device_release; 28 | 29 | + if (is_hvsock_channel(child_device_obj->channel)) 30 | + dev_set_uevent_suppress(&child_device_obj->device, 1); 31 | /* 32 | * Register with the LDM. This will kick off the driver/device 33 | * binding...which will eventually call vmbus_match() and vmbus_probe() 34 | -------------------------------------------------------------------------------- /Patches_Following_Mainline_History/4.14.141/0010-hv_netvsc-fix-race-in-napi-poll-when-rescheduling.patch: -------------------------------------------------------------------------------- 1 | From c9e95afe26fafcbd91aa350fd5f360c514e20797 Mon Sep 17 00:00:00 2001 2 | From: Stephen Hemminger 3 | Date: Fri, 2 Mar 2018 13:49:05 -0800 4 | Subject: hv_netvsc: fix race in napi poll when rescheduling 5 | Reply-To: joseph.salisbury@microsoft.com 6 | 7 | There is a race between napi_reschedule and re-enabling interrupts 8 | which could lead to missed host interrrupts. This occurs when 9 | interrupts are re-enabled (hv_end_read) and vmbus irq callback 10 | (netvsc_channel_cb) has already scheduled NAPI. 11 | 12 | Signed-off-by: Stephen Hemminger 13 | Signed-off-by: David S. Miller 14 | (backported from commit d64e38ae690e3337db0d38d9b149a193a1646c4b) 15 | Signed-off-by: Joseph Salisbury 16 | --- 17 | drivers/net/hyperv/netvsc.c | 2 +- 18 | 1 file changed, 1 insertion(+), 1 deletion(-) 19 | 20 | diff --git a/drivers/net/hyperv/netvsc.c b/drivers/net/hyperv/netvsc.c 21 | index c5b409e21e27..025895ebe9fb 100644 22 | --- a/drivers/net/hyperv/netvsc.c 23 | +++ b/drivers/net/hyperv/netvsc.c 24 | @@ -1281,7 +1281,7 @@ int netvsc_poll(struct napi_struct *napi, int budget) 25 | */ 26 | if (work_done < budget && 27 | napi_complete_done(napi, work_done) && 28 | - (ret || hv_end_read(&channel->inbound)) && 29 | + hv_end_read(&channel->inbound) && 30 | napi_schedule_prep(napi)) { 31 | hv_begin_read(&channel->inbound); 32 | __napi_schedule(napi); 33 | -- 34 | 2.17.1 35 | 36 | -------------------------------------------------------------------------------- /Patches_Following_Mainline_History/4.4.211/0178-mlxsw-Treat-local-port-64-as-valid.patch: -------------------------------------------------------------------------------- 1 | From 83878576749475f6f69941d12884016b3b825d34 Mon Sep 17 00:00:00 2001 2 | From: Ido Schimmel 3 | Date: Mon, 15 Feb 2016 13:19:53 +0100 4 | Subject: mlxsw: Treat local port 64 as valid 5 | Reply-To: joseph.salisbury@microsoft.com 6 | 7 | MLXSW_PORT_MAX_PORTS represents the maximum number of local ports, which 8 | is 65 for both ASICs (SwitchX-2 and Spectrum) supported by this driver. 9 | 10 | Fixes: 93c1edb27f9e ("mlxsw: Introduce Mellanox switch driver core") 11 | Signed-off-by: Ido Schimmel 12 | Signed-off-by: Jiri Pirko 13 | Signed-off-by: David S. Miller 14 | (cherry picked from commit 1e5ad30c649a82a062ce79a87c1296e6c6f328c2) 15 | Signed-off-by: Joseph Salisbury 16 | --- 17 | drivers/net/ethernet/mellanox/mlxsw/port.h | 2 +- 18 | 1 file changed, 1 insertion(+), 1 deletion(-) 19 | 20 | diff --git a/drivers/net/ethernet/mellanox/mlxsw/port.h b/drivers/net/ethernet/mellanox/mlxsw/port.h 21 | index 726f5435b32f..ae65b9940aed 100644 22 | --- a/drivers/net/ethernet/mellanox/mlxsw/port.h 23 | +++ b/drivers/net/ethernet/mellanox/mlxsw/port.h 24 | @@ -49,7 +49,7 @@ 25 | #define MLXSW_PORT_MID 0xd000 26 | 27 | #define MLXSW_PORT_MAX_PHY_PORTS 0x40 28 | -#define MLXSW_PORT_MAX_PORTS MLXSW_PORT_MAX_PHY_PORTS 29 | +#define MLXSW_PORT_MAX_PORTS (MLXSW_PORT_MAX_PHY_PORTS + 1) 30 | 31 | #define MLXSW_PORT_DEVID_BITS_OFFSET 10 32 | #define MLXSW_PORT_PHY_BITS_OFFSET 4 33 | -- 34 | 2.17.1 35 | 36 | -------------------------------------------------------------------------------- /Patches_Following_Mainline_History/4.4.211/0819-hv_netvsc-fix-locking-during-VF-setup.patch: -------------------------------------------------------------------------------- 1 | From 94fcfe362e23ce6040ee9793ff50c289af68b36d Mon Sep 17 00:00:00 2001 2 | From: Stephen Hemminger 3 | Date: Wed, 7 Mar 2018 13:49:12 -0800 4 | Subject: hv_netvsc: fix locking during VF setup 5 | Reply-To: joseph.salisbury@microsoft.com 6 | 7 | The dev_uc/mc_sync calls need to have the device address list 8 | locked. This was spotted by running with lockdep enabled. 9 | 10 | Fixes: bee9d41b37ea ("hv_netvsc: propagate rx filters to VF") 11 | Signed-off-by: Stephen Hemminger 12 | Signed-off-by: David S. Miller 13 | (cherry picked from commit b0dee7910317f41f398838992516af6a3b981d86) 14 | Signed-off-by: Joseph Salisbury 15 | --- 16 | drivers/net/hyperv/netvsc_drv.c | 4 ++++ 17 | 1 file changed, 4 insertions(+) 18 | 19 | diff --git a/drivers/net/hyperv/netvsc_drv.c b/drivers/net/hyperv/netvsc_drv.c 20 | index 8eda926e981d..d619cff93abb 100644 21 | --- a/drivers/net/hyperv/netvsc_drv.c 22 | +++ b/drivers/net/hyperv/netvsc_drv.c 23 | @@ -1826,8 +1826,12 @@ static void __netvsc_vf_setup(struct net_device *ndev, 24 | 25 | /* set multicast etc flags on VF */ 26 | dev_change_flags(vf_netdev, ndev->flags | IFF_SLAVE); 27 | + 28 | + /* sync address list from ndev to VF */ 29 | + netif_addr_lock_bh(ndev); 30 | dev_uc_sync(vf_netdev, ndev); 31 | dev_mc_sync(vf_netdev, ndev); 32 | + netif_addr_unlock_bh(ndev); 33 | 34 | if (netif_running(ndev)) { 35 | ret = dev_open(vf_netdev); 36 | -- 37 | 2.17.1 38 | 39 | -------------------------------------------------------------------------------- /Patches_Following_Mainline_History/4.9.184/0118-hv_netvsc-fix-locking-during-VF-setup.patch: -------------------------------------------------------------------------------- 1 | From 6f8a085f169b6e4a1f1f6980e10cd051200c3fdb Mon Sep 17 00:00:00 2001 2 | From: Stephen Hemminger 3 | Date: Wed, 7 Mar 2018 13:49:12 -0800 4 | Subject: hv_netvsc: fix locking during VF setup 5 | Reply-To: joseph.salisbury@microsoft.com 6 | 7 | The dev_uc/mc_sync calls need to have the device address list 8 | locked. This was spotted by running with lockdep enabled. 9 | 10 | Fixes: bee9d41b37ea ("hv_netvsc: propagate rx filters to VF") 11 | Signed-off-by: Stephen Hemminger 12 | Signed-off-by: David S. Miller 13 | (cherry picked from commit b0dee7910317f41f398838992516af6a3b981d86) 14 | Signed-off-by: Joseph Salisbury 15 | --- 16 | drivers/net/hyperv/netvsc_drv.c | 4 ++++ 17 | 1 file changed, 4 insertions(+) 18 | 19 | diff --git a/drivers/net/hyperv/netvsc_drv.c b/drivers/net/hyperv/netvsc_drv.c 20 | index 70ab6ebd171d..584038ce04f7 100644 21 | --- a/drivers/net/hyperv/netvsc_drv.c 22 | +++ b/drivers/net/hyperv/netvsc_drv.c 23 | @@ -1883,8 +1883,12 @@ static void __netvsc_vf_setup(struct net_device *ndev, 24 | 25 | /* set multicast etc flags on VF */ 26 | dev_change_flags(vf_netdev, ndev->flags | IFF_SLAVE); 27 | + 28 | + /* sync address list from ndev to VF */ 29 | + netif_addr_lock_bh(ndev); 30 | dev_uc_sync(vf_netdev, ndev); 31 | dev_mc_sync(vf_netdev, ndev); 32 | + netif_addr_unlock_bh(ndev); 33 | 34 | if (netif_running(ndev)) { 35 | ret = dev_open(vf_netdev); 36 | -- 37 | 2.17.1 38 | 39 | -------------------------------------------------------------------------------- /Legacy/4.13/netvsc-change-order-of-steps-in-setting-queues.patch: -------------------------------------------------------------------------------- 1 | From 84db1632432365e94981eb63ab3726e5d5fe66e0 Mon Sep 17 00:00:00 2001 2 | From: stephen hemminger 3 | Date: Wed, 19 Jul 2017 11:53:14 -0700 4 | Subject: [PATCH 32/98] netvsc: change order of steps in setting queues 5 | 6 | This fixes the error unwind logic for incorrect number of queues. 7 | If netif_set_real_num_XX_queues failed then rndis_filter_device_add 8 | would have been called twice. Since input arguments are already 9 | ranged checked this is a hypothetical only problem, not possible 10 | in actual code. 11 | 12 | Signed-off-by: Stephen Hemminger 13 | Signed-off-by: David S. Miller 14 | --- 15 | drivers/net/hyperv/netvsc_drv.c | 8 +++----- 16 | 1 file changed, 3 insertions(+), 5 deletions(-) 17 | 18 | --- a/drivers/net/hyperv/netvsc_drv.c 2017-10-05 14:20:50.131507508 -0700 19 | +++ b/drivers/net/hyperv/netvsc_drv.c 2017-10-05 14:20:50.131507508 -0700 20 | @@ -747,17 +747,15 @@ static int netvsc_set_queues(struct net_ 21 | device_info.ring_size = ring_size; 22 | device_info.max_num_vrss_chns = num_chn; 23 | 24 | - ret = rndis_filter_device_add(dev, &device_info); 25 | - if (ret) 26 | - return ret; 27 | - 28 | ret = netif_set_real_num_tx_queues(net, num_chn); 29 | if (ret) 30 | return ret; 31 | 32 | ret = netif_set_real_num_rx_queues(net, num_chn); 33 | + if (ret) 34 | + return ret; 35 | 36 | - return ret; 37 | + return rndis_filter_device_add(dev, &device_info); 38 | } 39 | 40 | static int netvsc_set_channels(struct net_device *net, 41 | -------------------------------------------------------------------------------- /Patches_Following_Mainline_History/4.4.211/0338-mlxsw-spectrum-Mark-unused-ports-using-NULL.patch: -------------------------------------------------------------------------------- 1 | From 39cad4ed6b1a5ccab8be076c923bdc5da91330e2 Mon Sep 17 00:00:00 2001 2 | From: Ido Schimmel 3 | Date: Fri, 26 Feb 2016 17:32:30 +0100 4 | Subject: mlxsw: spectrum: Mark unused ports using NULL 5 | Reply-To: joseph.salisbury@microsoft.com 6 | 7 | When splitting and unsplitting we'll destroy usable ports on the fly, so 8 | mark them using a NULL pointer to indicate that their local port number 9 | is free and can be re-used. 10 | 11 | Signed-off-by: Ido Schimmel 12 | Signed-off-by: Jiri Pirko 13 | Signed-off-by: David S. Miller 14 | (cherry picked from commit a133318cde2000a3264032ea3b561c9054613486) 15 | Signed-off-by: Joseph Salisbury 16 | --- 17 | drivers/net/ethernet/mellanox/mlxsw/spectrum.c | 1 + 18 | 1 file changed, 1 insertion(+) 19 | 20 | diff --git a/drivers/net/ethernet/mellanox/mlxsw/spectrum.c b/drivers/net/ethernet/mellanox/mlxsw/spectrum.c 21 | index 771b8844001b..d570bc2a987c 100644 22 | --- a/drivers/net/ethernet/mellanox/mlxsw/spectrum.c 23 | +++ b/drivers/net/ethernet/mellanox/mlxsw/spectrum.c 24 | @@ -1519,6 +1519,7 @@ static void mlxsw_sp_port_remove(struct mlxsw_sp *mlxsw_sp, u8 local_port) 25 | 26 | if (!mlxsw_sp_port) 27 | return; 28 | + mlxsw_sp->ports[local_port] = NULL; 29 | devlink_port = &mlxsw_sp_port->devlink_port; 30 | devlink_port_type_clear(devlink_port); 31 | unregister_netdev(mlxsw_sp_port->dev); /* This calls ndo_stop */ 32 | -- 33 | 2.17.1 34 | 35 | -------------------------------------------------------------------------------- /Legacy/4.13/netvsc-prefetch-the-first-incoming-ring-element.patch: -------------------------------------------------------------------------------- 1 | From 30d9604e01d382373ad93f8e73f40ce5fe154075 Mon Sep 17 00:00:00 2001 2 | From: Stephen Hemminger 3 | Date: Wed, 19 Apr 2017 08:45:37 -0700 4 | Subject: [PATCH 29/98] netvsc: prefetch the first incoming ring element 5 | 6 | In interrupt handler, prefetch the first incoming ring element 7 | so that it is in cache by the time NAPI poll gets to it. 8 | 9 | Signed-off-by: Stephen Hemminger 10 | --- 11 | drivers/net/hyperv/netvsc.c | 9 ++++++++- 12 | 1 file changed, 8 insertions(+), 1 deletion(-) 13 | 14 | --- a/drivers/net/hyperv/netvsc.c 2017-10-05 14:20:49.815503614 -0700 15 | +++ b/drivers/net/hyperv/netvsc.c 2017-10-05 14:20:49.815503614 -0700 16 | @@ -29,6 +29,8 @@ 17 | #include 18 | #include 19 | #include 20 | +#include 21 | + 22 | #include 23 | 24 | #include "hyperv_net.h" 25 | @@ -1258,10 +1260,15 @@ int netvsc_poll(struct napi_struct *napi 26 | void netvsc_channel_cb(void *context) 27 | { 28 | struct netvsc_channel *nvchan = context; 29 | + struct vmbus_channel *channel = nvchan->channel; 30 | + struct hv_ring_buffer_info *rbi = &channel->inbound; 31 | + 32 | + /* preload first vmpacket descriptor */ 33 | + prefetch(hv_get_ring_buffer(rbi) + rbi->priv_read_index); 34 | 35 | if (napi_schedule_prep(&nvchan->napi)) { 36 | /* disable interupts from host */ 37 | - hv_begin_read(&nvchan->channel->inbound); 38 | + hv_begin_read(rbi); 39 | 40 | __napi_schedule(&nvchan->napi); 41 | } 42 | -------------------------------------------------------------------------------- /Patches_Following_Mainline_History/4.9.184/0097-hv_netvsc-fix-error-unwind-handling-if-vmbus_open-fa.patch: -------------------------------------------------------------------------------- 1 | From 729f62d353f39bdbb50862825d6b152ccd3fd1ff Mon Sep 17 00:00:00 2001 2 | From: Stephen Hemminger 3 | Date: Fri, 2 Mar 2018 13:49:03 -0800 4 | Subject: hv_netvsc: fix error unwind handling if vmbus_open fails 5 | Reply-To: joseph.salisbury@microsoft.com 6 | 7 | Need to delete NAPI association if vmbus_open fails. 8 | 9 | Signed-off-by: Stephen Hemminger 10 | Signed-off-by: David S. Miller 11 | (cherry picked from commit fcfb4a00d1e514e8313277a01ef919de1113025b) 12 | Signed-off-by: Joseph Salisbury 13 | --- 14 | drivers/net/hyperv/netvsc.c | 2 +- 15 | 1 file changed, 1 insertion(+), 1 deletion(-) 16 | 17 | diff --git a/drivers/net/hyperv/netvsc.c b/drivers/net/hyperv/netvsc.c 18 | index 3fd2a8018f31..e9a32b29f040 100644 19 | --- a/drivers/net/hyperv/netvsc.c 20 | +++ b/drivers/net/hyperv/netvsc.c 21 | @@ -1286,7 +1286,6 @@ struct netvsc_device *netvsc_device_add(struct hv_device *device, 22 | net_device->chan_table); 23 | 24 | if (ret != 0) { 25 | - netif_napi_del(&net_device->chan_table[0].napi); 26 | netdev_err(ndev, "unable to open channel: %d\n", ret); 27 | goto cleanup; 28 | } 29 | @@ -1319,6 +1318,7 @@ struct netvsc_device *netvsc_device_add(struct hv_device *device, 30 | vmbus_close(device->channel); 31 | 32 | cleanup: 33 | + netif_napi_del(&net_device->chan_table[0].napi); 34 | free_netvsc_device(&net_device->rcu); 35 | 36 | return ERR_PTR(ret); 37 | -- 38 | 2.17.1 39 | 40 | -------------------------------------------------------------------------------- /Patches_Following_Mainline_History/4.4.211/0675-Drivers-hv-util-Use-hv_get_current_tick-to-get-curre.patch: -------------------------------------------------------------------------------- 1 | From 98931834d182fe101fbc168fca451163fcdeb9a9 Mon Sep 17 00:00:00 2001 2 | From: "K. Y. Srinivasan" 3 | Date: Thu, 19 Jan 2017 11:51:52 -0700 4 | Subject: Drivers: hv: util: Use hv_get_current_tick() to get current tick 5 | Reply-To: joseph.salisbury@microsoft.com 6 | 7 | As part of the effort to interact with Hyper-V in an instruction set 8 | architecture independent way, use the new API to get the current 9 | tick. 10 | 11 | Signed-off-by: K. Y. Srinivasan 12 | Signed-off-by: Greg Kroah-Hartman 13 | (cherry picked from commit 305f7549c9298247723c255baddb7a54b4e63050) 14 | Signed-off-by: Joseph Salisbury 15 | --- 16 | drivers/hv/hv_util.c | 3 ++- 17 | 1 file changed, 2 insertions(+), 1 deletion(-) 18 | 19 | diff --git a/drivers/hv/hv_util.c b/drivers/hv/hv_util.c 20 | index bcd06306f3e8..07a783b52784 100644 21 | --- a/drivers/hv/hv_util.c 22 | +++ b/drivers/hv/hv_util.c 23 | @@ -27,6 +27,7 @@ 24 | #include 25 | #include 26 | #include 27 | +#include 28 | 29 | #include "hyperv_vmbus.h" 30 | 31 | @@ -199,7 +200,7 @@ static void hv_set_host_time(struct work_struct *work) 32 | */ 33 | u64 current_tick; 34 | 35 | - rdmsrl(HV_X64_MSR_TIME_REF_COUNT, current_tick); 36 | + hv_get_current_tick(current_tick); 37 | newtime += (current_tick - wrk->ref_time); 38 | } 39 | host_tns = (newtime - WLTIMEDELTA) * 100; 40 | -- 41 | 2.17.1 42 | 43 | -------------------------------------------------------------------------------- /Patches_Following_Mainline_History/4.9.184/0025-Drivers-hv-util-Use-hv_get_current_tick-to-get-curre.patch: -------------------------------------------------------------------------------- 1 | From 217f4306321bb992b94e8a5e192c1355aa2493e6 Mon Sep 17 00:00:00 2001 2 | From: "K. Y. Srinivasan" 3 | Date: Thu, 19 Jan 2017 11:51:52 -0700 4 | Subject: Drivers: hv: util: Use hv_get_current_tick() to get current tick 5 | Reply-To: joseph.salisbury@microsoft.com 6 | 7 | As part of the effort to interact with Hyper-V in an instruction set 8 | architecture independent way, use the new API to get the current 9 | tick. 10 | 11 | Signed-off-by: K. Y. Srinivasan 12 | Signed-off-by: Greg Kroah-Hartman 13 | (cherry picked from commit 305f7549c9298247723c255baddb7a54b4e63050) 14 | Signed-off-by: Joseph Salisbury 15 | --- 16 | drivers/hv/hv_util.c | 3 ++- 17 | 1 file changed, 2 insertions(+), 1 deletion(-) 18 | 19 | diff --git a/drivers/hv/hv_util.c b/drivers/hv/hv_util.c 20 | index bcd06306f3e8..07a783b52784 100644 21 | --- a/drivers/hv/hv_util.c 22 | +++ b/drivers/hv/hv_util.c 23 | @@ -27,6 +27,7 @@ 24 | #include 25 | #include 26 | #include 27 | +#include 28 | 29 | #include "hyperv_vmbus.h" 30 | 31 | @@ -199,7 +200,7 @@ static void hv_set_host_time(struct work_struct *work) 32 | */ 33 | u64 current_tick; 34 | 35 | - rdmsrl(HV_X64_MSR_TIME_REF_COUNT, current_tick); 36 | + hv_get_current_tick(current_tick); 37 | newtime += (current_tick - wrk->ref_time); 38 | } 39 | host_tns = (newtime - WLTIMEDELTA) * 100; 40 | -- 41 | 2.17.1 42 | 43 | -------------------------------------------------------------------------------- /Legacy/4.14/trace-vmbus_ongpadl_torndown.patch: -------------------------------------------------------------------------------- 1 | From a00bc680cbdbe99d8e0a9501c03eefa79c9703d1 Mon Sep 17 00:00:00 2001 2 | From: Vitaly Kuznetsov 3 | Date: Thu, 5 Oct 2017 16:50:34 +0200 4 | Subject: [PATCH 14/71] hyper-v: trace vmbus_ongpadl_torndown() 5 | 6 | Add tracepoint to CHANNELMSG_GPADL_TORNDOWN handler. 7 | 8 | Signed-off-by: Vitaly Kuznetsov 9 | --- 10 | drivers/hv/channel_mgmt.c | 2 ++ 11 | drivers/hv/hv_trace.h | 8 ++++++++ 12 | 2 files changed, 10 insertions(+) 13 | 14 | --- a/drivers/hv/channel_mgmt.c 2018-01-19 15:22:02.941818632 -0800 15 | +++ b/drivers/hv/channel_mgmt.c 2018-01-19 15:22:02.937818685 -0800 16 | @@ -1083,6 +1083,8 @@ static void vmbus_ongpadl_torndown( 17 | 18 | gpadl_torndown = (struct vmbus_channel_gpadl_torndown *)hdr; 19 | 20 | + trace_vmbus_ongpadl_torndown(gpadl_torndown); 21 | + 22 | /* 23 | * Find the open msg, copy the result and signal/unblock the wait event 24 | */ 25 | --- a/drivers/hv/hv_trace.h 2018-01-19 15:22:02.941818632 -0800 26 | +++ b/drivers/hv/hv_trace.h 2018-01-19 15:22:02.937818685 -0800 27 | @@ -103,6 +103,14 @@ TRACE_EVENT(vmbus_ongpadl_created, 28 | ) 29 | ); 30 | 31 | +TRACE_EVENT(vmbus_ongpadl_torndown, 32 | + TP_PROTO(const struct vmbus_channel_gpadl_torndown *gpadltorndown), 33 | + TP_ARGS(gpadltorndown), 34 | + TP_STRUCT__entry(__field(u32, gpadl)), 35 | + TP_fast_assign(__entry->gpadl = gpadltorndown->gpadl), 36 | + TP_printk("gpadl 0x%x", __entry->gpadl) 37 | + ); 38 | + 39 | #undef TRACE_INCLUDE_PATH 40 | #define TRACE_INCLUDE_PATH . 41 | #undef TRACE_INCLUDE_FILE 42 | -------------------------------------------------------------------------------- /Patches_Following_Mainline_History/4.4.211/0322-IB-mlx5-Eliminate-GSI-RX-QP-s-send-buffers.patch: -------------------------------------------------------------------------------- 1 | From b49ed586fffdd4d36ce680a8ee113b9071a23411 Mon Sep 17 00:00:00 2001 2 | From: Haggai Eran 3 | Date: Mon, 29 Feb 2016 15:45:11 +0200 4 | Subject: IB/mlx5: Eliminate GSI RX QP's send buffers 5 | Reply-To: joseph.salisbury@microsoft.com 6 | 7 | Now that the transmission of GSI MADs is done with the special transmission 8 | QPs, eliminate the send buffers in the GSI receive QP. 9 | 10 | Reviewed-by: Leon Romanovsky 11 | Signed-off-by: Haggai Eran 12 | Signed-off-by: Doug Ledford 13 | (cherry picked from commit ebe6ccc53ff06a3782b95547eecb393222de057f) 14 | Signed-off-by: Joseph Salisbury 15 | --- 16 | drivers/infiniband/hw/mlx5/gsi.c | 5 +++++ 17 | 1 file changed, 5 insertions(+) 18 | 19 | diff --git a/drivers/infiniband/hw/mlx5/gsi.c b/drivers/infiniband/hw/mlx5/gsi.c 20 | index 938f6ddca4b3..53e03c8ede79 100644 21 | --- a/drivers/infiniband/hw/mlx5/gsi.c 22 | +++ b/drivers/infiniband/hw/mlx5/gsi.c 23 | @@ -187,6 +187,11 @@ struct ib_qp *mlx5_ib_gsi_create_qp(struct ib_pd *pd, 24 | 25 | hw_init_attr.qp_type = MLX5_IB_QPT_HW_GSI; 26 | hw_init_attr.send_cq = gsi->cq; 27 | + if (num_qps) { 28 | + hw_init_attr.cap.max_send_wr = 0; 29 | + hw_init_attr.cap.max_send_sge = 0; 30 | + hw_init_attr.cap.max_inline_data = 0; 31 | + } 32 | gsi->rx_qp = ib_create_qp(pd, &hw_init_attr); 33 | if (IS_ERR(gsi->rx_qp)) { 34 | mlx5_ib_warn(dev, "unable to create hardware GSI QP. error %ld\n", 35 | -- 36 | 2.17.1 37 | 38 | -------------------------------------------------------------------------------- /Legacy/4.13/hyper-v-trace-vmbus_ongpadl_torndown.patch: -------------------------------------------------------------------------------- 1 | From 536d2fde99ce512c8ead697f30ec93ee3f3a8ddd Mon Sep 17 00:00:00 2001 2 | From: Vitaly Kuznetsov 3 | Date: Thu, 5 Oct 2017 16:50:34 +0200 4 | Subject: [PATCH 112/156] hyper-v: trace vmbus_ongpadl_torndown() 5 | 6 | Add tracepoint to CHANNELMSG_GPADL_TORNDOWN handler. 7 | 8 | Signed-off-by: Vitaly Kuznetsov 9 | --- 10 | drivers/hv/channel_mgmt.c | 2 ++ 11 | drivers/hv/hv_trace.h | 8 ++++++++ 12 | 2 files changed, 10 insertions(+) 13 | 14 | --- a/drivers/hv/channel_mgmt.c 2017-12-05 16:55:48.274650244 -0800 15 | +++ b/drivers/hv/channel_mgmt.c 2017-12-05 16:55:48.270650296 -0800 16 | @@ -1079,6 +1079,8 @@ static void vmbus_ongpadl_torndown( 17 | 18 | gpadl_torndown = (struct vmbus_channel_gpadl_torndown *)hdr; 19 | 20 | + trace_vmbus_ongpadl_torndown(gpadl_torndown); 21 | + 22 | /* 23 | * Find the open msg, copy the result and signal/unblock the wait event 24 | */ 25 | --- a/drivers/hv/hv_trace.h 2017-12-05 16:55:48.274650244 -0800 26 | +++ b/drivers/hv/hv_trace.h 2017-12-05 16:55:48.270650296 -0800 27 | @@ -103,6 +103,14 @@ TRACE_EVENT(vmbus_ongpadl_created, 28 | ) 29 | ); 30 | 31 | +TRACE_EVENT(vmbus_ongpadl_torndown, 32 | + TP_PROTO(const struct vmbus_channel_gpadl_torndown *gpadltorndown), 33 | + TP_ARGS(gpadltorndown), 34 | + TP_STRUCT__entry(__field(u32, gpadl)), 35 | + TP_fast_assign(__entry->gpadl = gpadltorndown->gpadl), 36 | + TP_printk("gpadl 0x%x", __entry->gpadl) 37 | + ); 38 | + 39 | #undef TRACE_INCLUDE_PATH 40 | #define TRACE_INCLUDE_PATH . 41 | #undef TRACE_INCLUDE_FILE 42 | -------------------------------------------------------------------------------- /Legacy/4.14/hv_netvsc-Update-netvsc-Document-for-TCP-hash-level-.patch: -------------------------------------------------------------------------------- 1 | From 28ffdb87d60a8ba3c9b4cf6c4dfb2bb948d1eff3 Mon Sep 17 00:00:00 2001 2 | From: Haiyang Zhang 3 | Date: Fri, 6 Oct 2017 08:33:59 -0700 4 | Subject: [PATCH 30/71] hv_netvsc: Update netvsc Document for TCP hash level 5 | setting 6 | 7 | Update Documentation/networking/netvsc.txt for TCP hash level setting 8 | and related info. 9 | 10 | Signed-off-by: Haiyang Zhang 11 | Signed-off-by: David S. Miller 12 | --- 13 | Documentation/networking/netvsc.txt | 8 ++++---- 14 | 1 file changed, 4 insertions(+), 4 deletions(-) 15 | 16 | --- a/Documentation/networking/netvsc.txt 2018-01-19 15:22:29.889458524 -0800 17 | +++ b/Documentation/networking/netvsc.txt 2018-01-19 15:22:29.885458578 -0800 18 | @@ -19,12 +19,12 @@ Features 19 | 20 | Receive Side Scaling 21 | -------------------- 22 | - Hyper-V supports receive side scaling. For TCP, packets are 23 | - distributed among available queues based on IP address and port 24 | + Hyper-V supports receive side scaling. For TCP & UDP, packets can 25 | + be distributed among available queues based on IP address and port 26 | number. 27 | 28 | - For UDP, we can switch UDP hash level between L3 and L4 by ethtool 29 | - command. UDP over IPv4 and v6 can be set differently. The default 30 | + For TCP & UDP, we can switch hash level between L3 and L4 by ethtool 31 | + command. TCP/UDP over IPv4 and v6 can be set differently. The default 32 | hash level is L4. We currently only allow switching TX hash level 33 | from within the guests. 34 | 35 | -------------------------------------------------------------------------------- /Legacy/4.15/0002-hv_netvsc-don-t-need-local-xmit_more.patch: -------------------------------------------------------------------------------- 1 | From d6d7b077a00a95cd362ed90deb5a1fb5f1088612 Mon Sep 17 00:00:00 2001 2 | From: Stephen Hemminger 3 | Date: Fri, 1 Dec 2017 11:01:45 -0800 4 | Subject: [PATCH 02/55] hv_netvsc: don't need local xmit_more 5 | 6 | Since skb is always non-NULL in the copy portion of netvsc_send 7 | do not need local variable. 8 | 9 | Signed-off-by: Stephen Hemminger 10 | Signed-off-by: David S. Miller 11 | Signed-off-by: Sasha Levin 12 | --- 13 | drivers/net/hyperv/netvsc.c | 3 +-- 14 | 1 file changed, 1 insertion(+), 2 deletions(-) 15 | 16 | diff --git a/drivers/net/hyperv/netvsc.c b/drivers/net/hyperv/netvsc.c 17 | index bfc79698b8f4..ee31faa67cad 100644 18 | --- a/drivers/net/hyperv/netvsc.c 19 | +++ b/drivers/net/hyperv/netvsc.c 20 | @@ -848,7 +848,6 @@ int netvsc_send(struct net_device_context *ndev_ctx, 21 | struct hv_netvsc_packet *msd_send = NULL, *cur_send = NULL; 22 | struct sk_buff *msd_skb = NULL; 23 | bool try_batch; 24 | - bool xmit_more = (skb != NULL) ? skb->xmit_more : false; 25 | 26 | /* If device is rescinded, return error and packet will get dropped. */ 27 | if (unlikely(!net_device || net_device->destroy)) 28 | @@ -922,7 +921,7 @@ int netvsc_send(struct net_device_context *ndev_ctx, 29 | if (msdp->skb) 30 | dev_consume_skb_any(msdp->skb); 31 | 32 | - if (xmit_more && !packet->cp_partial) { 33 | + if (skb->xmit_more && !packet->cp_partial) { 34 | msdp->skb = skb; 35 | msdp->pkt = packet; 36 | msdp->count++; 37 | -- 38 | 2.14.1 39 | 40 | -------------------------------------------------------------------------------- /Patches_Following_Mainline_History/4.4.211/0806-vmbus-unregister-device_obj-channels_kset.patch: -------------------------------------------------------------------------------- 1 | From 5260c09bce7b8e7c2eabfbb9e6f69ef045edb10e Mon Sep 17 00:00:00 2001 2 | From: Dexuan Cui 3 | Date: Tue, 14 Nov 2017 06:53:32 -0700 4 | Subject: vmbus: unregister device_obj->channels_kset 5 | Reply-To: joseph.salisbury@microsoft.com 6 | 7 | Without the patch, a device can't be thoroughly destroyed, because 8 | vmbus_device_register() -> kset_create_and_add() still holds a reference 9 | to the hv_device's device.kobj. 10 | 11 | Signed-off-by: Dexuan Cui 12 | Cc: Stephen Hemminger 13 | Fixes: c2e5df616e1a ("vmbus: add per-channel sysfs info") 14 | Signed-off-by: K. Y. Srinivasan 15 | Signed-off-by: Greg Kroah-Hartman 16 | (cherry picked from commit 869b5567e12f63ea7407f81728ca87f8c0abbfdb) 17 | Signed-off-by: Joseph Salisbury 18 | --- 19 | drivers/hv/vmbus_drv.c | 2 ++ 20 | 1 file changed, 2 insertions(+) 21 | 22 | diff --git a/drivers/hv/vmbus_drv.c b/drivers/hv/vmbus_drv.c 23 | index bc7b49d27101..7c52d40820a3 100644 24 | --- a/drivers/hv/vmbus_drv.c 25 | +++ b/drivers/hv/vmbus_drv.c 26 | @@ -1270,6 +1270,8 @@ void vmbus_device_unregister(struct hv_device *device_obj) 27 | pr_debug("child device %s unregistered\n", 28 | dev_name(&device_obj->device)); 29 | 30 | + kset_unregister(device_obj->channels_kset); 31 | + 32 | /* 33 | * Kick off the process of unregistering the device. 34 | * This will call vmbus_remove() and eventually vmbus_device_release() 35 | -- 36 | 2.17.1 37 | 38 | -------------------------------------------------------------------------------- /Patches_Following_Mainline_History/4.9.184/0094-vmbus-unregister-device_obj-channels_kset.patch: -------------------------------------------------------------------------------- 1 | From 77b7ca2a3f8bd54f91e2b74b38a04dff8bce8cf7 Mon Sep 17 00:00:00 2001 2 | From: Dexuan Cui 3 | Date: Tue, 14 Nov 2017 06:53:32 -0700 4 | Subject: vmbus: unregister device_obj->channels_kset 5 | Reply-To: joseph.salisbury@microsoft.com 6 | 7 | Without the patch, a device can't be thoroughly destroyed, because 8 | vmbus_device_register() -> kset_create_and_add() still holds a reference 9 | to the hv_device's device.kobj. 10 | 11 | Signed-off-by: Dexuan Cui 12 | Cc: Stephen Hemminger 13 | Fixes: c2e5df616e1a ("vmbus: add per-channel sysfs info") 14 | Signed-off-by: K. Y. Srinivasan 15 | Signed-off-by: Greg Kroah-Hartman 16 | (cherry picked from commit 869b5567e12f63ea7407f81728ca87f8c0abbfdb) 17 | Signed-off-by: Joseph Salisbury 18 | --- 19 | drivers/hv/vmbus_drv.c | 2 ++ 20 | 1 file changed, 2 insertions(+) 21 | 22 | diff --git a/drivers/hv/vmbus_drv.c b/drivers/hv/vmbus_drv.c 23 | index 38d9c47b3f15..cdb1cc38c042 100644 24 | --- a/drivers/hv/vmbus_drv.c 25 | +++ b/drivers/hv/vmbus_drv.c 26 | @@ -1242,6 +1242,8 @@ void vmbus_device_unregister(struct hv_device *device_obj) 27 | pr_debug("child device %s unregistered\n", 28 | dev_name(&device_obj->device)); 29 | 30 | + kset_unregister(device_obj->channels_kset); 31 | + 32 | /* 33 | * Kick off the process of unregistering the device. 34 | * This will call vmbus_remove() and eventually vmbus_device_release() 35 | -- 36 | 2.17.1 37 | 38 | -------------------------------------------------------------------------------- /Legacy/4.13/hyper-v-trace-vmbus_onoffer_rescind.patch: -------------------------------------------------------------------------------- 1 | From 732583b314c0282f78f6503266f450f2c5f709d5 Mon Sep 17 00:00:00 2001 2 | From: Vitaly Kuznetsov 3 | Date: Thu, 5 Oct 2017 16:50:31 +0200 4 | Subject: [PATCH 109/156] hyper-v: trace vmbus_onoffer_rescind() 5 | 6 | Add tracepoint to CHANNELMSG_RESCIND_CHANNELOFFER handler. 7 | 8 | Signed-off-by: Vitaly Kuznetsov 9 | --- 10 | drivers/hv/channel_mgmt.c | 2 ++ 11 | drivers/hv/hv_trace.h | 8 ++++++++ 12 | 2 files changed, 10 insertions(+) 13 | 14 | --- a/drivers/hv/channel_mgmt.c 2017-12-05 16:55:47.678657894 -0800 15 | +++ b/drivers/hv/channel_mgmt.c 2017-12-05 16:55:47.674657945 -0800 16 | @@ -856,6 +856,8 @@ static void vmbus_onoffer_rescind(struct 17 | 18 | rescind = (struct vmbus_channel_rescind_offer *)hdr; 19 | 20 | + trace_vmbus_onoffer_rescind(rescind); 21 | + 22 | /* 23 | * The offer msg and the corresponding rescind msg 24 | * from the host are guranteed to be ordered - 25 | --- a/drivers/hv/hv_trace.h 2017-12-05 16:55:47.678657894 -0800 26 | +++ b/drivers/hv/hv_trace.h 2017-12-05 16:55:47.674657945 -0800 27 | @@ -61,6 +61,14 @@ TRACE_EVENT(vmbus_onoffer, 28 | ) 29 | ); 30 | 31 | +TRACE_EVENT(vmbus_onoffer_rescind, 32 | + TP_PROTO(const struct vmbus_channel_rescind_offer *offer), 33 | + TP_ARGS(offer), 34 | + TP_STRUCT__entry(__field(u32, child_relid)), 35 | + TP_fast_assign(__entry->child_relid = offer->child_relid), 36 | + TP_printk("child_relid 0x%x", __entry->child_relid) 37 | + ); 38 | + 39 | #undef TRACE_INCLUDE_PATH 40 | #define TRACE_INCLUDE_PATH . 41 | #undef TRACE_INCLUDE_FILE 42 | -------------------------------------------------------------------------------- /Legacy/4.14/trace-vmbus_onoffer_rescind.patch: -------------------------------------------------------------------------------- 1 | From 860d6eadd907b6c4b111d35992d18a5d84cab681 Mon Sep 17 00:00:00 2001 2 | From: Vitaly Kuznetsov 3 | Date: Thu, 5 Oct 2017 16:50:31 +0200 4 | Subject: [PATCH 11/71] hyper-v: trace vmbus_onoffer_rescind() 5 | 6 | Add tracepoint to CHANNELMSG_RESCIND_CHANNELOFFER handler. 7 | 8 | Signed-off-by: Vitaly Kuznetsov 9 | --- 10 | drivers/hv/channel_mgmt.c | 2 ++ 11 | drivers/hv/hv_trace.h | 8 ++++++++ 12 | 2 files changed, 10 insertions(+) 13 | 14 | --- a/drivers/hv/channel_mgmt.c 2018-01-19 15:21:53.197948870 -0800 15 | +++ b/drivers/hv/channel_mgmt.c 2018-01-19 15:21:53.193948925 -0800 16 | @@ -857,6 +857,8 @@ static void vmbus_onoffer_rescind(struct 17 | 18 | rescind = (struct vmbus_channel_rescind_offer *)hdr; 19 | 20 | + trace_vmbus_onoffer_rescind(rescind); 21 | + 22 | /* 23 | * The offer msg and the corresponding rescind msg 24 | * from the host are guranteed to be ordered - 25 | --- a/drivers/hv/hv_trace.h 2018-01-19 15:21:53.197948870 -0800 26 | +++ b/drivers/hv/hv_trace.h 2018-01-19 15:21:53.193948925 -0800 27 | @@ -61,6 +61,14 @@ TRACE_EVENT(vmbus_onoffer, 28 | ) 29 | ); 30 | 31 | +TRACE_EVENT(vmbus_onoffer_rescind, 32 | + TP_PROTO(const struct vmbus_channel_rescind_offer *offer), 33 | + TP_ARGS(offer), 34 | + TP_STRUCT__entry(__field(u32, child_relid)), 35 | + TP_fast_assign(__entry->child_relid = offer->child_relid), 36 | + TP_printk("child_relid 0x%x", __entry->child_relid) 37 | + ); 38 | + 39 | #undef TRACE_INCLUDE_PATH 40 | #define TRACE_INCLUDE_PATH . 41 | #undef TRACE_INCLUDE_FILE 42 | -------------------------------------------------------------------------------- /Patches_Following_Mainline_History/4.14.141/0007-vmbus-unregister-device_obj-channels_kset.patch: -------------------------------------------------------------------------------- 1 | From 77b6efcddaa0793a6e7b579ae4ddb32b1d18c0d4 Mon Sep 17 00:00:00 2001 2 | From: Dexuan Cui 3 | Date: Tue, 14 Nov 2017 06:53:32 -0700 4 | Subject: vmbus: unregister device_obj->channels_kset 5 | Reply-To: joseph.salisbury@microsoft.com 6 | 7 | Without the patch, a device can't be thoroughly destroyed, because 8 | vmbus_device_register() -> kset_create_and_add() still holds a reference 9 | to the hv_device's device.kobj. 10 | 11 | Signed-off-by: Dexuan Cui 12 | Cc: Stephen Hemminger 13 | Fixes: c2e5df616e1a ("vmbus: add per-channel sysfs info") 14 | Signed-off-by: K. Y. Srinivasan 15 | Signed-off-by: Greg Kroah-Hartman 16 | (cherry picked from commit 869b5567e12f63ea7407f81728ca87f8c0abbfdb) 17 | Signed-off-by: Joseph Salisbury 18 | --- 19 | drivers/hv/vmbus_drv.c | 2 ++ 20 | 1 file changed, 2 insertions(+) 21 | 22 | diff --git a/drivers/hv/vmbus_drv.c b/drivers/hv/vmbus_drv.c 23 | index 4cbe48750100..63b714680c80 100644 24 | --- a/drivers/hv/vmbus_drv.c 25 | +++ b/drivers/hv/vmbus_drv.c 26 | @@ -1425,6 +1425,8 @@ void vmbus_device_unregister(struct hv_device *device_obj) 27 | pr_debug("child device %s unregistered\n", 28 | dev_name(&device_obj->device)); 29 | 30 | + kset_unregister(device_obj->channels_kset); 31 | + 32 | /* 33 | * Kick off the process of unregistering the device. 34 | * This will call vmbus_remove() and eventually vmbus_device_release() 35 | -- 36 | 2.17.1 37 | 38 | -------------------------------------------------------------------------------- /Patches_Following_Mainline_History/4.4.211/0461-net-mlx5e-Check-for-BlueFlame-capability-before-allo.patch: -------------------------------------------------------------------------------- 1 | From 03e359b0c8f0d1407b305b51ddaf4465dc8379fe Mon Sep 17 00:00:00 2001 2 | From: Gal Pressman 3 | Date: Mon, 27 Jun 2016 12:08:35 +0300 4 | Subject: net/mlx5e: Check for BlueFlame capability before allocating SQ uar 5 | Reply-To: joseph.salisbury@microsoft.com 6 | 7 | Previous to this patch mapping was always set to write combining without 8 | checking whether BlueFlame is supported in the device. 9 | 10 | Fixes: 0ba422410bbf ('net/mlx5: Fix global UAR mapping') 11 | Signed-off-by: Gal Pressman 12 | Signed-off-by: Saeed Mahameed 13 | Signed-off-by: David S. Miller 14 | (cherry picked from commit fd4782c21359cfd52af4c3180a2bb6bad55c1eba) 15 | Signed-off-by: Joseph Salisbury 16 | --- 17 | drivers/net/ethernet/mellanox/mlx5/core/en_main.c | 2 +- 18 | 1 file changed, 1 insertion(+), 1 deletion(-) 19 | 20 | diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en_main.c b/drivers/net/ethernet/mellanox/mlx5/core/en_main.c 21 | index 3956b1bea338..72df408fae0d 100644 22 | --- a/drivers/net/ethernet/mellanox/mlx5/core/en_main.c 23 | +++ b/drivers/net/ethernet/mellanox/mlx5/core/en_main.c 24 | @@ -585,7 +585,7 @@ static int mlx5e_create_sq(struct mlx5e_channel *c, 25 | void *sqc_wq = MLX5_ADDR_OF(sqc, sqc, wq); 26 | int err; 27 | 28 | - err = mlx5_alloc_map_uar(mdev, &sq->uar, true); 29 | + err = mlx5_alloc_map_uar(mdev, &sq->uar, !!MLX5_CAP_GEN(mdev, bf)); 30 | if (err) 31 | return err; 32 | 33 | -- 34 | 2.17.1 35 | 36 | -------------------------------------------------------------------------------- /Legacy/4.15/0055-init-don-t-wait-for-PS-2-at-boot.patch: -------------------------------------------------------------------------------- 1 | From e477a5dda3e9ab271a4a4f87090ce287b41df6f1 Mon Sep 17 00:00:00 2001 2 | From: Arjan van de Ven 3 | Date: Mon, 13 Apr 2015 10:59:58 -0500 4 | Subject: [PATCH 55/55] init: don't wait for PS/2 at boot 5 | 6 | Skip "wait for the known devices to complete their probing" 7 | otherwise you wait like 10 seconds for a non-existent ps/2 8 | controller 9 | 10 | One needs to wait twice because the async disk probe will schedule 11 | an async partition scan and we need for both to finish. 12 | 13 | Author: Arjan van de Ven 14 | 15 | Signed-off-by: Miguel Bernal Marin 16 | Signed-off-by: Sasha Levin 17 | --- 18 | init/do_mounts.c | 6 +++++- 19 | 1 file changed, 5 insertions(+), 1 deletion(-) 20 | 21 | diff --git a/init/do_mounts.c b/init/do_mounts.c 22 | index 7cf4f6dafd5f..c851a9e35258 100644 23 | --- a/init/do_mounts.c 24 | +++ b/init/do_mounts.c 25 | @@ -28,6 +28,7 @@ 26 | #include 27 | #include 28 | #include 29 | +#include 30 | 31 | #include 32 | #include 33 | @@ -562,7 +563,10 @@ void __init prepare_namespace(void) 34 | * For example, it is not atypical to wait 5 seconds here 35 | * for the touchpad of a laptop to initialize. 36 | */ 37 | - wait_for_device_probe(); 38 | + //wait_for_device_probe(); 39 | + async_synchronize_full(); 40 | + async_synchronize_full(); 41 | + async_synchronize_full(); 42 | 43 | md_run_setup(); 44 | 45 | -- 46 | 2.14.1 47 | 48 | -------------------------------------------------------------------------------- /Legacy/4.13/hv_netvsc-Fix-rndis_filter_close-error-during-netvsc.patch: -------------------------------------------------------------------------------- 1 | From c95facc6f8b13c1c0c5537f2024aaeb738000bf5 Mon Sep 17 00:00:00 2001 2 | From: Haiyang Zhang 3 | Date: Thu, 24 Aug 2017 11:50:02 -0700 4 | Subject: [PATCH 86/98] hv_netvsc: Fix rndis_filter_close error during 5 | netvsc_remove 6 | 7 | We now remove rndis filter before unregister_netdev(), which calls 8 | device close. It involves closing rndis filter already removed. 9 | 10 | This patch fixes this error. 11 | 12 | Signed-off-by: Haiyang Zhang 13 | --- 14 | drivers/net/hyperv/netvsc_drv.c | 7 ++++++- 15 | 1 file changed, 6 insertions(+), 1 deletion(-) 16 | 17 | --- a/drivers/net/hyperv/netvsc_drv.c 2017-12-05 16:23:37.227668039 -0800 18 | +++ b/drivers/net/hyperv/netvsc_drv.c 2017-12-05 16:23:37.227668039 -0800 19 | @@ -119,12 +119,16 @@ static int netvsc_close(struct net_devic 20 | struct net_device *vf_netdev 21 | = rtnl_dereference(net_device_ctx->vf_netdev); 22 | struct netvsc_device *nvdev = rtnl_dereference(net_device_ctx->nvdev); 23 | - int ret; 24 | + int ret = 0; 25 | u32 aread, i, msec = 10, retry = 0, retry_max = 20; 26 | struct vmbus_channel *chn; 27 | 28 | netif_tx_disable(net); 29 | 30 | + /* No need to close rndis filter if it is removed already */ 31 | + if (!nvdev) 32 | + goto out; 33 | + 34 | ret = rndis_filter_close(nvdev); 35 | if (ret != 0) { 36 | netdev_err(net, "unable to close device (ret %d).\n", ret); 37 | @@ -163,6 +167,7 @@ static int netvsc_close(struct net_devic 38 | ret = -ETIMEDOUT; 39 | } 40 | 41 | +out: 42 | if (vf_netdev) 43 | dev_close(vf_netdev); 44 | 45 | -------------------------------------------------------------------------------- /Patches_Following_Mainline_History/4.4.211/0354-net-mlx5e-Relax-ndo_setup_tc-handle-restriction.patch: -------------------------------------------------------------------------------- 1 | From 1e8e3f1ab666f4012f184e465f5b14a22af8ee87 Mon Sep 17 00:00:00 2001 2 | From: Amir Vadai 3 | Date: Tue, 8 Mar 2016 12:42:34 +0200 4 | Subject: net/mlx5e: Relax ndo_setup_tc handle restriction 5 | Reply-To: joseph.salisbury@microsoft.com 6 | 7 | Restricting handle to TC_H_ROOT breaks the old instantiation of mqprio 8 | to setup a hardware qdisc. This patch relaxes the test, to only check the 9 | type. 10 | 11 | Fixes: 08fb1da ("net/mlx5e: Support DCBNL IEEE ETS") 12 | Signed-off-by: Amir Vadai 13 | Signed-off-by: David S. Miller 14 | (cherry picked from commit 67ba422e95edfbd42f1d9782868880b364eea173) 15 | Signed-off-by: Joseph Salisbury 16 | --- 17 | drivers/net/ethernet/mellanox/mlx5/core/en_main.c | 2 +- 18 | 1 file changed, 1 insertion(+), 1 deletion(-) 19 | 20 | diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en_main.c b/drivers/net/ethernet/mellanox/mlx5/core/en_main.c 21 | index 498f8eec9924..045ab94db3c2 100644 22 | --- a/drivers/net/ethernet/mellanox/mlx5/core/en_main.c 23 | +++ b/drivers/net/ethernet/mellanox/mlx5/core/en_main.c 24 | @@ -1887,7 +1887,7 @@ static int mlx5e_setup_tc(struct net_device *netdev, u8 tc) 25 | static int mlx5e_ndo_setup_tc(struct net_device *dev, u32 handle, 26 | __be16 proto, struct tc_to_netdev *tc) 27 | { 28 | - if (handle != TC_H_ROOT || tc->type != TC_SETUP_MQPRIO) 29 | + if (tc->type != TC_SETUP_MQPRIO) 30 | return -EINVAL; 31 | 32 | return mlx5e_setup_tc(dev, tc->tc); 33 | -- 34 | 2.17.1 35 | 36 | -------------------------------------------------------------------------------- /Patches_Following_Mainline_History/4.4.211/0856-hv_netvsc-Sync-offloading-features-to-VF-NIC.patch: -------------------------------------------------------------------------------- 1 | From c896019466c9d0ea376c7714d07301597a36a5c7 Mon Sep 17 00:00:00 2001 2 | From: Haiyang Zhang 3 | Date: Thu, 5 Sep 2019 23:23:12 +0000 4 | Subject: hv_netvsc: Sync offloading features to VF NIC 5 | Reply-To: joseph.salisbury@microsoft.com 6 | 7 | VF NIC may go down then come up during host servicing events. This 8 | causes the VF NIC offloading feature settings to roll back to the 9 | defaults. This patch can synchronize features from synthetic NIC to 10 | the VF NIC during ndo_set_features (ethtool -K), 11 | and netvsc_register_vf when VF comes back after host events. 12 | 13 | Signed-off-by: Haiyang Zhang 14 | Cc: Mark Bloch 15 | Signed-off-by: David S. Miller 16 | (backported from commit 68622d071e555e1528f3e7807f30f73311c1acae) 17 | Signed-off-by: Joseph Salisbury 18 | --- 19 | drivers/net/hyperv/netvsc_drv.c | 4 ++++ 20 | 1 file changed, 4 insertions(+) 21 | 22 | diff --git a/drivers/net/hyperv/netvsc_drv.c b/drivers/net/hyperv/netvsc_drv.c 23 | index e70e28f3403f..b7b7273cf16f 100644 24 | --- a/drivers/net/hyperv/netvsc_drv.c 25 | +++ b/drivers/net/hyperv/netvsc_drv.c 26 | @@ -2010,6 +2010,10 @@ static int netvsc_register_vf(struct net_device *vf_netdev) 27 | 28 | dev_hold(vf_netdev); 29 | rcu_assign_pointer(net_device_ctx->vf_netdev, vf_netdev); 30 | + 31 | + vf_netdev->wanted_features = ndev->features; 32 | + netdev_update_features(vf_netdev); 33 | + 34 | return NOTIFY_OK; 35 | } 36 | 37 | -- 38 | 2.17.1 39 | 40 | -------------------------------------------------------------------------------- /Legacy/4.13/netvsc-remove-unnecessary-cast-of-void-pointer.patch: -------------------------------------------------------------------------------- 1 | From 5c09500a6aa8338c03f33acfb4ed9028f5f73ddb Mon Sep 17 00:00:00 2001 2 | From: Stephen Hemminger 3 | Date: Mon, 7 Aug 2017 15:12:48 -0700 4 | Subject: [PATCH 74/98] netvsc: remove unnecessary cast of void pointer 5 | 6 | Assignment to a typed pointer is sufficient in C. 7 | No cast is needed. 8 | 9 | Signed-off-by: Stephen Hemminger 10 | --- 11 | drivers/net/hyperv/netvsc_drv.c | 9 ++++----- 12 | 1 file changed, 4 insertions(+), 5 deletions(-) 13 | 14 | --- a/drivers/net/hyperv/netvsc_drv.c 2017-12-05 16:23:24.971823981 -0800 15 | +++ b/drivers/net/hyperv/netvsc_drv.c 2017-12-05 16:23:24.967824031 -0800 16 | @@ -527,9 +527,9 @@ static int netvsc_start_xmit(struct sk_b 17 | 18 | rndis_msg_size += NDIS_VLAN_PPI_SIZE; 19 | ppi = init_ppi_data(rndis_msg, NDIS_VLAN_PPI_SIZE, 20 | - IEEE_8021Q_INFO); 21 | - vlan = (struct ndis_pkt_8021q_info *)((void *)ppi + 22 | - ppi->ppi_offset); 23 | + IEEE_8021Q_INFO); 24 | + 25 | + vlan = (void *)ppi + ppi->ppi_offset; 26 | vlan->vlanid = skb->vlan_tci & VLAN_VID_MASK; 27 | vlan->pri = (skb->vlan_tci & VLAN_PRIO_MASK) >> 28 | VLAN_PRIO_SHIFT; 29 | @@ -542,8 +542,7 @@ static int netvsc_start_xmit(struct sk_b 30 | ppi = init_ppi_data(rndis_msg, NDIS_LSO_PPI_SIZE, 31 | TCP_LARGESEND_PKTINFO); 32 | 33 | - lso_info = (struct ndis_tcp_lso_info *)((void *)ppi + 34 | - ppi->ppi_offset); 35 | + lso_info = (void *)ppi + ppi->ppi_offset; 36 | 37 | lso_info->lso_v2_transmit.type = NDIS_TCP_LARGE_SEND_OFFLOAD_V2_TYPE; 38 | if (skb->protocol == htons(ETH_P_IP)) { 39 | -------------------------------------------------------------------------------- /Legacy/4.14/trace-vmbus_request_offers.patch: -------------------------------------------------------------------------------- 1 | From f696c137787cf53a63c8bde2bd6a483499ea4d28 Mon Sep 17 00:00:00 2001 2 | From: Vitaly Kuznetsov 3 | Date: Thu, 5 Oct 2017 16:50:36 +0200 4 | Subject: [PATCH 16/71] hyper-v: trace vmbus_request_offers() 5 | 6 | Add tracepoint to CHANNELMSG_REQUESTOFFERS sender. 7 | 8 | Signed-off-by: Vitaly Kuznetsov 9 | --- 10 | drivers/hv/channel_mgmt.c | 4 +++- 11 | drivers/hv/hv_trace.h | 8 ++++++++ 12 | 2 files changed, 11 insertions(+), 1 deletion(-) 13 | 14 | --- a/drivers/hv/channel_mgmt.c 2018-01-19 15:22:14.301666813 -0800 15 | +++ b/drivers/hv/channel_mgmt.c 2018-01-19 15:22:14.297666866 -0800 16 | @@ -1225,9 +1225,11 @@ int vmbus_request_offers(void) 17 | 18 | msg->msgtype = CHANNELMSG_REQUESTOFFERS; 19 | 20 | - 21 | ret = vmbus_post_msg(msg, sizeof(struct vmbus_channel_message_header), 22 | true); 23 | + 24 | + trace_vmbus_request_offers(ret); 25 | + 26 | if (ret != 0) { 27 | pr_err("Unable to request offers - %d\n", ret); 28 | 29 | --- a/drivers/hv/hv_trace.h 2018-01-19 15:22:14.301666813 -0800 30 | +++ b/drivers/hv/hv_trace.h 2018-01-19 15:22:14.297666866 -0800 31 | @@ -122,6 +122,14 @@ TRACE_EVENT(vmbus_onversion_response, 32 | TP_printk("version_supported %d", __entry->ver) 33 | ); 34 | 35 | +TRACE_EVENT(vmbus_request_offers, 36 | + TP_PROTO(int ret), 37 | + TP_ARGS(ret), 38 | + TP_STRUCT__entry(__field(int, ret)), 39 | + TP_fast_assign(__entry->ret = ret), 40 | + TP_printk("sending ret %d", __entry->ret) 41 | + ); 42 | + 43 | #undef TRACE_INCLUDE_PATH 44 | #define TRACE_INCLUDE_PATH . 45 | #undef TRACE_INCLUDE_FILE 46 | -------------------------------------------------------------------------------- /Patches_Following_Mainline_History/4.4.211/0092-mlxsw-core-remove-an-unnecessary-condition.patch: -------------------------------------------------------------------------------- 1 | From 2ef61b9e61dd8c97a4e39c39c365038a1d071489 Mon Sep 17 00:00:00 2001 2 | From: Dan Carpenter 3 | Date: Wed, 6 Jan 2016 12:56:30 +0300 4 | Subject: mlxsw: core: remove an unnecessary condition 5 | Reply-To: joseph.salisbury@microsoft.com 6 | 7 | We checked "err" on the lines before so we know it's zero here. 8 | 9 | These cause a static checker warning because checking known things can 10 | indicate a bug. Maybe there is a missing assignment or we are checking 11 | the wrong variable. 12 | 13 | Signed-off-by: Dan Carpenter 14 | Acked-by: Jiri Pirko 15 | Signed-off-by: David S. Miller 16 | (cherry picked from commit 719255d0e29463ddba2d01a72c1e74092793103a) 17 | Signed-off-by: Joseph Salisbury 18 | --- 19 | drivers/net/ethernet/mellanox/mlxsw/core_hwmon.c | 2 +- 20 | 1 file changed, 1 insertion(+), 1 deletion(-) 21 | 22 | diff --git a/drivers/net/ethernet/mellanox/mlxsw/core_hwmon.c b/drivers/net/ethernet/mellanox/mlxsw/core_hwmon.c 23 | index 5b9364f4837d..1ac8bf187168 100644 24 | --- a/drivers/net/ethernet/mellanox/mlxsw/core_hwmon.c 25 | +++ b/drivers/net/ethernet/mellanox/mlxsw/core_hwmon.c 26 | @@ -130,7 +130,7 @@ static ssize_t mlxsw_hwmon_temp_rst_store(struct device *dev, 27 | dev_err(mlxsw_hwmon->bus_info->dev, "Failed to reset temp sensor history\n"); 28 | return err; 29 | } 30 | - return err ? err : len; 31 | + return len; 32 | } 33 | 34 | static ssize_t mlxsw_hwmon_fan_rpm_show(struct device *dev, 35 | -- 36 | 2.17.1 37 | 38 | -------------------------------------------------------------------------------- /Legacy/4.13/hyper-v-trace-vmbus_request_offers.patch: -------------------------------------------------------------------------------- 1 | From 8e809cc53a65340f1365a688b12f572def240dec Mon Sep 17 00:00:00 2001 2 | From: Vitaly Kuznetsov 3 | Date: Thu, 5 Oct 2017 16:50:36 +0200 4 | Subject: [PATCH 114/156] hyper-v: trace vmbus_request_offers() 5 | 6 | Add tracepoint to CHANNELMSG_REQUESTOFFERS sender. 7 | 8 | Signed-off-by: Vitaly Kuznetsov 9 | --- 10 | drivers/hv/channel_mgmt.c | 4 +++- 11 | drivers/hv/hv_trace.h | 8 ++++++++ 12 | 2 files changed, 11 insertions(+), 1 deletion(-) 13 | 14 | --- a/drivers/hv/channel_mgmt.c 2017-12-05 16:55:48.670645161 -0800 15 | +++ b/drivers/hv/channel_mgmt.c 2017-12-05 16:55:48.666645213 -0800 16 | @@ -1221,9 +1221,11 @@ int vmbus_request_offers(void) 17 | 18 | msg->msgtype = CHANNELMSG_REQUESTOFFERS; 19 | 20 | - 21 | ret = vmbus_post_msg(msg, sizeof(struct vmbus_channel_message_header), 22 | true); 23 | + 24 | + trace_vmbus_request_offers(ret); 25 | + 26 | if (ret != 0) { 27 | pr_err("Unable to request offers - %d\n", ret); 28 | 29 | --- a/drivers/hv/hv_trace.h 2017-12-05 16:55:48.670645161 -0800 30 | +++ b/drivers/hv/hv_trace.h 2017-12-05 16:55:48.666645213 -0800 31 | @@ -122,6 +122,14 @@ TRACE_EVENT(vmbus_onversion_response, 32 | TP_printk("version_supported %d", __entry->ver) 33 | ); 34 | 35 | +TRACE_EVENT(vmbus_request_offers, 36 | + TP_PROTO(int ret), 37 | + TP_ARGS(ret), 38 | + TP_STRUCT__entry(__field(int, ret)), 39 | + TP_fast_assign(__entry->ret = ret), 40 | + TP_printk("sending ret %d", __entry->ret) 41 | + ); 42 | + 43 | #undef TRACE_INCLUDE_PATH 44 | #define TRACE_INCLUDE_PATH . 45 | #undef TRACE_INCLUDE_FILE 46 | -------------------------------------------------------------------------------- /Patches_Following_Mainline_History/4.4.211/0567-hv_netvsc-make-variable-local.patch: -------------------------------------------------------------------------------- 1 | From 205977a1c924959c45490fd8b296ece65c03fe85 Mon Sep 17 00:00:00 2001 2 | From: Stephen Hemminger 3 | Date: Tue, 23 Aug 2016 12:17:55 -0700 4 | Subject: hv_netvsc: make variable local 5 | Reply-To: joseph.salisbury@microsoft.com 6 | 7 | The variable m_ret is only used in one basic block. 8 | 9 | Signed-off-by: Stephen Hemminger 10 | Signed-off-by: David S. Miller 11 | (cherry picked from commit 6c4c137e5035e0e17fa40c223fa0a3167e0f65fa) 12 | Signed-off-by: Joseph Salisbury 13 | --- 14 | drivers/net/hyperv/netvsc.c | 6 +++--- 15 | 1 file changed, 3 insertions(+), 3 deletions(-) 16 | 17 | diff --git a/drivers/net/hyperv/netvsc.c b/drivers/net/hyperv/netvsc.c 18 | index 14b1bce40a50..6e80476cf652 100644 19 | --- a/drivers/net/hyperv/netvsc.c 20 | +++ b/drivers/net/hyperv/netvsc.c 21 | @@ -865,7 +865,7 @@ int netvsc_send(struct hv_device *device, 22 | struct sk_buff *skb) 23 | { 24 | struct netvsc_device *net_device; 25 | - int ret = 0, m_ret = 0; 26 | + int ret = 0; 27 | struct vmbus_channel *out_channel; 28 | u16 q_idx = packet->q_idx; 29 | u32 pktlen = packet->total_data_buflen, msd_len = 0; 30 | @@ -954,8 +954,8 @@ int netvsc_send(struct hv_device *device, 31 | } 32 | 33 | if (msd_send) { 34 | - m_ret = netvsc_send_pkt(device, msd_send, net_device, 35 | - NULL, msd_skb); 36 | + int m_ret = netvsc_send_pkt(device, msd_send, net_device, 37 | + NULL, msd_skb); 38 | 39 | if (m_ret != 0) { 40 | netvsc_free_send_slot(net_device, 41 | -- 42 | 2.17.1 43 | 44 | -------------------------------------------------------------------------------- /Legacy/4.15/0035-pci-hyperv-Use-only-16-bit-integer-for-PCI-domain.patch: -------------------------------------------------------------------------------- 1 | From a31547ef881742686e99c992452b89b2fab7451c Mon Sep 17 00:00:00 2001 2 | From: Haiyang Zhang 3 | Date: Thu, 20 Apr 2017 09:35:23 -0700 4 | Subject: [PATCH 35/55] pci-hyperv: Use only 16 bit integer for PCI domain 5 | 6 | This patch uses the lower 16 bits of the serial number as PCI 7 | domain, otherwise some drivers may not be able to handle it. 8 | 9 | Signed-off-by: Haiyang Zhang 10 | Signed-off-by: Sasha Levin 11 | Signed-off-by: Sasha Levin 12 | --- 13 | drivers/pci/host/pci-hyperv.c | 4 +++- 14 | 1 file changed, 3 insertions(+), 1 deletion(-) 15 | 16 | diff --git a/drivers/pci/host/pci-hyperv.c b/drivers/pci/host/pci-hyperv.c 17 | index 2faf38eab785..51d6cd803b7a 100644 18 | --- a/drivers/pci/host/pci-hyperv.c 19 | +++ b/drivers/pci/host/pci-hyperv.c 20 | @@ -1526,9 +1526,11 @@ static struct hv_pci_dev *new_pcichild_device(struct hv_pcibus_device *hbus, 21 | * can have shorter names than based on the bus instance UUID. 22 | * Only the first device serial number is used for domain, so the 23 | * domain number will not change after the first device is added. 24 | + * The lower 16 bits of the serial number is used, otherwise some 25 | + * drivers may not be able to handle it. 26 | */ 27 | if (list_empty(&hbus->children)) 28 | - hbus->sysdata.domain = desc->ser; 29 | + hbus->sysdata.domain = desc->ser & 0xFFFF; 30 | list_add_tail(&hpdev->list_entry, &hbus->children); 31 | spin_unlock_irqrestore(&hbus->device_list_lock, flags); 32 | return hpdev; 33 | -- 34 | 2.14.1 35 | 36 | -------------------------------------------------------------------------------- /Patches_Following_Mainline_History/4.4.211/0370-net-mlx5_core-Add-ConnectX-5-to-list-of-supported-de.patch: -------------------------------------------------------------------------------- 1 | From c71004a472838bfc1e7ee6f32a51618a25211651 Mon Sep 17 00:00:00 2001 2 | From: Majd Dibbiny 3 | Date: Fri, 22 Apr 2016 00:33:02 +0300 4 | Subject: net/mlx5_core: Add ConnectX-5 to list of supported devices 5 | Reply-To: joseph.salisbury@microsoft.com 6 | 7 | Add the upcoming ConnectX-5 devices (PF and VF) to the list of 8 | supported devices by the mlx5 driver. 9 | 10 | Signed-off-by: Majd Dibbiny 11 | Signed-off-by: Saeed Mahameed 12 | Signed-off-by: David S. Miller 13 | (cherry picked from commit 64dbbdfef245f67504ec403a5aebfcc7b92bd8c1) 14 | Signed-off-by: Joseph Salisbury 15 | --- 16 | drivers/net/ethernet/mellanox/mlx5/core/main.c | 2 ++ 17 | 1 file changed, 2 insertions(+) 18 | 19 | diff --git a/drivers/net/ethernet/mellanox/mlx5/core/main.c b/drivers/net/ethernet/mellanox/mlx5/core/main.c 20 | index 4411c287334d..b33427da8137 100644 21 | --- a/drivers/net/ethernet/mellanox/mlx5/core/main.c 22 | +++ b/drivers/net/ethernet/mellanox/mlx5/core/main.c 23 | @@ -1467,6 +1467,8 @@ static const struct pci_device_id mlx5_core_pci_table[] = { 24 | { PCI_VDEVICE(MELLANOX, 0x1014), MLX5_PCI_DEV_IS_VF}, /* ConnectX-4 VF */ 25 | { PCI_VDEVICE(MELLANOX, 0x1015) }, /* ConnectX-4LX */ 26 | { PCI_VDEVICE(MELLANOX, 0x1016), MLX5_PCI_DEV_IS_VF}, /* ConnectX-4LX VF */ 27 | + { PCI_VDEVICE(MELLANOX, 0x1017) }, /* ConnectX-5 */ 28 | + { PCI_VDEVICE(MELLANOX, 0x1018), MLX5_PCI_DEV_IS_VF}, /* ConnectX-5 VF */ 29 | { 0, } 30 | }; 31 | 32 | -- 33 | 2.17.1 34 | 35 | -------------------------------------------------------------------------------- /Patches_Following_Mainline_History/4.4.211/0397-net-mlx5e-Call-vxlan_get_rx_port-with-rtnl-lock.patch: -------------------------------------------------------------------------------- 1 | From d93409b7e501db7d12deb762a461b45595c45e32 Mon Sep 17 00:00:00 2001 2 | From: Matthew Finlay 3 | Date: Fri, 29 Apr 2016 01:36:31 +0300 4 | Subject: net/mlx5e: Call vxlan_get_rx_port() with rtnl lock 5 | Reply-To: joseph.salisbury@microsoft.com 6 | 7 | Hold the rtnl lock when calling vxlan_get_rx_port(). 8 | 9 | Fixes: b7aade15485a ("vxlan: break dependency with netdev drivers") 10 | Signed-off-by: Matthew Finlay 11 | Reported-by: Alexander Duyck 12 | Signed-off-by: Saeed Mahameed 13 | Signed-off-by: David S. Miller 14 | (cherry picked from commit 01a14098d3374e1b931d605da666300ee248d3d9) 15 | Signed-off-by: Joseph Salisbury 16 | --- 17 | drivers/net/ethernet/mellanox/mlx5/core/en_main.c | 5 ++++- 18 | 1 file changed, 4 insertions(+), 1 deletion(-) 19 | 20 | diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en_main.c b/drivers/net/ethernet/mellanox/mlx5/core/en_main.c 21 | index 9a58bb1ce55c..f7cf15478ad1 100644 22 | --- a/drivers/net/ethernet/mellanox/mlx5/core/en_main.c 23 | +++ b/drivers/net/ethernet/mellanox/mlx5/core/en_main.c 24 | @@ -2907,8 +2907,11 @@ static void *mlx5e_create_netdev(struct mlx5_core_dev *mdev) 25 | goto err_tc_cleanup; 26 | } 27 | 28 | - if (mlx5e_vxlan_allowed(mdev)) 29 | + if (mlx5e_vxlan_allowed(mdev)) { 30 | + rtnl_lock(); 31 | vxlan_get_rx_port(netdev); 32 | + rtnl_unlock(); 33 | + } 34 | 35 | mlx5e_enable_async_events(priv); 36 | schedule_work(&priv->set_rx_mode_work); 37 | -- 38 | 2.17.1 39 | 40 | -------------------------------------------------------------------------------- /Patches_Following_Mainline_History/4.4.211/0313-IB-mlx5-Add-support-for-CSUM-in-RX-flow.patch: -------------------------------------------------------------------------------- 1 | From 781019466a0cf391a8db9c138259bb9b6c8a3dc3 Mon Sep 17 00:00:00 2001 2 | From: Erez Shitrit 3 | Date: Sun, 21 Feb 2016 16:27:18 +0200 4 | Subject: IB/mlx5: Add support for CSUM in RX flow 5 | Reply-To: joseph.salisbury@microsoft.com 6 | 7 | The driver checks the csum from the HW when completion arrived and marks 8 | it in the wc->wc_flags field for the ulp drivers. 9 | These is for packets from type IB_WC_RECV only. 10 | 11 | Signed-off-by: Erez Shitrit 12 | Signed-off-by: Eran Ben Elisha 13 | Reviewed-by: Leon Romanovsky 14 | Signed-off-by: Doug Ledford 15 | (cherry picked from commit c7ce833b364bc19ef51b3c973c94a863e4af0e06) 16 | Signed-off-by: Joseph Salisbury 17 | --- 18 | drivers/infiniband/hw/mlx5/cq.c | 5 ++++- 19 | 1 file changed, 4 insertions(+), 1 deletion(-) 20 | 21 | diff --git a/drivers/infiniband/hw/mlx5/cq.c b/drivers/infiniband/hw/mlx5/cq.c 22 | index 40262fa93a4f..c20e4ccff3f3 100644 23 | --- a/drivers/infiniband/hw/mlx5/cq.c 24 | +++ b/drivers/infiniband/hw/mlx5/cq.c 25 | @@ -207,7 +207,10 @@ static void handle_responder(struct ib_wc *wc, struct mlx5_cqe64 *cqe, 26 | break; 27 | case MLX5_CQE_RESP_SEND: 28 | wc->opcode = IB_WC_RECV; 29 | - wc->wc_flags = 0; 30 | + wc->wc_flags = IB_WC_IP_CSUM_OK; 31 | + if (unlikely(!((cqe->hds_ip_ext & CQE_L3_OK) && 32 | + (cqe->hds_ip_ext & CQE_L4_OK)))) 33 | + wc->wc_flags = 0; 34 | break; 35 | case MLX5_CQE_RESP_SEND_IMM: 36 | wc->opcode = IB_WC_RECV; 37 | -- 38 | 2.17.1 39 | 40 | -------------------------------------------------------------------------------- /Patches_Following_Mainline_History/4.4.211/0832-hv_netvsc-set-master-device.patch: -------------------------------------------------------------------------------- 1 | From d5e039bb71c96b3bf3d8ab9db34b1cd793cfa5c2 Mon Sep 17 00:00:00 2001 2 | From: Stephen Hemminger 3 | Date: Wed, 9 May 2018 14:09:04 -0700 4 | Subject: hv_netvsc: set master device 5 | Reply-To: joseph.salisbury@microsoft.com 6 | 7 | The hyper-v transparent bonding should have used master_dev_link. 8 | The netvsc device should look like a master bond device not 9 | like the upper side of a tunnel. 10 | 11 | This makes the semantics the same so that userspace applications 12 | looking at network devices see the correct master relationshipship. 13 | 14 | Fixes: 0c195567a8f6 ("netvsc: transparent VF management") 15 | Signed-off-by: Stephen Hemminger 16 | Signed-off-by: David S. Miller 17 | (backported from commit 97f3efb64323beb0690576e9d74e94998ad6e82a) 18 | Signed-off-by: Joseph Salisbury 19 | --- 20 | drivers/net/hyperv/netvsc_drv.c | 3 ++- 21 | 1 file changed, 2 insertions(+), 1 deletion(-) 22 | 23 | diff --git a/drivers/net/hyperv/netvsc_drv.c b/drivers/net/hyperv/netvsc_drv.c 24 | index df3ae9115607..ded3fa8933b8 100644 25 | --- a/drivers/net/hyperv/netvsc_drv.c 26 | +++ b/drivers/net/hyperv/netvsc_drv.c 27 | @@ -1822,7 +1822,8 @@ static int netvsc_vf_join(struct net_device *vf_netdev, 28 | goto rx_handler_failed; 29 | } 30 | 31 | - ret = netdev_upper_dev_link(vf_netdev, ndev); 32 | + ret = netdev_master_upper_dev_link(vf_netdev, ndev, 33 | + NULL, NULL); 34 | if (ret != 0) { 35 | netdev_err(vf_netdev, 36 | "can not set master device %s (err = %d)\n", 37 | -- 38 | 2.17.1 39 | 40 | -------------------------------------------------------------------------------- /Patches_Following_Mainline_History/4.9.184/0108-hv_netvsc-set-master-device.patch: -------------------------------------------------------------------------------- 1 | From 8fa3ea20808a82473fd1988175fb19deeac5c7af Mon Sep 17 00:00:00 2001 2 | From: Stephen Hemminger 3 | Date: Wed, 9 May 2018 14:09:04 -0700 4 | Subject: hv_netvsc: set master device 5 | Reply-To: joseph.salisbury@microsoft.com 6 | 7 | The hyper-v transparent bonding should have used master_dev_link. 8 | The netvsc device should look like a master bond device not 9 | like the upper side of a tunnel. 10 | 11 | This makes the semantics the same so that userspace applications 12 | looking at network devices see the correct master relationshipship. 13 | 14 | Fixes: 0c195567a8f6 ("netvsc: transparent VF management") 15 | Signed-off-by: Stephen Hemminger 16 | Signed-off-by: David S. Miller 17 | (backported from commit 97f3efb64323beb0690576e9d74e94998ad6e82a) 18 | Signed-off-by: Joseph Salisbury 19 | --- 20 | drivers/net/hyperv/netvsc_drv.c | 3 ++- 21 | 1 file changed, 2 insertions(+), 1 deletion(-) 22 | 23 | diff --git a/drivers/net/hyperv/netvsc_drv.c b/drivers/net/hyperv/netvsc_drv.c 24 | index b0f28ace1705..c7a1a2c8cb33 100644 25 | --- a/drivers/net/hyperv/netvsc_drv.c 26 | +++ b/drivers/net/hyperv/netvsc_drv.c 27 | @@ -1841,7 +1841,8 @@ static int netvsc_vf_join(struct net_device *vf_netdev, 28 | goto rx_handler_failed; 29 | } 30 | 31 | - ret = netdev_upper_dev_link(vf_netdev, ndev); 32 | + ret = netdev_master_upper_dev_link(vf_netdev, ndev, 33 | + NULL, NULL); 34 | if (ret != 0) { 35 | netdev_err(vf_netdev, 36 | "can not set master device %s (err = %d)\n", 37 | -- 38 | 2.17.1 39 | 40 | -------------------------------------------------------------------------------- /Legacy/4.13/hv_netvsc-drop-received-traffic-if-device-not-opened.patch: -------------------------------------------------------------------------------- 1 | From d1d55efd783a20216bbd696767405f74352b6963 Mon Sep 17 00:00:00 2001 2 | From: Stephen Hemminger 3 | Date: Sat, 4 Nov 2017 07:20:58 +0100 4 | Subject: [PATCH 153/156] hv_netvsc: drop received traffic if device not opened 5 | 6 | If a packet is received from host but the network device is 7 | not up, then drop it. This also handles case where device is not 8 | fully registered yet. 9 | 10 | Signed-off-by: Stephen Hemminger 11 | --- 12 | drivers/net/hyperv/netvsc_drv.c | 3 --- 13 | drivers/net/hyperv/rndis_filter.c | 4 ++++ 14 | 2 files changed, 4 insertions(+), 3 deletions(-) 15 | 16 | --- a/drivers/net/hyperv/netvsc_drv.c 2017-12-05 16:55:56.602543358 -0800 17 | +++ b/drivers/net/hyperv/netvsc_drv.c 2017-12-05 16:55:56.598543410 -0800 18 | @@ -752,9 +752,6 @@ int netvsc_recv_callback(struct net_devi 19 | struct sk_buff *skb; 20 | struct netvsc_stats *rx_stats; 21 | 22 | - if (net->reg_state != NETREG_REGISTERED) 23 | - return NVSP_STAT_FAIL; 24 | - 25 | /* Allocate a skb - TODO direct I/O to pages? */ 26 | skb = netvsc_alloc_recv_skb(net, &nvchan->napi, 27 | csum_info, vlan, data, len); 28 | --- a/drivers/net/hyperv/rndis_filter.c 2017-12-05 16:55:56.602543358 -0800 29 | +++ b/drivers/net/hyperv/rndis_filter.c 2017-12-05 16:55:56.598543410 -0800 30 | @@ -379,6 +379,10 @@ static int rndis_filter_receive_data(str 31 | return NVSP_STAT_FAIL; 32 | } 33 | 34 | + /* silently drop frame if not opened */ 35 | + if (unlikely(dev->state != RNDIS_DEV_DATAINITIALIZED)) 36 | + return 0; 37 | + 38 | vlan = rndis_get_ppi(rndis_pkt, IEEE_8021Q_INFO); 39 | 40 | /* 41 | -------------------------------------------------------------------------------- /Patches_Following_Mainline_History/4.4.211/0750-netvsc-include-rtnetlink.h.patch: -------------------------------------------------------------------------------- 1 | From aa6fa8ef9b0ec6a726edc88fe7592917ddbdaf4a Mon Sep 17 00:00:00 2001 2 | From: stephen hemminger 3 | Date: Mon, 24 Jul 2017 10:57:29 -0700 4 | Subject: netvsc: include rtnetlink.h 5 | Reply-To: joseph.salisbury@microsoft.com 6 | 7 | Since these files use rtnl_derefernce make sure and include rtnetlink.h 8 | 9 | Signed-off-by: Stephen Hemminger 10 | Signed-off-by: David S. Miller 11 | (cherry picked from commit 27f5aa92ccafbe1bbc695307e3dee41a0e924c28) 12 | Signed-off-by: Joseph Salisbury 13 | --- 14 | drivers/net/hyperv/netvsc_drv.c | 2 ++ 15 | drivers/net/hyperv/rndis_filter.c | 1 + 16 | 2 files changed, 3 insertions(+) 17 | 18 | diff --git a/drivers/net/hyperv/netvsc_drv.c b/drivers/net/hyperv/netvsc_drv.c 19 | index 1fe601fb117d..008b3fec510f 100644 20 | --- a/drivers/net/hyperv/netvsc_drv.c 21 | +++ b/drivers/net/hyperv/netvsc_drv.c 22 | @@ -33,6 +33,8 @@ 23 | #include 24 | #include 25 | #include 26 | +#include 27 | + 28 | #include 29 | #include 30 | #include 31 | diff --git a/drivers/net/hyperv/rndis_filter.c b/drivers/net/hyperv/rndis_filter.c 32 | index 5cd2d6a05e63..67ef3c9c8314 100644 33 | --- a/drivers/net/hyperv/rndis_filter.c 34 | +++ b/drivers/net/hyperv/rndis_filter.c 35 | @@ -28,6 +28,7 @@ 36 | #include 37 | #include 38 | #include 39 | +#include 40 | 41 | #include "hyperv_net.h" 42 | 43 | -- 44 | 2.17.1 45 | 46 | -------------------------------------------------------------------------------- /Patches_Following_Mainline_History/4.9.184/0062-netvsc-include-rtnetlink.h.patch: -------------------------------------------------------------------------------- 1 | From 7c49f4bf0ca3da0ccb35717eac9105d2bb5d660d Mon Sep 17 00:00:00 2001 2 | From: stephen hemminger 3 | Date: Mon, 24 Jul 2017 10:57:29 -0700 4 | Subject: netvsc: include rtnetlink.h 5 | Reply-To: joseph.salisbury@microsoft.com 6 | 7 | Since these files use rtnl_derefernce make sure and include rtnetlink.h 8 | 9 | Signed-off-by: Stephen Hemminger 10 | Signed-off-by: David S. Miller 11 | (cherry picked from commit 27f5aa92ccafbe1bbc695307e3dee41a0e924c28) 12 | Signed-off-by: Joseph Salisbury 13 | --- 14 | drivers/net/hyperv/netvsc_drv.c | 2 ++ 15 | drivers/net/hyperv/rndis_filter.c | 1 + 16 | 2 files changed, 3 insertions(+) 17 | 18 | diff --git a/drivers/net/hyperv/netvsc_drv.c b/drivers/net/hyperv/netvsc_drv.c 19 | index 83607308f5c3..fcde17f8f108 100644 20 | --- a/drivers/net/hyperv/netvsc_drv.c 21 | +++ b/drivers/net/hyperv/netvsc_drv.c 22 | @@ -34,6 +34,8 @@ 23 | #include 24 | #include 25 | #include 26 | +#include 27 | + 28 | #include 29 | #include 30 | #include 31 | diff --git a/drivers/net/hyperv/rndis_filter.c b/drivers/net/hyperv/rndis_filter.c 32 | index 6e8d47d04311..5a07b654f405 100644 33 | --- a/drivers/net/hyperv/rndis_filter.c 34 | +++ b/drivers/net/hyperv/rndis_filter.c 35 | @@ -28,6 +28,7 @@ 36 | #include 37 | #include 38 | #include 39 | +#include 40 | 41 | #include "hyperv_net.h" 42 | 43 | -- 44 | 2.17.1 45 | 46 | -------------------------------------------------------------------------------- /Legacy/4.14/hv_netvsc-drop-received-traffic-if-device-not-opened.patch: -------------------------------------------------------------------------------- 1 | From ba44d002f65fed66549a9f7bc8792810ac476ea1 Mon Sep 17 00:00:00 2001 2 | From: Stephen Hemminger 3 | Date: Sat, 4 Nov 2017 07:20:58 +0100 4 | Subject: [PATCH 66/71] hv_netvsc: drop received traffic if device not opened 5 | 6 | If a packet is received from host but the network device is 7 | not up, then drop it. This also handles case where device is not 8 | fully registered yet. 9 | 10 | Signed-off-by: Stephen Hemminger 11 | --- 12 | drivers/net/hyperv/netvsc_drv.c | 3 --- 13 | drivers/net/hyperv/rndis_filter.c | 4 ++++ 14 | 2 files changed, 4 insertions(+), 3 deletions(-) 15 | 16 | --- a/drivers/net/hyperv/netvsc_drv.c 2018-01-19 15:23:51.504368615 -0800 17 | +++ b/drivers/net/hyperv/netvsc_drv.c 2018-01-19 15:23:51.500368669 -0800 18 | @@ -752,9 +752,6 @@ int netvsc_recv_callback(struct net_devi 19 | struct sk_buff *skb; 20 | struct netvsc_stats *rx_stats; 21 | 22 | - if (net->reg_state != NETREG_REGISTERED) 23 | - return NVSP_STAT_FAIL; 24 | - 25 | /* Allocate a skb - TODO direct I/O to pages? */ 26 | skb = netvsc_alloc_recv_skb(net, &nvchan->napi, 27 | csum_info, vlan, data, len); 28 | --- a/drivers/net/hyperv/rndis_filter.c 2018-01-19 15:23:51.504368615 -0800 29 | +++ b/drivers/net/hyperv/rndis_filter.c 2018-01-19 15:23:51.500368669 -0800 30 | @@ -380,6 +380,10 @@ static int rndis_filter_receive_data(str 31 | return NVSP_STAT_FAIL; 32 | } 33 | 34 | + /* silently drop frame if not opened */ 35 | + if (unlikely(dev->state != RNDIS_DEV_DATAINITIALIZED)) 36 | + return 0; 37 | + 38 | vlan = rndis_get_ppi(rndis_pkt, IEEE_8021Q_INFO); 39 | 40 | /* 41 | -------------------------------------------------------------------------------- /Patches_Following_Mainline_History/4.4.211/0648-hv_netvsc-init-completion-during-alloc.patch: -------------------------------------------------------------------------------- 1 | From f70bf0040dfd1ffc44019f42b47fa2c774e30bcc Mon Sep 17 00:00:00 2001 2 | From: Stephen Hemminger 3 | Date: Tue, 23 Aug 2016 12:17:51 -0700 4 | Subject: hv_netvsc: init completion during alloc 5 | Reply-To: joseph.salisbury@microsoft.com 6 | 7 | Move initialization to allocate where other fields are initialized. 8 | 9 | Signed-off-by: Stephen Hemminger 10 | Signed-off-by: David S. Miller 11 | (cherry picked from commit fd612602d6a7919982779fda914bd521e5778593) 12 | Signed-off-by: Joseph Salisbury 13 | --- 14 | drivers/net/hyperv/netvsc.c | 4 +--- 15 | 1 file changed, 1 insertion(+), 3 deletions(-) 16 | 17 | diff --git a/drivers/net/hyperv/netvsc.c b/drivers/net/hyperv/netvsc.c 18 | index 88ae3815391b..f072c951a904 100644 19 | --- a/drivers/net/hyperv/netvsc.c 20 | +++ b/drivers/net/hyperv/netvsc.c 21 | @@ -82,6 +82,7 @@ static struct netvsc_device *alloc_net_device(void) 22 | atomic_set(&net_device->open_cnt, 0); 23 | net_device->max_pkt = RNDIS_MAX_PKT_DEFAULT; 24 | net_device->pkt_align = RNDIS_PKT_ALIGN_DEFAULT; 25 | + init_completion(&net_device->channel_init_wait); 26 | 27 | return net_device; 28 | } 29 | @@ -1383,9 +1384,6 @@ int netvsc_device_add(struct hv_device *device, void *additional_info) 30 | 31 | net_device->ring_size = ring_size; 32 | 33 | - /* Initialize the NetVSC channel extension */ 34 | - init_completion(&net_device->channel_init_wait); 35 | - 36 | set_per_channel_state(device->channel, net_device->cb_buffer); 37 | 38 | /* Open the channel */ 39 | -- 40 | 2.17.1 41 | 42 | -------------------------------------------------------------------------------- /Legacy/4.15/0017-uio_hv_generic-fix-configuration-comments.patch: -------------------------------------------------------------------------------- 1 | From ada573c9bb7069dac5aa0584b9a4c389d673435e Mon Sep 17 00:00:00 2001 2 | From: Stephen Hemminger 3 | Date: Thu, 4 Jan 2018 14:13:27 -0800 4 | Subject: [PATCH 17/55] uio_hv_generic: fix configuration comments 5 | 6 | The suggested method for configuration does not work with 7 | current kernels. Paths and ids changed. 8 | 9 | Signed-off-by: Stephen Hemminger 10 | Signed-off-by: Greg Kroah-Hartman 11 | Signed-off-by: Sasha Levin 12 | --- 13 | drivers/uio/uio_hv_generic.c | 8 +++++--- 14 | 1 file changed, 5 insertions(+), 3 deletions(-) 15 | 16 | diff --git a/drivers/uio/uio_hv_generic.c b/drivers/uio/uio_hv_generic.c 17 | index 48d5327d38d4..4fea9a578990 100644 18 | --- a/drivers/uio/uio_hv_generic.c 19 | +++ b/drivers/uio/uio_hv_generic.c 20 | @@ -10,11 +10,13 @@ 21 | * Since the driver does not declare any device ids, you must allocate 22 | * id and bind the device to the driver yourself. For example: 23 | * 24 | + * Associate Network GUID with UIO device 25 | * # echo "f8615163-df3e-46c5-913f-f2d2f965ed0e" \ 26 | - * > /sys/bus/vmbus/drivers/uio_hv_generic 27 | - * # echo -n vmbus-ed963694-e847-4b2a-85af-bc9cfc11d6f3 \ 28 | + * > /sys/bus/vmbus/drivers/uio_hv_generic/new_id 29 | + * Then rebind 30 | + * # echo -n "ed963694-e847-4b2a-85af-bc9cfc11d6f3" \ 31 | * > /sys/bus/vmbus/drivers/hv_netvsc/unbind 32 | - * # echo -n vmbus-ed963694-e847-4b2a-85af-bc9cfc11d6f3 \ 33 | + * # echo -n "ed963694-e847-4b2a-85af-bc9cfc11d6f3" \ 34 | * > /sys/bus/vmbus/drivers/uio_hv_generic/bind 35 | */ 36 | 37 | -- 38 | 2.14.1 39 | 40 | -------------------------------------------------------------------------------- /Patches_Following_Mainline_History/4.14.141/0020-hv_netvsc-Fix-napi-reschedule-while-receive-completi.patch: -------------------------------------------------------------------------------- 1 | From 7d71bbe24f410646d28343415abd289997c57e58 Mon Sep 17 00:00:00 2001 2 | From: Haiyang Zhang 3 | Date: Tue, 17 Jul 2018 17:11:13 +0000 4 | Subject: hv_netvsc: Fix napi reschedule while receive completion is busy 5 | Reply-To: joseph.salisbury@microsoft.com 6 | 7 | If out ring is full temporarily and receive completion cannot go out, 8 | we may still need to reschedule napi if certain conditions are met. 9 | Otherwise the napi poll might be stopped forever, and cause network 10 | disconnect. 11 | 12 | Fixes: 7426b1a51803 ("netvsc: optimize receive completions") 13 | Signed-off-by: Stephen Hemminger 14 | Signed-off-by: Haiyang Zhang 15 | Signed-off-by: David S. Miller 16 | (cherry picked from commit 6b81b193b83e87da1ea13217d684b54fccf8ee8a) 17 | Signed-off-by: Joseph Salisbury 18 | --- 19 | drivers/net/hyperv/netvsc.c | 2 +- 20 | 1 file changed, 1 insertion(+), 1 deletion(-) 21 | 22 | diff --git a/drivers/net/hyperv/netvsc.c b/drivers/net/hyperv/netvsc.c 23 | index 43e1471d8a72..9c054759cc0c 100644 24 | --- a/drivers/net/hyperv/netvsc.c 25 | +++ b/drivers/net/hyperv/netvsc.c 26 | @@ -1302,7 +1302,7 @@ int netvsc_poll(struct napi_struct *napi, int budget) 27 | */ 28 | if (work_done < budget && 29 | napi_complete_done(napi, work_done) && 30 | - hv_end_read(&channel->inbound) && 31 | + (ret || hv_end_read(&channel->inbound)) && 32 | napi_schedule_prep(napi)) { 33 | hv_begin_read(&channel->inbound); 34 | __napi_schedule(napi); 35 | -- 36 | 2.17.1 37 | 38 | --------------------------------------------------------------------------------