From: Eric Dumazet <eric.dumazet@gmail.com>
To: Or Gerlitz <ogerlitz@voltaire.com>
Cc: Patrick McHardy <kaber@trash.net>,
Jay Vosburgh <fubar@us.ibm.com>,
David Miller <davem@davemloft.net>,
netdev@vger.kernel.org, Eilon Greenstein <eilong@broadcom.com>,
Michael Chan <mchan@broadcom.com>
Subject: Re: [PATCH net-next-2.6] bnx2: Update vlan_features
Date: Thu, 23 Jul 2009 14:01:38 +0200 [thread overview]
Message-ID: <4A685122.3090300@gmail.com> (raw)
In-Reply-To: <4A681F63.7060001@gmail.com>
Eric Dumazet a écrit :
> Or Gerlitz a écrit :
>> Eric Dumazet wrote:
>>> Jay Vosburgh a écrit :
>>>> Propogate the vlan_features of the slave devices to the bonding
>>>> master device, using the same logic as for regular features.
>>> Seems pretty cool, but I could not test it on my dev machine, since
>>> tg3 and bnx2 drivers dont advertize yet vlan_features
>> The bnx2x maintainer posted yesterday a patch that does so, I assume a
>> similar patch could work for at least one of tg3 or bnx2. I copied both
>> maintainers on this email, in the hope they can come up with a patch.
>>
>
> Here is the bnx2 patch I cooked to test this vlan_features propagation on bonding.
>
> Everything fine so far !
>
> # cat /proc/net/bonding/bond0
> Ethernet Channel Bonding Driver: v3.5.0 (November 4, 2008)
>
> Bonding Mode: fault-tolerance (active-backup)
> Primary Slave: None
> Currently Active Slave: eth1
> MII Status: up
> MII Polling Interval (ms): 100
> Up Delay (ms): 0
> Down Delay (ms): 0
>
> Slave Interface: eth1 (bnx2 driver)
> MII Status: up
> Link Failure Count: 2
> Permanent HW addr: 00:1e:0b:ec:d3:d2
>
> Slave Interface: eth2 (tg3 driver)
> MII Status: up
> Link Failure Count: 0
> Permanent HW addr: 00:1e:0b:92:78:50
>
>
> # ethtool -k bond0
> Offload parameters for bond0:
> Cannot get device rx csum settings: Operation not supported
> rx-checksumming: off
> tx-checksumming: on
> scatter-gather: on
> tcp-segmentation-offload: on
> udp-fragmentation-offload: off
> generic-segmentation-offload: off
> generic-receive-offload: off
> large-receive-offload: off
>
> # ip link add link bond0 vlan.103 type vlan id 103
> # ethtool -k vlan.103
> Offload parameters for vlan.103:
> rx-checksumming: off
> tx-checksumming: on
> scatter-gather: on
> tcp-segmentation-offload: on
> udp-fragmentation-offload: off
> generic-segmentation-offload: on
> generic-receive-offload: off
> large-receive-offload: off
>
>
> Thanks Or & Jay
>
Updated to take into account Patrick feedback : We dont need to
change vlan_features in bnx2_set_tso()
Quoting Patrick from another thread :
"vlan_features doesn't need to be updated, the resulting dev->features
of the VLAN device is computed as the intersection of dev->features
and dev->vlan_features."
[PATCH net-next-2.6] bnx2: Update vlan_features
In order to get full use of some advanced features of BNX2, we now need to
fill dev->vlan_features.
Patch successfully tested with vlan devices built on top of bonding.
(bond0 : one bnx2 slave, one tg3 slave (not yet vlan_features enabled)
Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
---
drivers/net/bnx2.c | 19 +++++++++++++++----
1 files changed, 15 insertions(+), 4 deletions(-)
diff --git a/drivers/net/bnx2.c b/drivers/net/bnx2.c
index b70cc99..cec1b17 100644
--- a/drivers/net/bnx2.c
+++ b/drivers/net/bnx2.c
@@ -8023,6 +8023,13 @@ static const struct net_device_ops bnx2_netdev_ops = {
#endif
};
+static void inline vlan_features_add(struct net_device *dev, unsigned long flags)
+{
+#ifdef BCM_VLAN
+ dev->vlan_features |= flags;
+#endif
+}
+
static int __devinit
bnx2_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
{
@@ -8064,16 +8071,20 @@ bnx2_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
memcpy(dev->perm_addr, bp->mac_addr, 6);
dev->features |= NETIF_F_IP_CSUM | NETIF_F_SG;
- if (CHIP_NUM(bp) == CHIP_NUM_5709)
+ vlan_features_add(dev, NETIF_F_IP_CSUM | NETIF_F_SG);
+ if (CHIP_NUM(bp) == CHIP_NUM_5709) {
dev->features |= NETIF_F_IPV6_CSUM;
-
+ vlan_features_add(dev, NETIF_F_IPV6_CSUM);
+ }
#ifdef BCM_VLAN
dev->features |= NETIF_F_HW_VLAN_TX | NETIF_F_HW_VLAN_RX;
#endif
dev->features |= NETIF_F_TSO | NETIF_F_TSO_ECN;
- if (CHIP_NUM(bp) == CHIP_NUM_5709)
+ vlan_features_add(dev, NETIF_F_TSO | NETIF_F_TSO_ECN);
+ if (CHIP_NUM(bp) == CHIP_NUM_5709) {
dev->features |= NETIF_F_TSO6;
-
+ vlan_features_add(dev, NETIF_F_TSO6);
+ }
if ((rc = register_netdev(dev))) {
dev_err(&pdev->dev, "Cannot register net device\n");
goto error;
next prev parent reply other threads:[~2009-07-23 12:01 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-04-06 13:00 zero features for a vlan over bond Or Gerlitz
2009-04-07 14:16 ` Jay Vosburgh
2009-04-07 22:16 ` Or Gerlitz
2009-04-16 14:11 ` zero features for a vlan over bond / vlan features Or Gerlitz
2009-04-23 23:47 ` Jay Vosburgh
2009-06-08 9:34 ` Or Gerlitz
2009-07-20 8:08 ` Or Gerlitz
2009-07-22 21:34 ` [PATCH net-next-2.6] bonding: propogate vlan_features to bonding master Jay Vosburgh
2009-07-23 6:03 ` Eric Dumazet
2009-07-23 7:24 ` Or Gerlitz
2009-07-23 8:29 ` [PATCH net-next-2.6] bnx2: Update vlan_features Eric Dumazet
2009-07-23 12:01 ` Eric Dumazet [this message]
2009-07-23 17:59 ` David Miller
2009-07-24 0:12 ` Michael Chan
2009-07-24 7:21 ` [PATCH net-next-2.6] bnx2x: Dont update vlan_features in bnx2x_set_tso() Eric Dumazet
2009-07-26 10:53 ` Eilon Greenstein
2009-07-27 2:49 ` David Miller
2009-07-27 2:50 ` [PATCH net-next-2.6] bnx2: Update vlan_features David Miller
2009-07-23 11:03 ` [PATCH net-next-2.6] bonding: propogate vlan_features to bonding master Patrick McHardy
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=4A685122.3090300@gmail.com \
--to=eric.dumazet@gmail.com \
--cc=davem@davemloft.net \
--cc=eilong@broadcom.com \
--cc=fubar@us.ibm.com \
--cc=kaber@trash.net \
--cc=mchan@broadcom.com \
--cc=netdev@vger.kernel.org \
--cc=ogerlitz@voltaire.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;
as well as URLs for NNTP newsgroup(s).