From: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
To: jeff@garzik.org
Cc: e1000-devel@lists.sourceforge.net, netdev@vger.kernel.org
Subject: [PATCH 4/4] e1000e: Allow TSO to trickle down to VLAN device
Date: Mon, 19 May 2008 15:47:29 -0700 [thread overview]
Message-ID: <20080519224652.7175.74105.stgit@localhost.localdomain> (raw)
In-Reply-To: <20080519224303.7175.71980.stgit@localhost.localdomain>
Fix TSO over VLAN's by propagating settings to our VLAN devices.
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Signed-off-by: Auke Kok <auke-jan.h.kok@intel.com>
---
drivers/net/e1000e/ethtool.c | 16 ++++++++++++++++
drivers/net/e1000e/netdev.c | 8 ++++++++
2 files changed, 24 insertions(+), 0 deletions(-)
diff --git a/drivers/net/e1000e/ethtool.c b/drivers/net/e1000e/ethtool.c
index ce045ac..23e9703 100644
--- a/drivers/net/e1000e/ethtool.c
+++ b/drivers/net/e1000e/ethtool.c
@@ -32,6 +32,7 @@
#include <linux/ethtool.h>
#include <linux/pci.h>
#include <linux/delay.h>
+#include <linux/if_vlan.h>
#include "e1000.h"
@@ -371,6 +372,8 @@ static int e1000_set_tx_csum(struct net_device *netdev, u32 data)
static int e1000_set_tso(struct net_device *netdev, u32 data)
{
struct e1000_adapter *adapter = netdev_priv(netdev);
+ int i;
+ struct net_device *v_netdev;
if (data) {
netdev->features |= NETIF_F_TSO;
@@ -378,8 +381,21 @@ static int e1000_set_tso(struct net_device *netdev, u32 data)
} else {
netdev->features &= ~NETIF_F_TSO;
netdev->features &= ~NETIF_F_TSO6;
+ /* disable TSO on all VLANs if they're present */
+ if (!adapter->vlgrp)
+ goto tso_out;
+ for (i = 0; i < VLAN_GROUP_ARRAY_LEN; i++) {
+ v_netdev = vlan_group_get_device(adapter->vlgrp, i);
+ if (!v_netdev)
+ continue;
+
+ v_netdev->features &= ~NETIF_F_TSO;
+ v_netdev->features &= ~NETIF_F_TSO6;
+ vlan_group_set_device(adapter->vlgrp, i, v_netdev);
+ }
}
+tso_out:
ndev_info(netdev, "TSO is %s\n",
data ? "Enabled" : "Disabled");
adapter->flags |= FLAG_TSO_FORCE;
diff --git a/drivers/net/e1000e/netdev.c b/drivers/net/e1000e/netdev.c
index 8991ab8..5110382 100644
--- a/drivers/net/e1000e/netdev.c
+++ b/drivers/net/e1000e/netdev.c
@@ -1432,6 +1432,7 @@ static void e1000_vlan_rx_add_vid(struct net_device *netdev, u16 vid)
struct e1000_adapter *adapter = netdev_priv(netdev);
struct e1000_hw *hw = &adapter->hw;
u32 vfta, index;
+ struct net_device *v_netdev;
/* don't update vlan cookie if already programmed */
if ((adapter->hw.mng_cookie.status &
@@ -1443,6 +1444,13 @@ static void e1000_vlan_rx_add_vid(struct net_device *netdev, u16 vid)
vfta = E1000_READ_REG_ARRAY(hw, E1000_VFTA, index);
vfta |= (1 << (vid & 0x1F));
e1000e_write_vfta(hw, index, vfta);
+ /*
+ * Copy feature flags from netdev to the vlan netdev for this vid.
+ * This allows things like TSO to bubble down to our vlan device.
+ */
+ v_netdev = vlan_group_get_device(adapter->vlgrp, vid);
+ v_netdev->features |= adapter->netdev->features;
+ vlan_group_set_device(adapter->vlgrp, vid, v_netdev);
}
static void e1000_vlan_rx_kill_vid(struct net_device *netdev, u16 vid)
next prev parent reply other threads:[~2008-05-19 22:47 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-05-19 22:44 [PATCH 1/4] e1000e: set CONFIG_E1000E=y in x86 defconfigs Jeff Kirsher
2008-05-19 22:45 ` [PATCH 2/4] e1000: enable NAPI by default in defconfig Jeff Kirsher
2008-05-19 22:46 ` [PATCH 3/4] e1000: remove PCI Express device IDs Jeff Kirsher
2008-05-19 22:47 ` Jeff Kirsher [this message]
2008-05-19 23:03 ` [PATCH 4/4] e1000e: Allow TSO to trickle down to VLAN device Waskiewicz Jr, Peter P
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=20080519224652.7175.74105.stgit@localhost.localdomain \
--to=jeffrey.t.kirsher@intel.com \
--cc=e1000-devel@lists.sourceforge.net \
--cc=jeff@garzik.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 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).