Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
Please login to access the resource
openSUSE:Leap:42.2:Update
kdump
kdump-net-0013-bond-from-wicked.patch
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File kdump-net-0013-bond-from-wicked.patch of Package kdump
From: Petr Tesarik <ptesarik@suse.com> Date: Fri, 2 Sep 2016 16:52:11 +0200 Subject: Prefer wicked configuration for bonding interfaces References: bsc#980328 Patch-mainline: v0.8.16 Git-commit: 9d6665fbb45395ee78659603bb3ddfc44d1790b7 This is ugly, because wicked parses the bonding options in its own way, so it is necessary to translate them back to the option names understood by the kernel. Signed-off-by: Petr Tesarik <ptesarik@suse.com> --- init/setup-kdump.functions | 102 +++++++++++++++++++++++++++++++++++++++------ 1 file changed, 89 insertions(+), 13 deletions(-) --- a/init/setup-kdump.functions +++ b/init/setup-kdump.functions @@ -296,28 +296,104 @@ function kdump_bond_config() # { { local bond="$1" local if slaves + local curslaves opts - for if in $(kdump_list_slaves "$bond") + # use wicked to read bonding settings, if possible + if [ -n "$(type -P wicked)" ] + then + local -a optvars=( + mode arp_interval arp_validate arp_all_targets arp_ip_target + miimon updelay downdelay use_carrier primary active_slave + xmit_hash_policy packets_per_slave tlb_dynamic_lb lacp_rate + ad_select min_links primary_reselect fail_over_mac num_grat_arp + num_unsol_na lp_interval resend_igmp all_slaves_active + ) + eval $( kdump_wicked_conf "$bond" \ + "curslaves=\"\$curslaves %{bond/slaves/slave/device}\"" \ + "mode=%{bond/mode}" \ + "arp_interval=%{bond/arpmon/interval}" \ + "arp_validate=%{bond/arpmon/validate}" \ + "arp_all_targets=%{bond/arpmon/validate-targets}" \ + "arp_ip_target=%{bond/arpmon/targets/ipv4-address}" \ + "miimon=%{bond/miimon/frequency}" \ + "updelay=%{bond/miimon/updelay}" \ + "downdelay=%{bond/miimon/downdelay}" \ + "use_carrier=%{bond/miimon/carrier-detect}" \ + "primary=%{bond/slaves/slave[primary=true]/device}" \ + "active_slave=%{bond/slaves/slave[active=true]/device}" \ + "xmit_hash_policy=%{bond/xmit-hash-policy}" \ + "packets_per_slave=%{bond/packets-per-slave}" \ + "tlb_dynamic_lb=%{bond/tlb-dynamic-lb}" \ + "lacp_rate=%{bond/lacp-rate}" \ + "ad_select=%{bond/ad-select}" \ + "min_links=%{bond/min-links}" \ + "primary_reselect=%{bond/primary-reselect}" \ + "fail_over_mac=%{bond/fail-over-mac}" \ + "num_grat_arp=%{bond/num-grat-arp}" \ + "num_unsol_na=%{bond/num-unsol-na}" \ + "lp_interval=%{bond/lp-interval}" \ + "resend_igmp=%{bond/resend-igmp}" \ + "all_slaves_active=%{bond/all-slaves-active}" + ) + + # translate incompatible option values + case "$mode" in + ieee802-3ad) mode="802.3ad" ;; + esac + case "$use_carrier" in + ioctl) use_carrier=0 ;; + netif) use_carrier=1 ;; + esac + case "$xmit_hash_policy" in + layer23) xmit_hash_policy="layer2+3" ;; + layer34) xmit_hash_policy="layer3+4" ;; + encap23) xmit_hash_policy="encap2+3" ;; + encap34) xmit_hash_policy="encap3+4" ;; + esac + case "$tlb_dynamic_lb" in + false) tlb_dynamic_lb=0 ;; + true) tlb_dynamic_lb=1 ;; + esac + case "$all_slaves_active" in + false) all_slaves_active=0 ;; + true) all_slaves_active=1 ;; + esac + + local var + for var in "${optvars[@]}" + do + [ -n "${!var}" ] && opts="$opts,${var}=${!var}" + done + fi + + # fall back to current configuration + if [ -z "$curslaves" ] + then + curslaves=$(kdump_list_slaves "$bond") + + local ro_keys=( + ad_actor_key + ad_aggregator + ad_num_ports + ad_partner_key + ad_partner_mac + ) + local ro_sed="s/,\(${ro_keys[@]}\)=[^,]*//g" + ro_sed="${ro_sed// /\|}" + + opts=$(ip -d link show "$bond" | \ + sed -n '3{s/^ *bond//;s/ \([^ ]*\) \([^ ]*\)/,\1=\2/g;'"$ro_sed"';p}') + fi + + for if in $curslaves do kdump_ifname_config "$if" || continue slaves="$slaves $iface" done iface="$bond" [ -n "$slaves" ] || return 1 - slaves="${slaves# }" - local ro_keys=( - ad_actor_key - ad_aggregator - ad_num_ports - ad_partner_key - ad_partner_mac - ) - local ro_sed="s/,\(${ro_keys[@]}\)=[^,]*//g" - ro_sed="${ro_sed// /\|}" - local opts=$(ip -d link show "$bond" | \ - sed -n '3{s/^ *bond//;s/ \([^ ]*\) \([^ ]*\)/,\1=\2/g;'"$ro_sed"';p}') echo -n " bond=$iface:${slaves// /,}:${opts#,}" } # }}}
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor