lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1396281158.29410.41.camel@edumazet-glaptop2.roam.corp.google.com>
Date:	Mon, 31 Mar 2014 08:52:38 -0700
From:	Eric Dumazet <eric.dumazet@...il.com>
To:	Mahesh Bandewar <maheshb@...gle.com>
Cc:	Jay Vosburgh <fubar@...ibm.com>,
	Veaceslav Falico <vfalico@...hat.com>,
	Andy Gospodarek <andy@...yhouse.net>,
	David Miller <davem@...emloft.net>,
	netdev <netdev@...r.kernel.org>,
	Eric Dumazet <edumazet@...gle.com>,
	Maciej Zenczykowski <maze@...gle.com>
Subject: Re: [PATCH 4/5] bonding: Added bond_tlb_xmit() for tlb mode.

On Fri, 2014-03-28 at 22:29 -0700, Mahesh Bandewar wrote:
> Re-organized the xmit function for the lb mode separating tlb xmit
> from the alb mode. This will enable use of the hashing policies
> like 802.3ad mode. Also extended use of xmit-hash-policy to tlb mode.
> 
> Now the tlb-mode defaults to BOND_XMIT_POLICY_LAYER2 if the xmit policy
> module parameter is not set (just like 802.3ad, or Xor mode).
> 
> Signed-off-by: Mahesh Bandewar <maheshb@...gle.com>
> ---
>  drivers/net/bonding/bond_alb.c     | 25 +++++++++++++++++++++++++
>  drivers/net/bonding/bond_alb.h     |  1 +
>  drivers/net/bonding/bond_main.c    |  6 ++++--
>  drivers/net/bonding/bond_options.c |  2 +-
>  4 files changed, 31 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/net/bonding/bond_alb.c b/drivers/net/bonding/bond_alb.c
> index 5cd36016c393..8b7426ce6182 100644
> --- a/drivers/net/bonding/bond_alb.c
> +++ b/drivers/net/bonding/bond_alb.c
> @@ -1381,6 +1381,31 @@ out:
>  	return NETDEV_TX_OK;
>  }
>  
> +int bond_tlb_xmit(struct sk_buff *skb, struct net_device *bond_dev)
> +{
> +	struct bonding *bond = netdev_priv(bond_dev);
> +	struct ethhdr *eth_data;
> +	struct slave *tx_slave = NULL;
> +	u32 hash_index = 0;
> +
> +	skb_reset_mac_header(skb);
> +	eth_data = eth_hdr(skb);
> +
> +	/* Do not TX balance any multicast or broadcast */
> +	if (!is_multicast_ether_addr(eth_data->h_dest)) {
> +		switch (ntohs(skb->protocol)) {

Nit :

You can avoid the ntohs(skb->protocol)

> +		case ETH_P_IP:

by using "   case htons(ETH_P_IP)


> +		case ETH_P_IPX: /* In case of IPX, it will falback to L2 hash */
> +		case ETH_P_IPV6:
> +			hash_index = bond_xmit_hash(bond, skb);
> +			tx_slave = tlb_choose_channel(bond, hash_index & 0xFF, skb->len);
> +			break;
> +		}
> +	}


--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ