Skip to content

Commit

Permalink
bonding: display xmit_hash_policy for non-dynamic-tlb mode
Browse files Browse the repository at this point in the history
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 <[email protected]>
Reviewed-by: Nikolay Aleksandrov <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
  • Loading branch information
Mahesh Bandewar authored and davem330 committed Oct 6, 2014
1 parent 4e62ccd commit d702132
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
3 changes: 1 addition & 2 deletions drivers/net/bonding/bond_procfs.c
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
7 changes: 7 additions & 0 deletions drivers/net/bonding/bonding.h
Original file line number Diff line number Diff line change
Expand Up @@ -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 &&
Expand Down

0 comments on commit d702132

Please sign in to comment.