Hi Kairui,
Thanks for reviewing this patch set and the advice!
On Wed, Mar 24, 2021 at 03:22:43PM +0800, Kairui Song wrote:
Hi Coiby, thanks for the patch.
On Thu, Mar 18, 2021 at 10:33 AM Coiby Xu <coxu(a)redhat.com> wrote:
>
> ifcfg scripts are deprecated. kexec-tools still set up network
> based on ifcfg scripts which lead to the issues like [1] [2].
>
> We can get network configuration including dns, bond and znet by
> parsing nmcli output instead. Another benefit is we could potentially
> avoid subtle bugs caused by namespace pollution because of sourcing
> ifcfg scripts.
After checking nmcli doc, it has some params just for using withing
scripts, like:
nmcli -g GENERAL.DEVICE -c no device show enp0s31f6
`-g` can help extract specified value, so maybe we can avoid the awk/sed calls
`-c no` disables the coloring of output, which should improve the performance.
Also, like `-t` can remove these redundant spacing and make it easier to parse.
Maybe we can improve this patch series with these params.
This issue is related to the third one.
And also we can keep the old ifcfg compatibility for now, and drop it
later, in case of any user sticking with old-style configurations.
I'll keep the old ifcfg compatibility in next version. Thanks for the
reminder.
Another concern is that `nmcli` is about 20x times slower than `ip`,
can you help measure the performance impact of this change?
Although `nmcli` is much slower than `ip`, this patch set actually
improves the performance compared with "source ifcfg-script".
There are two data sets comparing the execution time (second) of
kdump_install_net obtained on
ibm-z-110.rhts.eng.bos.redhat.com and
hpe-dl585g5-01.hpe2.lab.eng.bos.redhat.com for the following approaches,
- a: source ifcfg scripts
- b: get nmcli output once and extract the values if needed
- c: use "nmclig -g <field>"
a b c
ibm 0.20 0.11 0.14
hpe 0.31 0.25 0.24
So the results are determined by the times of "nmcli -g" being called
but the nmcli approaches should be always faster than the old approach.
Btw "time kdumpctl rebuild" shows 24.062s on
ibm-z-110.rhts.eng.bos.redhat.com. So kdump_install_net only takes 1% of
the building the kdump initramfs. So I'll take your "nmcli -g" approach
in the next version.
Here's the script to measure the execution time of kdump_install_net,
. /usr/lib/dracut/modules.d/99kdumpbase/module-setup.sh
. /lib/kdump/kdump-lib.sh
START=$(date +%s.%N)
# kdump_setup_netdev enc8000
kdump_install_net 10.73.194.36
END=$(date +%s.%N)
DIFF=$(echo "$END - $START" | bc)
echo $DIFF
And also, please also add [PATCH] prefix for the cover letter.
Sorry, "git format-patch" have added the prefix automatically but I
removed it when editing the subject of the cover letter.
>
> [1]
https://bugzilla.redhat.com/show_bug.cgi?id=1919052
> [2]
https://bugzilla.redhat.com/show_bug.cgi?id=1933679
>
> Coiby Xu (8):
> Parse option value from nmcli output
> Get nmcli connection id by ifname
> get nmcli connection show output by ifname
> setup s390 znet cmdline by parsing nmcli connection show output
> setup dns by parsing nmcli connection show output
> setup bond by parsing nmcli connection show output
> clean up codes related to ifcfg scripts
> clean up unused is_nm_* functions
>
> dracut-module-setup.sh | 72 +++++++++++++---------------
> kdump-lib.sh | 106 ++++++++++++-----------------------------
> 2 files changed, 65 insertions(+), 113 deletions(-)
>
> --
> 2.30.1
> _______________________________________________
> kexec mailing list -- kexec(a)lists.fedoraproject.org
> To unsubscribe send an email to kexec-leave(a)lists.fedoraproject.org
> Fedora Code of Conduct:
https://docs.fedoraproject.org/en-US/project/code-of-conduct/
> List Guidelines:
https://fedoraproject.org/wiki/Mailing_list_guidelines
> List Archives:
https://lists.fedoraproject.org/archives/list/kexec@lists.fedoraproject.org
> Do not reply to spam on the list, report it:
https://pagure.io/fedora-infrastructure
--
Best Regards,
Kairui Song
--
Best regards,
Coiby