]> git.proxmox.com Git - mirror_ubuntu-kernels.git/commitdiff
bonding: display xmit_hash_policy for non-dynamic-tlb mode
authorMahesh Bandewar <maheshb@google.com>
Sun, 5 Oct 2014 00:44:44 +0000 (17:44 -0700)
committerDavid S. Miller <davem@davemloft.net>
Mon, 6 Oct 2014 21:13:07 +0000 (17:13 -0400)
It's a trivial fix to display xmit_hash_policy for this new TLB mode
since it uses transmit-hash-poilicy as part of bonding-master info
(/proc/net/bonding/<bonding-interface).

Signed-off-by: Mahesh Bandewar <maheshb@google.com>
Reviewed-by: Nikolay Aleksandrov <nikolay@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/bonding/bond_procfs.c
drivers/net/bonding/bonding.h

index bb09d0442aa88e0d7a989bf4594551f5d66bbee5..a3948f8d1e533d86502c3efa4eac839dcba0e557 100644 (file)
@@ -73,8 +73,7 @@ static void bond_info_show_master(struct seq_file *seq)
 
        seq_printf(seq, "\n");
 
-       if (BOND_MODE(bond) == BOND_MODE_XOR ||
-               BOND_MODE(bond) == BOND_MODE_8023AD) {
+       if (bond_mode_uses_xmit_hash(bond)) {
                optval = bond_opt_get_val(BOND_OPT_XMIT_HASH,
                                          bond->params.xmit_policy);
                seq_printf(seq, "Transmit Hash Policy: %s (%d)\n",
index 57917e63b4e607917c5bab6a14a2c9b3e9133dca..5b022da9cad29d06e77cb5a1638edfb45fff8830 100644 (file)
@@ -274,6 +274,13 @@ static inline bool bond_is_nondyn_tlb(const struct bonding *bond)
               (bond->params.tlb_dynamic_lb == 0);
 }
 
+static inline bool bond_mode_uses_xmit_hash(const struct bonding *bond)
+{
+       return (BOND_MODE(bond) == BOND_MODE_8023AD ||
+               BOND_MODE(bond) == BOND_MODE_XOR ||
+               bond_is_nondyn_tlb(bond));
+}
+
 static inline bool bond_mode_uses_arp(int mode)
 {
        return mode != BOND_MODE_8023AD && mode != BOND_MODE_TLB &&