From 5314d83193be465afd747659ed72d24ed2f6aeab Mon Sep 17 00:00:00 2001 From: Coiby Xu Date: Fri, 2 Feb 2024 14:24:25 +0800 Subject: [PATCH] dracut-module-setup.sh: also install the driver of physical NIC for Hyper-V VM with accelerated networking Resolves: https://issues.redhat.com/browse/RHEL-23831 Upstream: Fedora Conflict: None commit bc101086e2c32594c8e01b50f0353f50d71f87f5 Author: Coiby Xu Date: Mon Dec 12 18:37:25 2022 +0800 dracut-module-setup.sh: also install the driver of physical NIC for Hyper-V VM with accelerated networking Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=2151842 Currently, vmcore dumping to remote fs fails on Azure Hyper-V VM with accelerated networking because it uses a physical NIC for accrelarated networking [1]. In this case, the driver for this physical NIC should be installed as well. [1] https://learn.microsoft.com/en-us/azure/virtual-network/accelerated-networking-overview Fixes: a65dde2d ("Reduce kdump memory consumption by only installing needed NIC drivers") Reported-by: Xiaoqiang Xiong Signed-off-by: Coiby Xu Reviewed-by: Philipp Rudo Signed-off-by: Coiby Xu --- dracut-module-setup.sh | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/dracut-module-setup.sh b/dracut-module-setup.sh index 1fa3011..19066ea 100755 --- a/dracut-module-setup.sh +++ b/dracut-module-setup.sh @@ -363,6 +363,14 @@ _get_nic_driver() { ethtool -i "$1" | sed -n -E "s/driver: (.*)/\1/p" } +_get_hpyerv_physical_driver() { + local _physical_nic + + _physical_nic=$(find /sys/class/net/"$1"/ -name 'lower_*' | sed -En "s/\/.*lower_(.*)/\1/p") + [[ -n $_physical_nic ]] || return + _get_nic_driver "$_physical_nic" +} + kdump_install_nic_driver() { local _netif _driver _drivers @@ -382,6 +390,11 @@ kdump_install_nic_driver() { elif [[ $_driver == "team" ]]; then # install the team mode drivers like team_mode_roundrobin.ko as well _driver='=drivers/net/team' + elif [[ $_driver == "hv_netvsc" ]]; then + # A Hyper-V VM may have accelerated networking + # https://learn.microsoft.com/en-us/azure/virtual-network/accelerated-networking-overview + # Install the driver of physical NIC as well + _drivers+=("$(_get_hpyerv_physical_driver "$_netif")") fi _drivers+=("$_driver")