netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Auke Kok <auke-jan.h.kok@intel.com>
To: jeff@garzik.org
Cc: netdev@vger.kernel.org, e1000-devel@lists.sourceforge.net
Subject: [PATCH 3/5] e1000e: Allow TSO to trickle down to VLAN device
Date: Mon, 14 Apr 2008 10:06:09 -0700	[thread overview]
Message-ID: <20080414170609.23286.42880.stgit@localhost.localdomain> (raw)
In-Reply-To: <20080414170557.23286.71580.stgit@localhost.localdomain>

Fix TSO over VLAN's by propagating settings to our VLAN devices.

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 9d1143a..146edf7 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)


  parent reply	other threads:[~2008-04-14 17:06 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-04-14 17:05 [PATCH 1/5] e1000e: cleanup several stats issues Auke Kok
2008-04-14 17:06 ` [PATCH 2/5] e1000e: Add interrupt moderation run-time ethtool interface Auke Kok
2008-04-14 19:24   ` Andi Kleen
2008-04-14 19:31     ` Rick Jones
2008-04-14 19:35     ` Jeff Garzik
2008-04-14 19:53       ` Andi Kleen
2008-04-14 20:09       ` Kok, Auke
2008-04-14 17:06 ` Auke Kok [this message]
2008-04-14 17:11   ` [PATCH 3/5] e1000e: Allow TSO to trickle down to VLAN device Patrick McHardy
2008-04-17 21:45     ` Kok, Auke
2008-04-21 14:24       ` Patrick McHardy
2008-04-22  7:46         ` Waskiewicz Jr, Peter P
2008-04-30  0:42         ` Waskiewicz Jr, Peter P
2008-04-30  6:54           ` Patrick McHardy
2008-04-30  6:56             ` Patrick McHardy
2008-04-14 17:06 ` [PATCH 4/5] e1000e: Fix HW Error on es2lan, ARP capture issue by BMC Auke Kok
2008-04-14 17:06 ` [PATCH 5/5] e1000e: lower ring minimum size to 64 Auke Kok

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=20080414170609.23286.42880.stgit@localhost.localdomain \
    --to=auke-jan.h.kok@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).