]> git.baikalelectronics.ru Git - kernel.git/commit
drivers/net/wan/hdlc_fr: Add needed_headroom for PVC devices
authorXie He <xie.he.0141@gmail.com>
Thu, 3 Sep 2020 00:06:58 +0000 (17:06 -0700)
committerJakub Kicinski <kuba@kernel.org>
Sat, 5 Sep 2020 04:37:04 +0000 (21:37 -0700)
commitc71ff927426f8de44945a3f410d2a2e6a6af95c6
treed7b6c5b589bb60ef609ed79cf24da71f9a0458dc
parentddb3abbef71ea9d5a8beb52601dfe30cf57c0ff8
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 <khc@pm.waw.pl>
Cc: Martin Schiller <ms@dev.tdt.de>
Signed-off-by: Xie He <xie.he.0141@gmail.com>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
drivers/net/wan/hdlc_fr.c