ifenslave fails to set xmit_hash_policy

Bug #1768345 reported by Debabrata Banerjee
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
ifenslave (Ubuntu)
New
Undecided
Unassigned

Bug Description

This bug is present in 16.04 as well as 18.04, including the upstream version of ifenslave as far as I can tell. But as a formality let's assume ifenslave-2.9ubuntu1

/etc/network/if-pre-up.d/ifenslave assumes xmit_hash_policy can be set in any order, as below:

        # xmit_hash_policy can be set anytime.
        # Changing xmit_hash_policy requires $BOND_MASTER to be down.
        sysfs_change_down xmit_hash_policy "$IF_BOND_XMIT_HASH_POLICY"

However, this comment is not true. For example when trying to create the following in /etc/network/interfaces:

iface bond0 inet manual
        bond-slaves none
        bond-mode balance-tlb
        bond-miimon 100
        bond-xmit_hash_policy 1

Results in this error in dmesg on boot, since the mode balance-tlb is set after xmit_hash_policy:

[ 15.210041] xmit_hash_policy param is irrelevant in mode load balancing (round-robin)

The script should set xmit_hash_policy after setting mode.

An ugly workaround at the moment is to do:

iface bond0 inet manual
        bond-slaves none
        bond-miimon 100
        pre-up /bin/echo 5 > /sys/class/net/bond0/bonding/mode; /bin/echo
1 > /sys/class/net/bond0/bonding/xmit_hash_policy

Revision history for this message
Debabrata Banerjee (dbanerje) wrote :

I have fixes for this, but it's unclear how/where to contribute this code.

Revision history for this message
Debabrata Banerjee (dbanerje) wrote :
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.