diff options
author | Vince Bridgers <vbridgers2013@gmail.com> | 2014-01-14 14:42:05 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2014-01-15 18:13:08 -0500 |
commit | b93819854d6e79999a01ae73f90d3a4b06816cf7 (patch) | |
tree | eeaa7796d7f2a340bf4b5edcd4b53d63cd1c86f1 /drivers/net/ethernet/stmicro/stmmac/stmmac_main.c | |
parent | 8d448b86f5d7c859f48188802dcabf78719c00b6 (diff) |
stmmac: Add vlan rx for better GRO performance.
GRO requires VLANs to be removed before aggregation can occur.
The Synopsys EMAC does not strip VLAN tags so this must be
done by the driver.
Signed-off-by: Vince Bridgers <vbridgers2013@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet/stmicro/stmmac/stmmac_main.c')
-rw-r--r-- | drivers/net/ethernet/stmicro/stmmac/stmmac_main.c | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c index b8e3a4ce24b0..ecdc8ab50425 100644 --- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c +++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c | |||
@@ -1951,6 +1951,23 @@ static netdev_tx_t stmmac_xmit(struct sk_buff *skb, struct net_device *dev) | |||
1951 | return NETDEV_TX_OK; | 1951 | return NETDEV_TX_OK; |
1952 | } | 1952 | } |
1953 | 1953 | ||
1954 | static void stmmac_rx_vlan(struct net_device *dev, struct sk_buff *skb) | ||
1955 | { | ||
1956 | struct ethhdr *ehdr; | ||
1957 | u16 vlanid; | ||
1958 | |||
1959 | if ((dev->features & NETIF_F_HW_VLAN_CTAG_RX) == | ||
1960 | NETIF_F_HW_VLAN_CTAG_RX && | ||
1961 | !__vlan_get_tag(skb, &vlanid)) { | ||
1962 | /* pop the vlan tag */ | ||
1963 | ehdr = (struct ethhdr *)skb->data; | ||
1964 | memmove(skb->data + VLAN_HLEN, ehdr, ETH_ALEN * 2); | ||
1965 | skb_pull(skb, VLAN_HLEN); | ||
1966 | __vlan_hwaccel_put_tag(skb, htons(ETH_P_8021Q), vlanid); | ||
1967 | } | ||
1968 | } | ||
1969 | |||
1970 | |||
1954 | /** | 1971 | /** |
1955 | * stmmac_rx_refill: refill used skb preallocated buffers | 1972 | * stmmac_rx_refill: refill used skb preallocated buffers |
1956 | * @priv: driver private structure | 1973 | * @priv: driver private structure |
@@ -2102,6 +2119,8 @@ static int stmmac_rx(struct stmmac_priv *priv, int limit) | |||
2102 | print_pkt(skb->data, frame_len); | 2119 | print_pkt(skb->data, frame_len); |
2103 | } | 2120 | } |
2104 | 2121 | ||
2122 | stmmac_rx_vlan(priv->dev, skb); | ||
2123 | |||
2105 | skb->protocol = eth_type_trans(skb, priv->dev); | 2124 | skb->protocol = eth_type_trans(skb, priv->dev); |
2106 | 2125 | ||
2107 | if (unlikely(!coe)) | 2126 | if (unlikely(!coe)) |