From patchwork Thu Apr 23 23:47:41 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jay Vosburgh X-Patchwork-Id: 26390 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming@bilbo.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from ozlabs.org (ozlabs.org [203.10.76.45]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client CN "mx.ozlabs.org", Issuer "CA Cert Signing Authority" (verified OK)) by bilbo.ozlabs.org (Postfix) with ESMTPS id 44D73B7067 for ; Fri, 24 Apr 2009 09:47:45 +1000 (EST) Received: by ozlabs.org (Postfix) id 35E33DE140; Fri, 24 Apr 2009 09:47:45 +1000 (EST) Delivered-To: patchwork-incoming@ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.176.167]) by ozlabs.org (Postfix) with ESMTP id CFAABDE13F for ; Fri, 24 Apr 2009 09:47:44 +1000 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751064AbZDWXri (ORCPT ); Thu, 23 Apr 2009 19:47:38 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1750952AbZDWXri (ORCPT ); Thu, 23 Apr 2009 19:47:38 -0400 Received: from e35.co.us.ibm.com ([32.97.110.153]:48370 "EHLO e35.co.us.ibm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750860AbZDWXrh (ORCPT ); Thu, 23 Apr 2009 19:47:37 -0400 Received: from d03relay04.boulder.ibm.com (d03relay04.boulder.ibm.com [9.17.195.106]) by e35.co.us.ibm.com (8.13.1/8.13.1) with ESMTP id n3NNg8qW003734 for ; Thu, 23 Apr 2009 17:42:08 -0600 Received: from d03av04.boulder.ibm.com (d03av04.boulder.ibm.com [9.17.195.170]) by d03relay04.boulder.ibm.com (8.13.8/8.13.8/NCO v9.2) with ESMTP id n3NNlbxj071986 for ; Thu, 23 Apr 2009 17:47:37 -0600 Received: from d03av04.boulder.ibm.com (loopback [127.0.0.1]) by d03av04.boulder.ibm.com (8.12.11.20060308/8.13.3) with ESMTP id n3NNlah8013405 for ; Thu, 23 Apr 2009 17:47:37 -0600 Received: from death.nxdomain.ibm.com ([9.49.206.31]) by d03av04.boulder.ibm.com (8.12.11.20060308/8.12.11) with ESMTP id n3NNlYNR013340 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Thu, 23 Apr 2009 17:47:36 -0600 Received: from localhost ([127.0.0.1] helo=death.nxdomain.ibm.com) by death.nxdomain.ibm.com with esmtp (Exim 4.69) (envelope-from ) id 1Lx8dp-0006UR-80; Thu, 23 Apr 2009 16:47:41 -0700 From: Jay Vosburgh To: Or Gerlitz cc: David Miller , netdev@vger.kernel.org Subject: Re: zero features for a vlan over bond / vlan features In-reply-to: <49E73C94.5030009@Voltaire.com> References: <6223.1239113811@death.nxdomain.ibm.com> <49E73C94.5030009@Voltaire.com> Comments: In-reply-to Or Gerlitz message dated "Thu, 16 Apr 2009 17:11:32 +0300." X-Mailer: MH-E 8.0.3; nmh 1.3-RC3; GNU Emacs 22.2.1 Date: Thu, 23 Apr 2009 16:47:41 -0700 Message-ID: <24949.1240530461@death.nxdomain.ibm.com> Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org Or Gerlitz wrote: >Jay Vosburgh wrote: >> The features system now has a dev->vlan_features that lists the >> features that will work through a vlan; bond_compute_features isn't >> using netdev_increment/fix_features to additionally compute the vlan_features, >> so that's ending up always empty even if the underlying device supports vlan passthrough. >> I'm working on a patch; I'll see what I can come up with. > >Great, I will be happy to test the patch once you have it... Ok, here's a patch, but I'm not sure it's the right patch. I'm not entirely sure if the vlan_features should be amassed as the regular features are, or if it should be a strict subset (slave0->vlan_features & slave1->vlan_features, etc). This patch does the former, collecting the vlan_features in a manner analagous to the regular features. This is strictly a test patch, it's still got printks and such in it. -J --- -Jay Vosburgh, IBM Linux Technology Center, fubar@us.ibm.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 diff --git a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c index 99610f3..967c5b6 100644 --- a/drivers/net/bonding/bond_main.c +++ b/drivers/net/bonding/bond_main.c @@ -1341,6 +1341,7 @@ static int bond_compute_features(struct bonding *bond) struct slave *slave; struct net_device *bond_dev = bond->dev; unsigned long features = bond_dev->features; + unsigned long vlan_features = 0; unsigned short max_hard_header_len = max((u16)ETH_HLEN, bond_dev->hard_header_len); int i; @@ -1352,11 +1353,18 @@ static int bond_compute_features(struct bonding *bond) goto done; features &= ~NETIF_F_ONE_FOR_ALL; - + vlan_features = bond->first_slave->dev->vlan_features; + printk("vf %lx\n", vlan_features); bond_for_each_slave(bond, slave, i) { features = netdev_increment_features(features, slave->dev->features, NETIF_F_ONE_FOR_ALL); + vlan_features = netdev_increment_features(vlan_features, + slave->dev->vlan_features, + NETIF_F_ONE_FOR_ALL); + printk("slave %s (f %lx vf %lx) new f %lx vf %lx\n", + slave->dev->name, slave->dev->features, + slave->dev->vlan_features, features, vlan_features); if (slave->dev->hard_header_len > max_hard_header_len) max_hard_header_len = slave->dev->hard_header_len; } @@ -1364,6 +1372,8 @@ static int bond_compute_features(struct bonding *bond) done: features |= (bond_dev->features & BOND_VLAN_FEATURES); bond_dev->features = netdev_fix_features(features, NULL); + bond_dev->vlan_features = netdev_fix_features(vlan_features, NULL); + printk("bd->vf %lx\n", bond_dev->vlan_features); bond_dev->hard_header_len = max_hard_header_len; return 0;