e1000e: cleanup several stats issues
Subsystems (2)
PATCH 1/5 e1000e: cleanup several stats issues
From: Bruce Allan <[email protected]>
Several stats registers are completely unused and we just waste pci bus time reading them. We also omit using the high 32 bits of the GORC/ GOTC counters. We can just read clear them and only read the low registers.
Mii-tool can also break es2lan if it executes a MII PHY register ioctl while the device is in autonegotiation. Unfortunately it seems that several applications and installations still perform this ioctl call periodically and especially in this crucial startup time. We can fool the ioctl by providing fail safe information that mimics the "down" link state and only perform the dangerous PHY reads once after link comes up to fill in the real values. As long as link stays up the information will not change.
---
drivers/net/e1000e/82571.c | 6 -- drivers/net/e1000e/defines.h | 2 + drivers/net/e1000e/e1000.h | 25 +++++-- drivers/net/e1000e/es2lan.c | 2 - drivers/net/e1000e/ethtool.c | 6 +- drivers/net/e1000e/hw.h | 12 +-- drivers/net/e1000e/netdev.c | 155 +++++++++++++++++++++++++----------------- 7 files changed, 122 insertions(+), 86 deletions(-)
drivers/net/e1000e/82571.c +0 -6
@@ -1326,12 +1326,10 @@ struct e1000_info e1000_82571_info = { .mac = e1000_82571, .flags =FLAG_HAS_HW_VLAN_FILTER |FLAG_HAS_JUMBO_FRAMES - |FLAG_HAS_STATS_PTC_PRC |FLAG_HAS_WOL |FLAG_APME_IN_CTRL3 |FLAG_RX_CSUM_ENABLED |FLAG_HAS_CTRLEXT_ON_LOAD - |FLAG_HAS_STATS_ICR_ICT |FLAG_HAS_SMART_POWER_DOWN |FLAG_RESET_OVERWRITES_LAA /* errata */ |FLAG_TARC_SPEED_MODE_BIT /* errata */
@@ -1347,12 +1345,10 @@ struct e1000_info e1000_82572_info = { .mac = e1000_82572, .flags =FLAG_HAS_HW_VLAN_FILTER |FLAG_HAS_JUMBO_FRAMES - |FLAG_HAS_STATS_PTC_PRC |FLAG_HAS_WOL |FLAG_APME_IN_CTRL3 |FLAG_RX_CSUM_ENABLED |FLAG_HAS_CTRLEXT_ON_LOAD - |FLAG_HAS_STATS_ICR_ICT | FLAG_TARC_SPEED_MODE_BIT, /* errata */ .pba = 38, .get_variants = e1000_get_variants_82571,
@@ -1365,11 +1361,9 @@ struct e1000_info e1000_82573_info = { .mac = e1000_82573, .flags =FLAG_HAS_HW_VLAN_FILTER |FLAG_HAS_JUMBO_FRAMES - |FLAG_HAS_STATS_PTC_PRC |FLAG_HAS_WOL |FLAG_APME_IN_CTRL3 |FLAG_RX_CSUM_ENABLED - |FLAG_HAS_STATS_ICR_ICT |FLAG_HAS_SMART_POWER_DOWN |FLAG_HAS_AMT |FLAG_HAS_ERT
drivers/net/e1000e/defines.h +2 -0
@@ -527,8 +527,10 @@#define PHY_ID2 0x03/* Phy Id Reg (word 2) */ #define PHY_AUTONEG_ADV 0x04/* Autoneg Advertisement */ #define PHY_LP_ABILITY 0x05/* Link Partner Ability (Base Page) */ +#define PHY_AUTONEG_EXP 0x06/* Autoneg Expansion Reg */ #define PHY_1000T_CTRL 0x09/* 1000Base-T Control Reg */ #define PHY_1000T_STATUS 0x0A/* 1000Base-T Status Reg */ +#define PHY_EXT_STATUS 0x0F/* Extended Status Reg */ /* NVM Control */ #define E1000_EECD_SK 0x00000001/* NVM Clock */
drivers/net/e1000e/e1000.h +19 -6
@@ -147,6 +147,18 @@ struct e1000_ring {struct e1000_queue_stats stats; }; +/* PHY register snapshot values */ +struct e1000_phy_regs { +u16 bmcr;/* basic mode control register */ +u16 bmsr;/* basic mode status register */ +u16 advertise;/* auto-negotiation advertisement */ +u16 lpa;/* link partner ability register */ +u16 expansion;/* auto-negotiation expansion reg */ +u16 ctrl1000;/* 1000BASE-T control register */ +u16 stat1000;/* 1000BASE-T status register */ +u16 estatus;/* extended status register */ +}; +/* board specific private data structure */ struct e1000_adapter {struct timer_list watchdog_timer;
@@ -202,8 +214,8 @@ struct e1000_adapter {/* Tx stats */ u64 tpt_old;u64 colc_old; -u64 gotcl_old; -u32 gotcl; +u32 gotc; +u64 gotc_old;u32 tx_timeout_count;u32 tx_fifo_head;u32 tx_head_addr;
@@ -227,8 +239,8 @@ struct e1000_adapter {u64 hw_csum_err;u64 hw_csum_good;u64 rx_hdr_split; -u64 gorcl_old; -u32 gorcl; +u32 gorc; +u64 gorc_old;u32 alloc_rx_buff_failed;u32 rx_dma_failed;
@@ -250,6 +262,9 @@ struct e1000_adapter {struct e1000_phy_info phy_info;struct e1000_phy_stats phy_stats; +/* Snapshot of PHY registers */ +struct e1000_phy_regs phy_regs; +struct e1000_ring test_tx_ring;struct e1000_ring test_rx_ring;u32 test_icr;
@@ -286,8 +301,6 @@ struct e1000_info {#define FLAG_HAS_CTRLEXT_ON_LOAD (1 << 5)#define FLAG_HAS_SWSM_ON_LOAD (1 << 6)#define FLAG_HAS_JUMBO_FRAMES (1 << 7) -#define FLAG_HAS_STATS_ICR_ICT (1 << 9) -#define FLAG_HAS_STATS_PTC_PRC (1 << 10)#define FLAG_HAS_SMART_POWER_DOWN (1 << 11)#define FLAG_IS_QUAD_PORT_A (1 << 12)#define FLAG_IS_QUAD_PORT (1 << 13)
drivers/net/e1000e/es2lan.c +0 -2
@@ -1231,12 +1231,10 @@ struct e1000_info e1000_es2_info = { .mac = e1000_80003es2lan, .flags =FLAG_HAS_HW_VLAN_FILTER |FLAG_HAS_JUMBO_FRAMES - |FLAG_HAS_STATS_PTC_PRC |FLAG_HAS_WOL |FLAG_APME_IN_CTRL3 |FLAG_RX_CSUM_ENABLED |FLAG_HAS_CTRLEXT_ON_LOAD - |FLAG_HAS_STATS_ICR_ICT |FLAG_RX_NEEDS_RESTART /* errata */ |FLAG_TARC_SET_BIT_ZERO /* errata */ |FLAG_APME_CHECK_PORT_B
drivers/net/e1000e/ethtool.c +3 -3
@@ -46,8 +46,8 @@ struct e1000_stats {static const struct e1000_stats e1000_gstrings_stats[] = { {"rx_packets" ,E1000_STAT (stats.gprc) }, {"tx_packets" ,E1000_STAT (stats.gptc) }, - {"rx_bytes" ,E1000_STAT (stats.gorcl) }, - {"tx_bytes" ,E1000_STAT (stats.gotcl) }, + {"rx_bytes" ,E1000_STAT (stats.gorc) }, + {"tx_bytes" ,E1000_STAT (stats.gotc) }, {"rx_broadcast" ,E1000_STAT (stats.bprc) }, {"tx_broadcast" ,E1000_STAT (stats.bptc) }, {"rx_multicast" ,E1000_STAT (stats.mprc) },
@@ -83,7 +83,7 @@ static const struct e1000_stats e1000_gstrings_stats[] = { { "rx_flow_control_xoff", E1000_STAT(stats.xoffrxc) }, { "tx_flow_control_xon", E1000_STAT(stats.xontxc) }, { "tx_flow_control_xoff", E1000_STAT(stats.xofftxc) }, - { "rx_long_byte_count", E1000_STAT(stats.gorcl) }, + { "rx_long_byte_count", E1000_STAT(stats.gorc) }, { "rx_csum_offload_good", E1000_STAT(hw_csum_good) }, { "rx_csum_offload_errors", E1000_STAT(hw_csum_err) }, { "rx_header_split", E1000_STAT(rx_hdr_split) },
drivers/net/e1000e/hw.h +4 -8
@@ -592,10 +592,8 @@ struct e1000_hw_stats {u64 bprc;u64 mprc;u64 gptc; -u64 gorcl; -u64 gorch; -u64 gotcl; -u64 gotch; +u64 gorc; +u64 gotc;u64 rnbc;u64 ruc;u64 rfc;
@@ -604,10 +602,8 @@ struct e1000_hw_stats {u64 mgprc;u64 mgpdc;u64 mgptc; -u64 torl; -u64 torh; -u64 totl; -u64 toth; +u64 tor; +u64 tot;u64 tpr;u64 tpt;u64 ptc64;
drivers/net/e1000e/netdev.c +94 -61
239 lines not on this page · raw message
PATCH 2/5 e1000e: Add interrupt moderation run-time ethtool interface
The ethtool -c / -C interface can now be used to modify the irq moderation algorithm. This change does not require an adapter reset and can thus be used at all times. The adapter only supports changing/reading rx-usecs which has special values for 0, 1 and 3:
0 - no irq moderation whatsoever
1 - normal moderation favoring regular mixed traffic (default) 3 - best attempt at low latency possible at cost of CPU
For values between 10 and 10000 the rx-usecs defines "the minimum time between successive irqs" in usec, unlike the module parameter.
---
drivers/net/e1000e/e1000.h | 3 +++ drivers/net/e1000e/ethtool.c | 43 ++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 46 insertions(+), 0 deletions(-)
drivers/net/e1000e/e1000.h +3 -0
@@ -70,6 +70,9 @@ struct e1000_info;#define E1000_MAX_RXD 4096#define E1000_MIN_RXD 80 +#define E1000_MIN_ITR_USECS 10/* 100000 irq/sec */ +#define E1000_MAX_ITR_USECS 10000/* 100 irq/sec */ +/* Early Receive defines */ #define E1000_ERT_2048 0x100
drivers/net/e1000e/ethtool.c +43 -0
55 lines not on this page · raw message
PATCH 4/5 e1000e: Fix HW Error on es2lan, ARP capture issue by BMC
In reply to Auke KokFrom: David Graham <[email protected]>
Several components to this complex fix. The es2lan cards occasionally gave a "HW Error" especially when forcing speed. Some users also reported that the BMC stole ARP packets.
The fixes include setting the proper SW_FW bits to tell the BMC that we're active and not do any un-initialization at all, so the setup routine is largely changed.
---
drivers/net/e1000e/defines.h | 1 drivers/net/e1000e/e1000.h | 2 + drivers/net/e1000e/es2lan.c | 127 +++++++++++++++++++++++++++++++----------- drivers/net/e1000e/phy.c | 73 +++++++++++++----------- 4 files changed, 137 insertions(+), 66 deletions(-)
drivers/net/e1000e/defines.h +1 -0
@@ -184,6 +184,7 @@#define E1000_SWFW_EEP_SM 0x1#define E1000_SWFW_PHY0_SM 0x2#define E1000_SWFW_PHY1_SM 0x4 +#define E1000_SWFW_CSR_SM 0x8/* Device Control */ #define E1000_CTRL_FD 0x00000001/* Full duplex.0=half; 1=full */
drivers/net/e1000e/e1000.h +2 -0
@@ -449,6 +449,8 @@ extern s32 e1000e_read_kmrn_reg(struct e1000_hw *hw, u32 offset, u16 *data);extern s32 e1000e_phy_has_link_generic (struct e1000_hw *hw,u32 iterations,u32 usec_interval,bool *success);extern s32 e1000e_phy_reset_dsp (struct e1000_hw *hw); +extern s32 e1000e_read_phy_reg_mdic (struct e1000_hw *hw,u32 offset,u16 *data); +extern s32 e1000e_write_phy_reg_mdic (struct e1000_hw *hw,u32 offset,u16 data);extern s32 e1000e_check_downshift (struct e1000_hw *hw);static inline s32 e1000_phy_hw_reset (struct e1000_hw *hw)
drivers/net/e1000e/es2lan.c +94 -33
268 lines not on this page · raw message
drivers/net/e1000e/phy.c +40 -33
175 lines not on this page · raw message
PATCH 3/5 e1000e: Allow TSO to trickle down to VLAN device
In reply to Auke KokFix TSO over VLAN's by propagating settings to our VLAN devices.
---
drivers/net/e1000e/ethtool.c | 16 ++++++++++++++++ drivers/net/e1000e/netdev.c | 8 ++++++++ 2 files changed, 24 insertions(+), 0 deletions(-)
drivers/net/e1000e/ethtool.c +16 -0
@@ -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 ;
drivers/net/e1000e/netdev.c +8 -0
@@ -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)
PATCH 5/5 e1000e: lower ring minimum size to 64
In reply to Auke KokThe lower limit of 80 descriptors in the ring is only valid for one older 8254x chipset. All e1000e devices can use as low as 64 descriptors.
---
drivers/net/e1000e/e1000.h | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-)
drivers/net/e1000e/e1000.h +2 -2
@@ -64,11 +64,11 @@ struct e1000_info;/* Tx/Rx descriptor defines */ #define E1000_DEFAULT_TXD 256#define E1000_MAX_TXD 4096 -#define E1000_MIN_TXD 80 +#define E1000_MIN_TXD 64#define E1000_DEFAULT_RXD 256#define E1000_MAX_RXD 4096 -#define E1000_MIN_RXD 80 +#define E1000_MIN_RXD 64#define E1000_MIN_ITR_USECS 10/* 100000 irq/sec */ #define E1000_MAX_ITR_USECS 10000/* 100 irq/sec */
Re: [PATCH 3/5] e1000e: Allow TSO to trickle down to VLAN device
In reply to Auke KokQuoted 9 lines · Auke Kok
Fix TSO over VLAN's by propagating settings to our VLAN devices.
drivers/net/e1000e/ethtool.c +2
-0@@ -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)
drivers/net/e1000e/ethtool.c static int e1000_set_tso(struct net_device *netdev, u32 data) · line 395
Quoted 10 lines
drivers/net/e1000e/ethtool.c +9
-0+ 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);
What exactly is this supposed to fix? If this simply wants to propagate feature changes, I think it should use netdev_feat_change and handle that within the VLAN code.
Re: [PATCH 2/5] e1000e: Add interrupt moderation run-time ethtool interface
In reply to Auke KokQuoted 9 lines · Auke Kok
The ethtool -c / -C interface can now be used to modify the irq moderation algorithm. This change does not require an adapter reset and can thus be used at all times. The adapter only supports changing/reading rx-usecs which has special values for 0, 1 and 3:
0 - no irq moderation whatsoever
1 - normal moderation favoring regular mixed traffic (default) 3 - best attempt at low latency possible at cost of CPU
It would be nice if ethtool instead of having this as a obscure magic number had a higher level "--low-latency" or similar parameter (that could also potentially set similar settings on other NICs)
You think there would be a clean way to implement this?
-Andi
Re: [PATCH 2/5] e1000e: Add interrupt moderation run-time ethtool interface
Quoted 14 lines · Andi Kleen
Quoted 9 lines · Auke Kok
The ethtool -c / -C interface can now be used to modify the irq moderation algorithm. This change does not require an adapter reset and can thus be used at all times. The adapter only supports changing/reading rx-usecs which has special values for 0, 1 and 3:
0 - no irq moderation whatsoever
1 - normal moderation favoring regular mixed traffic (default) 3 - best attempt at low latency possible at cost of CPU
Quoted 5 lines
It would be nice if ethtool instead of having this as a obscure magic number had a higher level "--low-latency" or similar parameter (that could also potentially set similar settings on other NICs)
You think there would be a clean way to implement this?
The biggest problems might be ones of interpretation as to whether a given setting was indeed:
--favor-latency
--favor-throutput
--favor-mixed
But it would indeed at one level be more "clear" to a random admin (IMO).
I use "--favor-mumble" above since what might be the --low-latency through one NIC might not be as low as the "--low-latency" though another NIC, and it also sort of implicitly suggests a trade-off is being made.
rick jones
-------------------------------------------------------------------------
This SF.net email is sponsored by the 2008 JavaOne(SM) Conference Don't miss this year's exciting event. There's still time to save $100. Use priority code J8TL2D2.
http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone
Re: [PATCH 2/5] e1000e: Add interrupt moderation run-time ethtool interface
In reply to Andi KleenQuoted 8 lines · Andi Kleen
Quoted 6 lines · Auke Kok
The ethtool -c / -C interface can now be used to modify the irq moderation algorithm. This change does not require an adapter reset and can thus be used at all times. The adapter only supports changing/reading rx-usecs which has special values for 0, 1 and 3:
Quoted 7 lines
Quoted 3 lines
0 - no irq moderation whatsoever
1 - normal moderation favoring regular mixed traffic (default) 3 - best attempt at low latency possible at cost of CPUIt would be nice if ethtool instead of having this as a obscure magic number had a higher level "--low-latency" or similar parameter (that could also potentially set similar settings on other NICs)
That would be fine with me -- that's one of the goals of ethtool: make the setting of hardware-specific settings as generic and easy as possible.
Jeff
-------------------------------------------------------------------------
This SF.net email is sponsored by the 2008 JavaOne(SM) Conference Don't miss this year's exciting event. There's still time to save $100. Use priority code J8TL2D2.
http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone
Re: [PATCH 2/5] e1000e: Add interrupt moderation run-time ethtool interface
Quoted 13 lines · Jeff Garzik
Quoted 12 lines · Andi Kleen
Quoted 9 lines · Auke Kok
The ethtool -c / -C interface can now be used to modify the irq moderation algorithm. This change does not require an adapter reset and can thus be used at all times. The adapter only supports changing/reading rx-usecs which has special values for 0, 1 and 3:
0 - no irq moderation whatsoever
1 - normal moderation favoring regular mixed traffic (default) 3 - best attempt at low latency possible at cost of CPU
Quoted 6 lines
Quoted 3 lines
It would be nice if ethtool instead of having this as a obscure magic number had a higher level "--low-latency" or similar parameter (that could also potentially set similar settings on other NICs)
That would be fine with me -- that's one of the goals of ethtool: make the setting of hardware-specific settings as generic and easy as possible.
I think this would require new ethtool interfaces (NIC_POLICY ?) so that the driver can decide what the right settings are.
Otherwise you would need to hard code a conversion table into the user program, which is probably a bad idea.
-Andi
Re: [PATCH 2/5] e1000e: Add interrupt moderation run-time ethtool interface
In reply to Jeff GarzikQuoted 13 lines · Jeff Garzik
Quoted 12 lines · Andi Kleen
Quoted 9 lines · Auke Kok
The ethtool -c / -C interface can now be used to modify the irq moderation algorithm. This change does not require an adapter reset and can thus be used at all times. The adapter only supports changing/reading rx-usecs which has special values for 0, 1 and 3:
0 - no irq moderation whatsoever
1 - normal moderation favoring regular mixed traffic (default) 3 - best attempt at low latency possible at cost of CPU
Quoted 6 lines
Quoted 3 lines
It would be nice if ethtool instead of having this as a obscure magic number had a higher level "--low-latency" or similar parameter (that could also potentially set similar settings on other NICs)
That would be fine with me -- that's one of the goals of ethtool: make the setting of hardware-specific settings as generic and easy as possible.
yes I think that's a good addition, and might hook better into power management and other high-level configuration tools.
I'm all for that :)
Auke
Re: [PATCH 3/5] e1000e: Allow TSO to trickle down to VLAN device
In reply to Patrick McHardyQuoted 17 lines · Patrick McHardy
Quoted 16 lines · Auke Kok
Fix TSO over VLAN's by propagating settings to our VLAN devices.
drivers/net/e1000e/ethtool.c +8
-0@@ -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 ; +
Quoted 8 lines
drivers/net/e1000e/ethtool.c static int e1000_set_tso(struct net_device *netdev, u32 data) · line 397
Quoted 4 lines
drivers/net/e1000e/ethtool.c +3
-0+ v_netdev->features &= ~NETIF_F_TSO ; + v_netdev->features &= ~NETIF_F_TSO6 ; +vlan_group_set_device (adapter->vlgrp, i, v_netdev);What exactly is this supposed to fix? If this simply wants to propagate feature changes, I think it should use
netdev_feat_changeand handle that within the VLAN code.
I asked PJ and got this reply:
//
VLAN devices didn't get the parent's feature flags on creation. I went to fix this in the kernel, people pushed back that some devices couldn't support both VLAN tag insertion offload and TSO, so I didn't push the issue. I worked around the issue by copying the flags in the driver. The downside is when we turn off TSO using ethtool, we need to remove TSO from all VLAN devices, since the hardware segmenter is no longer available if the parent device doesn't have it enabled as a feature. We were seeing stack-based panics with gso_segment(), which was corrected by removing the TSO flag from all VLAN devices.
I can't seem to find netdev_feat_change anywhere in the kernel, or variants of that name, so I'm not sure what Patrick is pointing us at.
-PJ
//
Re: [PATCH 3/5] e1000e: Allow TSO to trickle down to VLAN device
Quoted 21 lines · Auke
Quoted 6 lines · Patrick McHardy
Quoted 2 lines · Auke Kok
Fix TSO over VLAN's by propagating settings to our VLAN devices.
What exactly is this supposed to fix? If this simply wants to propagate feature changes, I think it should use
netdev_feat_changeand handle that within the VLAN code.I asked PJ and got this reply:
//
VLAN devices didn't get the parent's feature flags on creation. I went to fix this in the kernel, people pushed back that some devices couldn't support both VLAN tag insertion offload and TSO, so I didn't push the issue. I worked around the issue by copying the flags in the driver. The downside is when we turn off TSO using ethtool, we need to remove TSO from all VLAN devices, since the hardware segmenter is no longer available if the parent device doesn't have it enabled as a feature. We were seeing stack-based panics withgso_segment(), which was corrected by removing the TSO flag from all VLAN devices.
Quoted 5 lines
I can't seem to find
netdev_feat_changeanywhere in the kernel, or variants of that name, so I'm not sure what Patrick is pointing us at.-PJ
//
That was a typo, I meant netdev_features_change(), which is invoked by dev_ethtool() and calls the netdev notifier with NETDEV_FEAT_CHANGE, on which the VLAN code could react. I wasn't aware of the TSO + VLAN acceleration problems you've mentioned, do you have a pointer to more information about this?
In any case I would prefer to avoid having drivers mess with VLAN device flags. How about adding a device flag indicating that the driver supports TSO + VLAN acceleration and using the NETDEV_FEAT_CHANGE notification inside the VLAN code do adjust the device's flags properly?
RE: [PATCH 3/5] e1000e: Allow TSO to trickle down to VLAN device
Quoted 2 lines
That was a typo, I meant
netdev_features_change(), which is invoked bydev_ethtool()and calls the netdev notifier with
NETDEV_FEAT_CHANGE,
Quoted 3 lines
on which the VLAN code could react. I wasn't aware of the TSO + VLAN acceleration problems you've mentioned, do you have a pointer to more information about this?
This was a conversation I had late last year on the list regarding TSO and Tx checksum offload not getting turned on for VLAN devices, since the VLAN device creation code doesn't copy those device feature flags. I had proposed sending a patch, and the statement was made that some devices might not support both of those hardware features at the same time. I'll try to dig up those mails.
Quoted 5 lines
In any case I would prefer to avoid having drivers mess with VLAN device flags. How about adding a device flag indicating that the driver supports TSO + VLAN acceleration and using the
NETDEV_FEAT_CHANGEnotification inside the VLAN code do adjust the device's flags properly?
I hear you loud and clear. I wanted to do this the "right" way in the drivers if I couldn't do it in the kernel, and your suggestions sound like the right way. Let me take the suggestions here and respin this part of the code, since I have this change in e1000, e1000e, igb, and ixgbe, and want it to be correct.
Thanks Patrick for the feedback here. Hopefully I'll soon have something for Auke to resend.
Cheers,
-PJ Waskiewicz
RE: [PATCH 3/5] e1000e: Allow TSO to trickle down to VLAN device
In reply to Patrick McHardyQuoted 7 lines
That was a typo, I meant
netdev_features_change(), which is invoked bydev_ethtool()and calls the netdev notifier withNETDEV_FEAT_CHANGE,
on which the VLAN code could react. I wasn't aware of the TSO + VLAN acceleration problems you've mentioned, do you have a pointer to more information about this?
Quoted 5 lines
In any case I would prefer to avoid having drivers mess with VLAN device flags. How about adding a device flag indicating that the driver supports TSO + VLAN acceleration and using the
NETDEV_FEAT_CHANGEnotification inside the VLAN code do adjust the device's flags properly?
I've been looking into this, and I agree this makes sense when creating a new VLAN to get the device flags to the VLAN device. However, we need to get the TSO and/or Tx checksum offload feature flags off all VLAN devices when the parent device has it turned off. I don't see any clean way of doing this with netdev_features_change(). I'd really love to implement this correctly, so if you have any ideas on how to handle this latter case, I'm all ears. :-)
Thanks Patrick,
-PJ Waskiewicz
Re: [PATCH 3/5] e1000e: Allow TSO to trickle down to VLAN device
Quoted 6 lines · Peter P
Quoted 5 lines
In any case I would prefer to avoid having drivers mess with VLAN device flags. How about adding a device flag indicating that the driver supports TSO + VLAN acceleration and using the
NETDEV_FEAT_CHANGEnotification inside the VLAN code do adjust the device's flags properly?
Quoted 7 lines
I've been looking into this, and I agree this makes sense when creating a new VLAN to get the device flags to the VLAN device. However, we need to get the TSO and/or Tx checksum offload feature flags off all VLAN devices when the parent device has it turned off. I don't see any clean way of doing this with
netdev_features_change(). I'd really love to implement this correctly, so if you have any ideas on how to handle this latter case, I'm all ears. :-)
Whats the problem with doing:
- on VLAN creation: copy VLAN flag from lower device if lowerdev has NETIF_F_<flag indicating non-broken TSO+VLAN accel>
- on change of TSO/checksumming flags of lower device:
use netdevice notifier to adjust the settings for all VLANs on that device
-------------------------------------------------------------------------
This SF.net email is sponsored by the 2008 JavaOne(SM) Conference Don't miss this year's exciting event. There's still time to save $100. Use priority code J8TL2D2.
http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone
Re: [PATCH 3/5] e1000e: Allow TSO to trickle down to VLAN device
Quoted 16 lines · Patrick McHardy
Quoted 6 lines · Peter P
Quoted 5 lines
In any case I would prefer to avoid having drivers mess with VLAN device flags. How about adding a device flag indicating that the driver supports TSO + VLAN acceleration and using the
NETDEV_FEAT_CHANGEnotification inside the VLAN code do adjust the device's flags properly?Quoted 7 lines
I've been looking into this, and I agree this makes sense when creating a new VLAN to get the device flags to the VLAN device. However, we need to get the TSO and/or Tx checksum offload feature flags off all VLAN devices when the parent device has it turned off. I don't see any clean way of doing this with
netdev_features_change(). I'd really love to implement this correctly, so if you have any ideas on how to handle this latter case, I'm all ears. :-)
Quoted 3 lines
Whats the problem with doing:
- on VLAN creation: copy VLAN flag from lower device if lowerdev
^^^^ TSO/checksumming flags
Quoted 5 lines
has NETIF_F_<flag indicating non-broken TSO+VLAN accel>
- on change of TSO/checksumming flags of lower device:
use netdevice notifier to adjust the settings for all VLANs on that device
-------------------------------------------------------------------------
This SF.net email is sponsored by the 2008 JavaOne(SM) Conference Don't miss this year's exciting event. There's still time to save $100. Use priority code J8TL2D2.
http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone