netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [patch] (0/8) Adding 802.3ad support to bonding
@ 2003-03-20 15:14 Shmulik Hen
  2003-03-20 16:56 ` Jeff Garzik
  0 siblings, 1 reply; 2+ messages in thread
From: Shmulik Hen @ 2003-03-20 15:14 UTC (permalink / raw)
  To: Bonding Developement list, Bonding Announce list,
	Linux Net Mailing list, Linux Kernel Mailing list,
	Oss SGI Netdev list, Jeff Garzik

This patch adds support for point to point protocols (e.g. 802.3ad) 
over bonding that need to know the physical device the skb came on. It 
saves the real device in a new field in skbuff before overwriting it with 
the virtual interface device in skb_bond() and __vlan_hwaccel_rx().

This patch is against 2.4.21-pre5 kernel.



diff -Nuarp linux-2.4.21-pre5-orig/include/linux/if_vlan.h linux-2.4.21-pre5-new/include/linux/if_vlan.h
--- linux-2.4.21-pre5-orig/include/linux/if_vlan.h	2002-11-29 01:53:15.000000000 +0200
+++ linux-2.4.21-pre5-new/include/linux/if_vlan.h	2003-03-04 14:01:56.000000000 +0200
@@ -148,6 +148,9 @@ static inline int __vlan_hwaccel_rx(stru
 {
 	struct net_device_stats *stats;
 
+#ifdef BOND_POINT_TO_POINT_PROT
+	skb->real_dev = skb->dev;
+#endif //BOND_POINT_TO_POINT_PROT
 	skb->dev = grp->vlan_devices[vlan_tag & VLAN_VID_MASK];
 	if (skb->dev == NULL) {
 		kfree_skb(skb);
diff -Nuarp linux-2.4.21-pre5-orig/include/linux/skbuff.h linux-2.4.21-pre5-new/include/linux/skbuff.h
--- linux-2.4.21-pre5-orig/include/linux/skbuff.h	2003-03-04 13:43:27.000000000 +0200
+++ linux-2.4.21-pre5-new/include/linux/skbuff.h	2003-03-04 14:13:25.000000000 +0200
@@ -135,6 +135,11 @@ struct sk_buff {
 	struct sock	*sk;			/* Socket we are owned by 			*/
 	struct timeval	stamp;			/* Time we arrived				*/
 	struct net_device	*dev;		/* Device we arrived on/are leaving by		*/
+#define BOND_POINT_TO_POINT_PROT
+	struct net_device	*real_dev;	/* For support of point to point protocols 
+						   (e.g. 802.3ad) over bonding, we must save the
+						   physical device that got the packet before
+						   replacing skb->dev with the virtual device.  */
 
 	/* Transport layer header */
 	union
diff -Nuarp linux-2.4.21-pre5-orig/net/core/dev.c linux-2.4.21-pre5-new/net/core/dev.c
--- linux-2.4.21-pre5-orig/net/core/dev.c	2003-03-04 13:43:28.000000000 +0200
+++ linux-2.4.21-pre5-new/net/core/dev.c	2003-03-04 14:14:56.000000000 +0200
@@ -1328,8 +1328,12 @@ static __inline__ void skb_bond(struct s
 {
 	struct net_device *dev = skb->dev;
 
-	if (dev->master)
-		skb->dev = dev->master;
+	if (dev->master) {
+#ifdef BOND_POINT_TO_POINT_PROT
+		skb->real_dev = skb->dev;
+#endif //BOND_POINT_TO_POINT_PROT
+		skb->dev = dev->master;
+	}
 }
 
 static void net_tx_action(struct softirq_action *h)
diff -Nuarp linux-2.4.21-pre5-orig/net/core/skbuff.c linux-2.4.21-pre5-new/net/core/skbuff.c
--- linux-2.4.21-pre5-orig/net/core/skbuff.c	2003-03-04 13:43:28.000000000 +0200
+++ linux-2.4.21-pre5-new/net/core/skbuff.c	2003-03-04 14:17:44.000000000 +0200
@@ -231,6 +231,9 @@ static inline void skb_headerinit(void *
 	skb->sk = NULL;
 	skb->stamp.tv_sec=0;	/* No idea about time */
 	skb->dev = NULL;
+#ifdef BOND_POINT_TO_POINT_PROT
+	skb->real_dev = NULL;
+#endif //BOND_POINT_TO_POINT_PROT
 	skb->dst = NULL;
 	memset(skb->cb, 0, sizeof(skb->cb));
 	skb->pkt_type = PACKET_HOST;	/* Default type */
@@ -362,6 +365,9 @@ struct sk_buff *skb_clone(struct sk_buff
 	n->sk = NULL;
 	C(stamp);
 	C(dev);
+#ifdef BOND_POINT_TO_POINT_PROT
+	C(real_dev);
+#endif //BOND_POINT_TO_POINT_PROT
 	C(h);
 	C(nh);
 	C(mac);
@@ -417,6 +423,9 @@ static void copy_skb_header(struct sk_bu
 	new->list=NULL;
 	new->sk=NULL;
 	new->dev=old->dev;
+#ifdef BOND_POINT_TO_POINT_PROT
+	new->real_dev=old->real_dev;
+#endif //BOND_POINT_TO_POINT_PROT
 	new->priority=old->priority;
 	new->protocol=old->protocol;
 	new->dst=dst_clone(old->dst);

-- 
| Shmulik Hen                                    |
| Israel Design Center (Jerusalem)               |
| LAN Access Division                            |
| Intel Communications Group, Intel corp.        |
|                                                |
| Anti-Spam: shmulik dot hen at intel dot com    |







^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [patch] (0/8) Adding 802.3ad support to bonding
  2003-03-20 15:14 [patch] (0/8) Adding 802.3ad support to bonding Shmulik Hen
@ 2003-03-20 16:56 ` Jeff Garzik
  0 siblings, 0 replies; 2+ messages in thread
From: Jeff Garzik @ 2003-03-20 16:56 UTC (permalink / raw)
  To: Shmulik Hen
  Cc: Bonding Developement list, Bonding Announce list,
	Linux Net Mailing list, Linux Kernel Mailing list,
	Oss SGI Netdev list


I (and many others) will be going over these patches.  I also see that
somebody (davem?) applied your divide-by-zero patch to the mainline
kernel.

My initial comment is that we will want to work to eliminate these
ifdefs.  Other comments will follow.

Thanks to Intel for these efforts!

	Jeff

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2003-03-20 16:56 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-03-20 15:14 [patch] (0/8) Adding 802.3ad support to bonding Shmulik Hen
2003-03-20 16:56 ` Jeff Garzik

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).