* [PATCH net-next] bridge: Remove unnecessary vlan_put_tag in br_handle_vlan
@ 2014-01-22 0:29 Toshiaki Makita
2014-01-22 15:22 ` Vlad Yasevich
2014-01-23 5:30 ` David Miller
0 siblings, 2 replies; 3+ messages in thread
From: Toshiaki Makita @ 2014-01-22 0:29 UTC (permalink / raw)
To: David S . Miller, Stephen Hemminger, Vlad Yasevich, netdev
Cc: Toshiaki Makita
br_handle_vlan() pushes HW accelerated vlan tag into skbuff when outgoing
port is the bridge device.
This is unnecessary because __netif_receive_skb_core() can handle skbs
with HW accelerated vlan tag. In current implementation,
__netif_receive_skb_core() needs to extract the vlan tag embedded in skb
data. This could cause low network performance especially when receiving
frames at a high frame rate on the bridge device.
Signed-off-by: Toshiaki Makita <makita.toshiaki@lab.ntt.co.jp>
---
net/bridge/br_vlan.c | 21 ---------------------
1 file changed, 21 deletions(-)
diff --git a/net/bridge/br_vlan.c b/net/bridge/br_vlan.c
index 7ffc801..4ca4d0a 100644
--- a/net/bridge/br_vlan.c
+++ b/net/bridge/br_vlan.c
@@ -151,27 +151,6 @@ struct sk_buff *br_handle_vlan(struct net_bridge *br,
br_vlan_get_tag(skb, &vid);
if (test_bit(vid, pv->untagged_bitmap))
skb = br_vlan_untag(skb);
- else {
- /* Egress policy says "send tagged". If output device
- * is the bridge, we need to add the VLAN header
- * ourselves since we'll be going through the RX path.
- * Sending to ports puts the frame on the TX path and
- * we let dev_hard_start_xmit() add the header.
- */
- if (skb->protocol != htons(ETH_P_8021Q) &&
- pv->port_idx == 0) {
- /* vlan_put_tag expects skb->data to point to
- * mac header.
- */
- skb_push(skb, ETH_HLEN);
- skb = __vlan_put_tag(skb, skb->vlan_proto, skb->vlan_tci);
- if (!skb)
- goto out;
- /* put skb->data back to where it was */
- skb_pull(skb, ETH_HLEN);
- skb->vlan_tci = 0;
- }
- }
out:
return skb;
--
1.8.1.2
^ permalink raw reply related [flat|nested] 3+ messages in thread* Re: [PATCH net-next] bridge: Remove unnecessary vlan_put_tag in br_handle_vlan
2014-01-22 0:29 [PATCH net-next] bridge: Remove unnecessary vlan_put_tag in br_handle_vlan Toshiaki Makita
@ 2014-01-22 15:22 ` Vlad Yasevich
2014-01-23 5:30 ` David Miller
1 sibling, 0 replies; 3+ messages in thread
From: Vlad Yasevich @ 2014-01-22 15:22 UTC (permalink / raw)
To: Toshiaki Makita, David S . Miller, Stephen Hemminger, netdev
On 01/21/2014 07:29 PM, Toshiaki Makita wrote:
> br_handle_vlan() pushes HW accelerated vlan tag into skbuff when outgoing
> port is the bridge device.
> This is unnecessary because __netif_receive_skb_core() can handle skbs
> with HW accelerated vlan tag. In current implementation,
> __netif_receive_skb_core() needs to extract the vlan tag embedded in skb
> data. This could cause low network performance especially when receiving
> frames at a high frame rate on the bridge device.
>
> Signed-off-by: Toshiaki Makita <makita.toshiaki@lab.ntt.co.jp>
Acked-by: Vlad Yasevich <vyasevic@redhat.com>
-vlad
> ---
> net/bridge/br_vlan.c | 21 ---------------------
> 1 file changed, 21 deletions(-)
>
> diff --git a/net/bridge/br_vlan.c b/net/bridge/br_vlan.c
> index 7ffc801..4ca4d0a 100644
> --- a/net/bridge/br_vlan.c
> +++ b/net/bridge/br_vlan.c
> @@ -151,27 +151,6 @@ struct sk_buff *br_handle_vlan(struct net_bridge *br,
> br_vlan_get_tag(skb, &vid);
> if (test_bit(vid, pv->untagged_bitmap))
> skb = br_vlan_untag(skb);
> - else {
> - /* Egress policy says "send tagged". If output device
> - * is the bridge, we need to add the VLAN header
> - * ourselves since we'll be going through the RX path.
> - * Sending to ports puts the frame on the TX path and
> - * we let dev_hard_start_xmit() add the header.
> - */
> - if (skb->protocol != htons(ETH_P_8021Q) &&
> - pv->port_idx == 0) {
> - /* vlan_put_tag expects skb->data to point to
> - * mac header.
> - */
> - skb_push(skb, ETH_HLEN);
> - skb = __vlan_put_tag(skb, skb->vlan_proto, skb->vlan_tci);
> - if (!skb)
> - goto out;
> - /* put skb->data back to where it was */
> - skb_pull(skb, ETH_HLEN);
> - skb->vlan_tci = 0;
> - }
> - }
>
> out:
> return skb;
>
^ permalink raw reply [flat|nested] 3+ messages in thread* Re: [PATCH net-next] bridge: Remove unnecessary vlan_put_tag in br_handle_vlan
2014-01-22 0:29 [PATCH net-next] bridge: Remove unnecessary vlan_put_tag in br_handle_vlan Toshiaki Makita
2014-01-22 15:22 ` Vlad Yasevich
@ 2014-01-23 5:30 ` David Miller
1 sibling, 0 replies; 3+ messages in thread
From: David Miller @ 2014-01-23 5:30 UTC (permalink / raw)
To: makita.toshiaki; +Cc: stephen, vyasevic, netdev
From: Toshiaki Makita <makita.toshiaki@lab.ntt.co.jp>
Date: Wed, 22 Jan 2014 09:29:37 +0900
> br_handle_vlan() pushes HW accelerated vlan tag into skbuff when outgoing
> port is the bridge device.
> This is unnecessary because __netif_receive_skb_core() can handle skbs
> with HW accelerated vlan tag. In current implementation,
> __netif_receive_skb_core() needs to extract the vlan tag embedded in skb
> data. This could cause low network performance especially when receiving
> frames at a high frame rate on the bridge device.
>
> Signed-off-by: Toshiaki Makita <makita.toshiaki@lab.ntt.co.jp>
Applied.
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2014-01-23 5:30 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-01-22 0:29 [PATCH net-next] bridge: Remove unnecessary vlan_put_tag in br_handle_vlan Toshiaki Makita
2014-01-22 15:22 ` Vlad Yasevich
2014-01-23 5:30 ` David Miller
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).