diff options
author | Pascal Hambourg <pascal@plouf.fr.eu.org> | 2011-08-17 02:37:18 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2011-11-29 00:28:06 -0500 |
commit | 9e667b29880df842085150d60e26c60f141fff44 (patch) | |
tree | ec49d63db929de2fc502107d4d5346ad6435dd32 /net/atm | |
parent | 08e29af3a9096ffdff477e537daea67faefd3952 (diff) |
atm: br2684: Make headroom and hard_header_len depend on the payload type
Routed payload requires less headroom than bridged payload.
So do not reallocate headroom if not needed.
Also, add worst case AAL5 overhead to netdev->hard_header_len.
Signed-off-by: Pascal Hambourg <pascal@plouf.fr.eu.org>
Signed-off-by: chas williams - CONTRACTOR <chas@cmf.nrl.navy.mil>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/atm')
-rw-r--r-- | net/atm/br2684.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/net/atm/br2684.c b/net/atm/br2684.c index 53b0aa14a1e6..ed72263d0dc7 100644 --- a/net/atm/br2684.c +++ b/net/atm/br2684.c | |||
@@ -202,7 +202,10 @@ static int br2684_xmit_vcc(struct sk_buff *skb, struct net_device *dev, | |||
202 | { | 202 | { |
203 | struct br2684_dev *brdev = BRPRIV(dev); | 203 | struct br2684_dev *brdev = BRPRIV(dev); |
204 | struct atm_vcc *atmvcc; | 204 | struct atm_vcc *atmvcc; |
205 | int minheadroom = (brvcc->encaps == e_llc) ? 10 : 2; | 205 | int minheadroom = (brvcc->encaps == e_llc) ? |
206 | ((brdev->payload == p_bridged) ? | ||
207 | sizeof(llc_oui_pid_pad) : sizeof(llc_oui_ipv4)) : | ||
208 | ((brdev->payload == p_bridged) ? BR2684_PAD_LEN : 0); | ||
206 | 209 | ||
207 | if (skb_headroom(skb) < minheadroom) { | 210 | if (skb_headroom(skb) < minheadroom) { |
208 | struct sk_buff *skb2 = skb_realloc_headroom(skb, minheadroom); | 211 | struct sk_buff *skb2 = skb_realloc_headroom(skb, minheadroom); |
@@ -583,6 +586,7 @@ static void br2684_setup(struct net_device *netdev) | |||
583 | struct br2684_dev *brdev = BRPRIV(netdev); | 586 | struct br2684_dev *brdev = BRPRIV(netdev); |
584 | 587 | ||
585 | ether_setup(netdev); | 588 | ether_setup(netdev); |
589 | netdev->hard_header_len += sizeof(llc_oui_pid_pad); /* worst case */ | ||
586 | brdev->net_dev = netdev; | 590 | brdev->net_dev = netdev; |
587 | 591 | ||
588 | netdev->netdev_ops = &br2684_netdev_ops; | 592 | netdev->netdev_ops = &br2684_netdev_ops; |
@@ -595,7 +599,7 @@ static void br2684_setup_routed(struct net_device *netdev) | |||
595 | struct br2684_dev *brdev = BRPRIV(netdev); | 599 | struct br2684_dev *brdev = BRPRIV(netdev); |
596 | 600 | ||
597 | brdev->net_dev = netdev; | 601 | brdev->net_dev = netdev; |
598 | netdev->hard_header_len = 0; | 602 | netdev->hard_header_len = sizeof(llc_oui_ipv4); /* worst case */ |
599 | netdev->netdev_ops = &br2684_netdev_ops_routed; | 603 | netdev->netdev_ops = &br2684_netdev_ops_routed; |
600 | netdev->addr_len = 0; | 604 | netdev->addr_len = 0; |
601 | netdev->mtu = 1500; | 605 | netdev->mtu = 1500; |