diff options
author | Jiri Pirko <jpirko@redhat.com> | 2011-07-20 06:54:15 +0200 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2011-07-21 22:47:54 +0200 |
commit | 133b08513a99d44d9ed916bb83e46343f6ad2855 (patch) | |
tree | 60bc1cfef6756f646c16ee6ecc37799b9937398b /drivers/net/chelsio/sge.c | |
parent | bnad: do vlan cleanup (diff) | |
download | linux-133b08513a99d44d9ed916bb83e46343f6ad2855.tar.xz linux-133b08513a99d44d9ed916bb83e46343f6ad2855.zip |
chelsio: do vlan cleanup
- unify vlan and nonvlan rx path
- kill adapter->vlan_grp and t1_vlan_rx_register
- allow to turn on/off rx/tx vlan accel via ethtool (set_features)
Signed-off-by: Jiri Pirko <jpirko@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/chelsio/sge.c')
-rw-r--r-- | drivers/net/chelsio/sge.c | 18 |
1 files changed, 8 insertions, 10 deletions
diff --git a/drivers/net/chelsio/sge.c b/drivers/net/chelsio/sge.c index 58380d240619..e9a03fffef15 100644 --- a/drivers/net/chelsio/sge.c +++ b/drivers/net/chelsio/sge.c @@ -742,13 +742,14 @@ static inline void setup_ring_params(struct adapter *adapter, u64 addr, /* * Enable/disable VLAN acceleration. */ -void t1_set_vlan_accel(struct adapter *adapter, int on_off) +void t1_vlan_mode(struct adapter *adapter, u32 features) { struct sge *sge = adapter->sge; - sge->sge_control &= ~F_VLAN_XTRACT; - if (on_off) + if (features & NETIF_F_HW_VLAN_RX) sge->sge_control |= F_VLAN_XTRACT; + else + sge->sge_control &= ~F_VLAN_XTRACT; if (adapter->open_device_map) { writel(sge->sge_control, adapter->regs + A_SG_CONTROL); readl(adapter->regs + A_SG_CONTROL); /* flush */ @@ -1397,12 +1398,11 @@ static void sge_rx(struct sge *sge, struct freelQ *fl, unsigned int len) } else skb_checksum_none_assert(skb); - if (unlikely(adapter->vlan_grp && p->vlan_valid)) { + if (p->vlan_valid) { st->vlan_xtract++; - vlan_hwaccel_receive_skb(skb, adapter->vlan_grp, - ntohs(p->vlan)); - } else - netif_receive_skb(skb); + __vlan_hwaccel_put_tag(skb, ntohs(p->vlan)); + } + netif_receive_skb(skb); } /* @@ -1875,13 +1875,11 @@ netdev_tx_t t1_start_xmit(struct sk_buff *skb, struct net_device *dev) } cpl->iff = dev->if_port; -#if defined(CONFIG_VLAN_8021Q) || defined(CONFIG_VLAN_8021Q_MODULE) if (vlan_tx_tag_present(skb)) { cpl->vlan_valid = 1; cpl->vlan = htons(vlan_tx_tag_get(skb)); st->vlan_insert++; } else -#endif cpl->vlan_valid = 0; send: |