* [PATCH net-next] stmmac: Add vlan rx for better GRO performance.
@ 2014-01-14 17:34 Vince Bridgers
2014-01-14 18:12 ` Stephen Hemminger
2014-01-14 19:14 ` Sergei Shtylyov
0 siblings, 2 replies; 3+ messages in thread
From: Vince Bridgers @ 2014-01-14 17:34 UTC (permalink / raw)
To: netdev; +Cc: peppe.cavallaro, rayagond, vbridgers2013
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>
---
drivers/net/ethernet/stmicro/stmmac/stmmac_main.c | 18 ++++++++++++++++++
1 file changed, 18 insertions(+)
diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
index b8e3a4c..e3ff84e 100644
--- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
+++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
@@ -1951,6 +1951,22 @@ static netdev_tx_t stmmac_xmit(struct sk_buff *skb, struct net_device *dev)
return NETDEV_TX_OK;
}
+static inline void stmmac_rx_vlan(struct net_device *dev, struct sk_buff *skb)
+{
+ struct ethhdr *ehdr;
+ u16 vlanid;
+ if ((dev->features & NETIF_F_HW_VLAN_CTAG_RX) ==
+ NETIF_F_HW_VLAN_CTAG_RX &&
+ !__vlan_get_tag(skb, &vlanid)) {
+ /* pop the vlan tag */
+ ehdr = (struct ethhdr *)skb->data;
+ memmove(skb->data + VLAN_HLEN, ehdr, ETH_ALEN * 2);
+ skb_pull(skb, VLAN_HLEN);
+ __vlan_hwaccel_put_tag(skb, htons(ETH_P_8021Q), vlanid);
+ }
+}
+
+
/**
* stmmac_rx_refill: refill used skb preallocated buffers
* @priv: driver private structure
@@ -2102,6 +2118,8 @@ static int stmmac_rx(struct stmmac_priv *priv, int limit)
print_pkt(skb->data, frame_len);
}
+ stmmac_rx_vlan(priv->dev, skb);
+
skb->protocol = eth_type_trans(skb, priv->dev);
if (unlikely(!coe))
--
1.7.9.5
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH net-next] stmmac: Add vlan rx for better GRO performance.
2014-01-14 17:34 [PATCH net-next] stmmac: Add vlan rx for better GRO performance Vince Bridgers
@ 2014-01-14 18:12 ` Stephen Hemminger
2014-01-14 19:14 ` Sergei Shtylyov
1 sibling, 0 replies; 3+ messages in thread
From: Stephen Hemminger @ 2014-01-14 18:12 UTC (permalink / raw)
To: Vince Bridgers; +Cc: netdev, peppe.cavallaro, rayagond
On Tue, 14 Jan 2014 11:34:06 -0600
Vince Bridgers <vbridgers2013@gmail.com> wrote:
> +static inline void stmmac_rx_vlan(struct net_device *dev, struct sk_buff *skb)
> +{
No need for explicit inline, let the compiler decide to inline.
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH net-next] stmmac: Add vlan rx for better GRO performance.
2014-01-14 17:34 [PATCH net-next] stmmac: Add vlan rx for better GRO performance Vince Bridgers
2014-01-14 18:12 ` Stephen Hemminger
@ 2014-01-14 19:14 ` Sergei Shtylyov
1 sibling, 0 replies; 3+ messages in thread
From: Sergei Shtylyov @ 2014-01-14 19:14 UTC (permalink / raw)
To: Vince Bridgers, netdev; +Cc: peppe.cavallaro, rayagond
Hello.
On 01/14/2014 08:34 PM, Vince Bridgers wrote:
> 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>
> ---
> drivers/net/ethernet/stmicro/stmmac/stmmac_main.c | 18 ++++++++++++++++++
> 1 file changed, 18 insertions(+)
> diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
> index b8e3a4c..e3ff84e 100644
> --- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
> +++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
> @@ -1951,6 +1951,22 @@ static netdev_tx_t stmmac_xmit(struct sk_buff *skb, struct net_device *dev)
> return NETDEV_TX_OK;
> }
>
> +static inline void stmmac_rx_vlan(struct net_device *dev, struct sk_buff *skb)
> +{
> + struct ethhdr *ehdr;
> + u16 vlanid;
Empty line after declarations wouldn't hurt.
> + if ((dev->features & NETIF_F_HW_VLAN_CTAG_RX) ==
> + NETIF_F_HW_VLAN_CTAG_RX &&
Line should start right below the second paren on the previousl line.
> + !__vlan_get_tag(skb, &vlanid)) {
This one too.
WBR, Sergei
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2014-01-14 18:14 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-01-14 17:34 [PATCH net-next] stmmac: Add vlan rx for better GRO performance Vince Bridgers
2014-01-14 18:12 ` Stephen Hemminger
2014-01-14 19:14 ` Sergei Shtylyov
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).