mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Jay Vosburgh <fubar@us.ibm.com>
To: "David S. Miller" <davem@davemloft.net>
Cc: "Godse, Radheka" <radheka.godse@intel.com>,
	bonding-devel@lists.sourceforge.net,
	ctindel@users.sourceforge.net, linux-kernel@vger.kernel.org
Subject: Re: [Bonding-devel][PATCH]Zero Copy Transmit Support (Update)
Date: Fri, 12 Nov 2004 13:56:26 -0800	[thread overview]
Message-ID: <200411122156.iACLuQLq014316@death.nxdomain.ibm.com> (raw)
In-Reply-To: Message from "David S. Miller" <davem@davemloft.net>  of "Fri, 12 Nov 2004 13:20:50 PST." <20041112132050.45b83434.davem@davemloft.net>


David S. Miller <davem@davemloft.net> wrote:
>> I had similar thoughts but then, the bond device does not have any
>> slaves attached to it at load time. By publishing them upfront the bond
>> device is able to take advantage of hardware acceleration if it is later
>> available...

	"Shlomi Yaakobovich" <Shlomi@exanet.com> posted a patch to
update the features as slaves are added and removed, based on the
features advertised by the slaves.  His original patch wasn't properly
based; this is the same change set redone to patch against 2.6.9.

	-J

---
	-Jay Vosburgh, IBM Linux Technology Center, fubar@us.ibm.com


Index: linux-2681-bd/drivers/net/bonding/bond_main.c
===================================================================
RCS file: /sda7/CVS/linux-2681-bd/drivers/net/bonding/bond_main.c,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -u -r1.2 -r1.3
--- linux-2681-bd/drivers/net/bonding/bond_main.c	15 Oct 2004 22:11:14 -0000	1.2
+++ linux-2681-bd/drivers/net/bonding/bond_main.c	15 Oct 2004 23:27:34 -0000	1.3
@@ -1580,6 +1580,32 @@
 	return 0;
 }
 
+enum { /* don't set these here */
+       BOND_MAINTAINED_FEATURES =
+               NETIF_F_VLAN_CHALLENGED|NETIF_F_HW_VLAN_TX |
+               NETIF_F_HW_VLAN_RX |NETIF_F_HW_VLAN_FILTER
+};
+
+static void bond_set_features(struct net_device *bond_dev)
+{
+       struct bonding *bond = bond_dev->priv;
+       struct slave *slave;
+       int i, features = 0;
+
+       bond_for_each_slave(bond, slave, i) {
+               struct net_device *slave_dev = slave->dev;
+               if (i == 0) {
+                       features = slave_dev->features;
+	       } else {
+                       features &= slave_dev->features;
+	       }
+       }
+       /* clear all previous features */
+       bond_dev->features &= BOND_MAINTAINED_FEATURES;
+       /* add common features, don't touch driver maintained ones */
+       bond_dev->features |= (features & ~BOND_MAINTAINED_FEATURES);
+}
+
 /* enslave device <slave> to bond device <master> */
 static int bond_enslave(struct net_device *bond_dev, struct net_device *slave_dev)
 {
@@ -1972,6 +1998,7 @@
 	       new_slave->link != BOND_LINK_DOWN ? "n up" : " down");
 
 	/* enslave is successful */
+	bond_set_features(bond_dev);
 	return 0;
 
 /* Undo stages on error */
@@ -2177,6 +2204,7 @@
 
 	kfree(slave);
 
+	bond_set_features(bond_dev);
 	return 0;  /* deletion OK */
 }
 
@@ -2292,6 +2320,7 @@
 	printk(KERN_INFO DRV_NAME
 	       ": %s: released all slaves\n",
 	       bond_dev->name);
+	bond_set_features(bond_dev);
 
 out:
 	write_unlock_bh(&bond->lock);

  reply	other threads:[~2004-11-12 22:00 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-11-12 21:31 Godse, Radheka
2004-11-12 21:20 ` David S. Miller
2004-11-12 21:56   ` Jay Vosburgh [this message]
2004-11-12 21:49     ` David S. Miller
2004-11-12 22:20       ` Jay Vosburgh
2004-11-12 22:24         ` David S. Miller
2004-11-12 23:51 Radheka Godse
2004-11-12  0:00 ` David S. Miller
2004-11-18 19:02 Godse, Radheka

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=200411122156.iACLuQLq014316@death.nxdomain.ibm.com \
    --to=fubar@us.ibm.com \
    --cc=bonding-devel@lists.sourceforge.net \
    --cc=ctindel@users.sourceforge.net \
    --cc=davem@davemloft.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=radheka.godse@intel.com \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®