On Tue, 21 Feb 2006 16:36:44 -0800
Jay Vosburgh <[EMAIL PROTECTED]> wrote:

> 
>       Originally submitted by Kenzo Iwami; his original description is:
> 
> The current bonding driver receives duplicate packets when broadcast/
> multicast packets are sent by other devices or packets are flooded by the
> switch. In this patch, new flags are added in priv_flags of net_device
> structure to let the bonding driver discard duplicate packets in
> dev.c:skb_bond().
> 
>       Modified by Jay Vosburgh to change a define name, update some
> comments, rearrange the new skb_bond() for clarity, clear all bonding
> priv_flags on slave release, and update the driver version.
> 
> Signed-off-by: Kenzo Iwami <[EMAIL PROTECTED]>
> Signed-off-by: Jay Vosburgh <[EMAIL PROTECTED]>
> 
> 
> --- netdev-2.6.git-upstream/include/linux/if.h        2006/02/21 17:23:48     
> 1.1
> +++ netdev-2.6.git-upstream/include/linux/if.h        2006/02/21 23:29:56     
> 1.2
> @@ -52,6 +52,9 @@
>  /* Private (from user) interface flags (netdevice->priv_flags). */
>  #define IFF_802_1Q_VLAN 0x1             /* 802.1Q VLAN device.          */
>  #define IFF_EBRIDGE  0x2             /* Ethernet bridging device.    */
> +#define IFF_SLAVE_INACTIVE   0x4     /* bonding slave not the curr. active */
> +#define IFF_MASTER_8023AD    0x8     /* bonding master, 802.3ad.     */
> +#define IFF_MASTER_ALB       0x10            /* bonding master, balance-alb. 
> */
>  
>  #define IF_GET_IFACE 0x0001          /* for querying only */
>  #define IF_GET_PROTO 0x0002
> --- netdev-2.6.git-upstream/include/linux/if_ether.h  2006/02/21 17:23:48     
> 1.1
> +++ netdev-2.6.git-upstream/include/linux/if_ether.h  2006/02/21 23:29:56     
> 1.2
> @@ -61,6 +61,7 @@
>  #define ETH_P_8021Q  0x8100          /* 802.1Q VLAN Extended Header  */
>  #define ETH_P_IPX    0x8137          /* IPX over DIX                 */
>  #define ETH_P_IPV6   0x86DD          /* IPv6 over bluebook           */
> +#define ETH_P_SLOW   0x8809          /* Slow Protocol. See 802.3ad 43B */
>  #define ETH_P_WCCP   0x883E          /* Web-cache coordination protocol
>                                        * defined in 
> draft-wilson-wrec-wccp-v2-00.txt */
>  #define ETH_P_PPP_DISC       0x8863          /* PPPoE discovery messages     
> */
> --- netdev-2.6.git-upstream/net/core/dev.c    2006/02/21 17:24:03     1.1
> +++ netdev-2.6.git-upstream/net/core/dev.c    2006/02/21 23:30:28     1.2
> @@ -1446,8 +1446,29 @@ static inline struct net_device *skb_bon
>  {
>       struct net_device *dev = skb->dev;
>  
> -     if (dev->master)
> +     if (dev->master) {
> +             /*
> +              * On bonding slaves other than the currently active
> +              * slave, suppress duplicates except for 802.3ad
> +              * ETH_P_SLOW and alb non-mcast/bcast.
> +              */
> +             if (dev->priv_flags & IFF_SLAVE_INACTIVE) {
> +                     if (dev->master->priv_flags & IFF_MASTER_ALB) {
> +                             if (skb->pkt_type != PACKET_BROADCAST &&
> +                                 skb->pkt_type != PACKET_MULTICAST)
> +                                     goto keep;
> +                     }
> +
> +                     if (dev->master->priv_flags & IFF_MASTER_8023AD &&
> +                         skb->protocol == __constant_htons(ETH_P_SLOW))

Don't use the __constant_htons() form except in initialized tables and switch 
statements.
-
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to