Skip to content

Commit 44a049c

Browse files
Xie Hekuba-moo
authored andcommitted
drivers/net/wan/hdlc_fr: Add needed_headroom for PVC devices
PVC devices are virtual devices in this driver stacked on top of the actual HDLC device. They are the devices normal users would use. PVC devices have two types: normal PVC devices and Ethernet-emulating PVC devices. When transmitting data with PVC devices, the ndo_start_xmit function will prepend a header of 4 or 10 bytes. Currently this driver requests this headroom to be reserved for normal PVC devices by setting their hard_header_len to 10. However, this does not work when these devices are used with AF_PACKET/RAW sockets. Also, this driver does not request this headroom for Ethernet-emulating PVC devices (but deals with this problem by reallocating the skb when needed, which is not optimal). This patch replaces hard_header_len with needed_headroom, and set needed_headroom for Ethernet-emulating PVC devices, too. This makes the driver to request headroom for all PVC devices in all cases. Cc: Krzysztof Halasa <[email protected]> Cc: Martin Schiller <[email protected]> Signed-off-by: Xie He <[email protected]> Signed-off-by: Jakub Kicinski <[email protected]>
1 parent c70672d commit 44a049c

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

drivers/net/wan/hdlc_fr.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1041,7 +1041,7 @@ static void pvc_setup(struct net_device *dev)
10411041
{
10421042
dev->type = ARPHRD_DLCI;
10431043
dev->flags = IFF_POINTOPOINT;
1044-
dev->hard_header_len = 10;
1044+
dev->hard_header_len = 0;
10451045
dev->addr_len = 2;
10461046
netif_keep_dst(dev);
10471047
}
@@ -1093,6 +1093,7 @@ static int fr_add_pvc(struct net_device *frad, unsigned int dlci, int type)
10931093
dev->mtu = HDLC_MAX_MTU;
10941094
dev->min_mtu = 68;
10951095
dev->max_mtu = HDLC_MAX_MTU;
1096+
dev->needed_headroom = 10;
10961097
dev->priv_flags |= IFF_NO_QUEUE;
10971098
dev->ml_priv = pvc;
10981099

0 commit comments

Comments
 (0)