Re: [PATCH net v2] drivers/net/wan/hdlc_fr: Add needed_headroom for PVC devices

From: Xie He
Date: Mon Sep 14 2020 - 02:19:19 EST


On Sun, Sep 13, 2020 at 10:26 PM Krzysztof Hałasa <khalasa@xxxxxxx> wrote:
>
> Xie He <xie.he.0141@xxxxxxxxx> writes:
>
> > The HDLC device is not actually prepending any header when it is used
> > with this driver. When the PVC device has prepended its header and
> > handed over the skb to the HDLC device, the HDLC device just hands it
> > over to the hardware driver for transmission without prepending any
> > header.
>
> That's correct. IIRC:
> - Cisco and PPP modes add 4 bytes
> - Frame Relay adds 4 (specific protocols - mostly IPv4) or 10 (general
> case) bytes. There is that pvcX->hdlcX transition which adds nothing
> (the header is already in place when the packet leaves pvcX device).
> - Raw mode adds nothing (IPv4 only, though it could be modified for
> both IPv4/v6 easily)
> - Ethernet (hdlc_raw_eth.c) adds normal Ethernet header.

Thank you for the nice summary!

I just realized that we can indeed support both IPv4/v6 in hdlc_raw.
Both IPv4 and v6 packets have a version field in the header, so we can
use it to distinguish v4 and v6 packets on receiving. We can introduce
it as a new feature some time.