diff options
author | Roland Dreier <rolandd@cisco.com> | 2009-01-11 03:19:36 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2009-01-11 03:19:36 -0500 |
commit | 47fd23fe8efeea3af4593a8424419df48724eb25 (patch) | |
tree | 110a3c9d39322c356d43090b1431d66711ec47dd /drivers/net/cxgb3/adapter.h | |
parent | 2a7e637de51ded7b0b56b927f45915eadb6734bb (diff) |
cxgb3: Keep LRO off if disabled when interface is down
I have a system with a Chelsio adapter (driven by cxgb3) whose ports are
part of a Linux bridge. Recently I updated the kernel and discovered
that things stopped working because cxgb3 was doing LRO on packets that
were passed into the bridge code for forwarding. (Incidentally, this
problem manifested itself in a strange way that made debugging a bit
interesting -- for some reason, the skb_warn_if_lro() check in bridge
didn't trigger and these LROed packets were forwarded out a forcedeth
interface, and caused the forcedeth transmit path to get stuck)
This is because cxgb3 has no way of keeping state for the LRO flag until
the interface is brought up, so if the bridging code disables LRO while
the interface is down, then cxgb3_up() will just reenable LRO, and on my
Debian system at least, the init scripts add interfaces to a bridge
before bringing the interfaces up.
Fix this by keeping track of each interface's LRO state in cxgb3 so that
when bridge disables LRO, it stays disabled in cxgb3_up() when the
interface is brought up. I did this by changing the rx_csum_offload
flag into a pair of bit flags; the effect of this on the rx_eth() fast
path is miniscule enough that it should be fine (eg on x86, a cmpb
instruction becomes a testb instruction).
Signed-off-by: Roland Dreier <rolandd@cisco.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/cxgb3/adapter.h')
-rw-r--r-- | drivers/net/cxgb3/adapter.h | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/drivers/net/cxgb3/adapter.h b/drivers/net/cxgb3/adapter.h index 5b346f9eaa8b..a89d8cc51205 100644 --- a/drivers/net/cxgb3/adapter.h +++ b/drivers/net/cxgb3/adapter.h | |||
@@ -50,12 +50,17 @@ struct vlan_group; | |||
50 | struct adapter; | 50 | struct adapter; |
51 | struct sge_qset; | 51 | struct sge_qset; |
52 | 52 | ||
53 | enum { /* rx_offload flags */ | ||
54 | T3_RX_CSUM = 1 << 0, | ||
55 | T3_LRO = 1 << 1, | ||
56 | }; | ||
57 | |||
53 | struct port_info { | 58 | struct port_info { |
54 | struct adapter *adapter; | 59 | struct adapter *adapter; |
55 | struct vlan_group *vlan_grp; | 60 | struct vlan_group *vlan_grp; |
56 | struct sge_qset *qs; | 61 | struct sge_qset *qs; |
57 | u8 port_id; | 62 | u8 port_id; |
58 | u8 rx_csum_offload; | 63 | u8 rx_offload; |
59 | u8 nqsets; | 64 | u8 nqsets; |
60 | u8 first_qset; | 65 | u8 first_qset; |
61 | struct cphy phy; | 66 | struct cphy phy; |