All of lore.kernel.org
 help / color / mirror / Atom feed
From: Christophe Devriese <christophe.devriese@eth1.org>
To: Linux netdev <netdev@vger.kernel.org>
Subject: Re: PATCH Fix bonding active-backup behavior for VLAN interfaces
Date: Fri, 28 Jul 2006 23:50:32 +0200	[thread overview]
Message-ID: <20060728215032.GA17930@walrus.eth1.org> (raw)
In-Reply-To: <44CA34D0.1070507@candelatech.com>

[-- Attachment #1: Type: text/plain, Size: 2792 bytes --]

I basically move the skb_bond method into if_bonding.h, include that file
in if_vlan ( and call it from the vlan forwarding path, and the netif_rx
routine ). 

Somehow this patch is very incomplete. Let me try again.

sorry for the trouble. (I'm new at this)

Regards,

Christophe 

> Christophe Devriese wrote:
> >diff -rU3 linux-2.6.17.7/net/core/dev.c 
> >linux-2.6.17.7-wapper/net/core/dev.c
> >--- linux-2.6.17.7/net/core/dev.c       2006-07-25 05:36:01.000000000 +0200
> >+++ linux-2.6.17.7-wapper/net/core/dev.c        2006-07-27 
> >20:16:36.000000000 +0200
> >@@ -88,6 +88,7 @@
> > #include <linux/sockios.h>
> > #include <linux/errno.h>
> > #include <linux/interrupt.h>
> >+#include <linux/if_bonding.h>
> > #include <linux/if_ether.h>
> > #include <linux/netdevice.h>
> > #include <linux/etherdevice.h>
> >@@ -1518,37 +1519,6 @@
> >
> > EXPORT_SYMBOL(netif_rx_ni);
> >
> >-static inline struct net_device *skb_bond(struct sk_buff *skb)
> >-{
> >-       struct net_device *dev = skb->dev;
> >-
> >-       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))
> >-                               goto keep;
> >-
> >-                       kfree_skb(skb);
> >-                       return NULL;
> >-               }
> >-keep:
> >-               skb->dev = dev->master;
> >-       }
> >-
> >-       return dev;
> >-}
> >-
> > static void net_tx_action(struct softirq_action *h)
> > {
> >        struct softnet_data *sd = &__get_cpu_var(softnet_data);
> >
> 
> 
> -- 
> Ben Greear <greearb@candelatech.com>
> Candela Technologies Inc  http://www.candelatech.com
> 
> -
> To unsubscribe from this list: send the line "unsubscribe netdev" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

-- 
-----------------------------------------------------------------------
Christophe Devriese                                               EURiD
Network Adminstrator / Developer
christophe.devriese@eth1.org
---------------------------- http://www.eth1.org ----------------------


[-- Attachment #2: skbbondvlan.patch --]
[-- Type: text/plain, Size: 3474 bytes --]

diff -rU3 linux-2.6.17.7/include/linux/if_bonding.h linux-2.6.17.7-wapper/include/linux/if_bonding.h
--- linux-2.6.17.7/include/linux/if_bonding.h	2006-07-25 05:36:01.000000000 +0200
+++ linux-2.6.17.7-wapper/include/linux/if_bonding.h	2006-07-27 21:17:25.000000000 +0200
@@ -46,6 +46,7 @@
 #include <linux/if.h>
 #include <linux/types.h>
 #include <linux/if_ether.h>
+#include <linux/netdevice.h>
 
 /* userland - kernel ABI version (2003/05/08) */
 #define BOND_ABI_VERSION 2
@@ -110,6 +111,37 @@
 	__u8 partner_system[ETH_ALEN];
 };
 
+static inline struct net_device *skb_bond(struct sk_buff *skb)
+{
+	struct net_device *dev = skb->dev;
+
+	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))
+				goto keep;
+		
+			kfree_skb(skb);
+			return NULL;
+		}
+keep:
+		skb->dev = dev->master;
+	}
+
+	return dev;
+}
+
 #endif /* _LINUX_IF_BONDING_H */
 
 /*
diff -rU3 linux-2.6.17.7/include/linux/if_vlan.h linux-2.6.17.7-wapper/include/linux/if_vlan.h
--- linux-2.6.17.7/include/linux/if_vlan.h	2006-07-25 05:36:01.000000000 +0200
+++ linux-2.6.17.7-wapper/include/linux/if_vlan.h	2006-07-27 20:16:36.000000000 +0200
@@ -24,6 +24,7 @@
 struct hlist_node;
 
 #include <linux/proc_fs.h> /* for proc_dir_entry */
+#include <linux/if_bonding.h> /* for skb_bond */
 #include <linux/netdevice.h>
 
 #define VLAN_HLEN	4		/* The additional bytes (on top of the Ethernet header)
@@ -154,6 +155,12 @@
 				    unsigned short vlan_tag, int polling)
 {
 	struct net_device_stats *stats;
+	struct net_device *orig_dev;
+
+	orig_dev = skb_bond(skb);
+
+	if (!orig_dev) 
+		return NET_RX_DROP;
 
 	skb->dev = grp->vlan_devices[vlan_tag & VLAN_VID_MASK];
 	if (skb->dev == NULL) {
diff -rU3 linux-2.6.17.7/net/core/dev.c linux-2.6.17.7-wapper/net/core/dev.c
--- linux-2.6.17.7/net/core/dev.c	2006-07-25 05:36:01.000000000 +0200
+++ linux-2.6.17.7-wapper/net/core/dev.c	2006-07-27 20:16:36.000000000 +0200
@@ -88,6 +88,7 @@
 #include <linux/sockios.h>
 #include <linux/errno.h>
 #include <linux/interrupt.h>
+#include <linux/if_bonding.h>
 #include <linux/if_ether.h>
 #include <linux/netdevice.h>
 #include <linux/etherdevice.h>
@@ -1518,37 +1519,6 @@
 
 EXPORT_SYMBOL(netif_rx_ni);
 
-static inline struct net_device *skb_bond(struct sk_buff *skb)
-{
-	struct net_device *dev = skb->dev;
-
-	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))
-				goto keep;
-		
-			kfree_skb(skb);
-			return NULL;
-		}
-keep:
-		skb->dev = dev->master;
-	}
-
-	return dev;
-}
-
 static void net_tx_action(struct softirq_action *h)
 {
 	struct softnet_data *sd = &__get_cpu_var(softnet_data);

  reply	other threads:[~2006-07-28 21:42 UTC|newest]

Thread overview: 47+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-07-28  9:44 PATCH Fix bonding active-backup behavior for VLAN interfaces Christophe Devriese
2006-07-28 16:01 ` Ben Greear
2006-07-28 21:50   ` Christophe Devriese [this message]
2006-07-28 21:55     ` Ben Greear
2006-07-28 22:15       ` Christophe Devriese
     [not found]       ` <20060728221455.GA25610@walrus.eth1.org>
     [not found]         ` <44CA8AF1.3020408@candelatech.com>
2006-07-28 22:58           ` Christophe Devriese
2006-07-28 22:55             ` David Miller
2006-07-28 23:14               ` Ben Greear
2006-07-31  3:50       ` David Miller
2006-07-31  8:15         ` Christophe Devriese
2006-07-31 12:30           ` Linville's L2 rant... -- " John W. Linville
2006-07-31 16:48             ` Christophe Devriese
2006-08-01  1:39             ` Jamal Hadi Salim
2006-08-01 12:08               ` John W. Linville
2006-08-01 12:33                 ` Jamal Hadi Salim
2006-08-01 16:10                   ` Ben Greear
2006-08-01 16:52                     ` John W. Linville
2006-08-01 17:04                       ` Ben Greear
2006-08-01 19:47                         ` Krzysztof Halasa
2006-08-01 16:48                   ` John W. Linville
2006-08-01 16:17                 ` Ben Greear
2006-08-01 17:03                   ` John W. Linville
2006-08-01 17:21                     ` Ben Greear
2006-08-02  9:02                       ` Christophe Devriese
2006-08-02 17:37                         ` Stackable devices Stephen Hemminger
2006-08-02 17:50                           ` Ben Greear
2006-08-08 12:03                             ` Christophe Devriese
2006-08-08 16:36                               ` Ben Greear
2006-08-09 13:57                                 ` Christophe Devriese
2006-08-12 18:43                                   ` Ben Greear
2006-08-12 19:29                                   ` Ben Greear
2006-08-02 20:58           ` PATCH Fix bonding active-backup behavior for VLAN interfaces David Miller
2006-08-03  9:18             ` Krzysztof Oledzki
2006-08-10 18:18               ` Krzysztof Oledzki
2006-08-11  6:45                 ` David Miller
2006-08-11  8:50                   ` Christophe Devriese
2006-08-11  8:53                     ` David Miller
2006-08-14  8:16                   ` Christophe Devriese
2006-08-14  8:47                     ` David Miller
2006-08-14  8:47                     ` David Miller
2006-08-03 13:34             ` Christophe Devriese
2006-08-04  1:01             ` Jay Vosburgh
2006-08-15  0:09               ` David Miller
2006-08-15 22:18                 ` Jay Vosburgh
2006-08-15 22:27                   ` David Miller
2006-08-16 19:30                 ` Krzysztof Oledzki
2006-08-20 19:41                 ` Christophe Devriese

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20060728215032.GA17930@walrus.eth1.org \
    --to=christophe.devriese@eth1.org \
    --cc=netdev@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.