Re: [PATCH net-next v2 4/4] net: hdlc_fr: Add support for any Ethertype

2020-10-29 Thread Willem de Bruijn
On Thu, Oct 29, 2020 at 8:49 PM Xie He wrote: > > On Thu, Oct 29, 2020 at 4:53 PM Xie He wrote: > > > > > Does it make sense to define a struct snap_hdr instead of manually > > > casting all these bytes? > > > > > And macros or constant integers to self document these kinds of fields. > > > >

Re: [PATCH net-next v2 4/4] net: hdlc_fr: Add support for any Ethertype

2020-10-29 Thread Willem de Bruijn
On Thu, Oct 29, 2020 at 7:53 PM Xie He wrote: > > On Thu, Oct 29, 2020 at 10:24 AM Willem de Bruijn > wrote: > > > > > Also add skb_reset_mac_header before we pass an skb (received on normal > > > PVC devices) to upper layers. Because we don't use header_ops for normal > > > PVC devices, we

Re: [PATCH net-next v2 4/4] net: hdlc_fr: Add support for any Ethertype

2020-10-29 Thread Xie He
On Thu, Oct 29, 2020 at 4:53 PM Xie He wrote: > > > Does it make sense to define a struct snap_hdr instead of manually > > casting all these bytes? > > > And macros or constant integers to self document these kinds of fields. > > Yes, we can define a struct snap_hdr, like this: > > struct

Re: [PATCH net-next v2 4/4] net: hdlc_fr: Add support for any Ethertype

2020-10-29 Thread Xie He
On Thu, Oct 29, 2020 at 10:24 AM Willem de Bruijn wrote: > > > Also add skb_reset_mac_header before we pass an skb (received on normal > > PVC devices) to upper layers. Because we don't use header_ops for normal > > PVC devices, we should hide the header from upper layer code in this case. > >

Re: [PATCH net-next v2 4/4] net: hdlc_fr: Add support for any Ethertype

2020-10-29 Thread Willem de Bruijn
On Wed, Oct 28, 2020 at 6:58 PM Xie He wrote: > > Change the fr_rx function to make this driver support any Ethertype > when receiving skbs on normal (non-Ethernet-emulating) PVC devices. > (This driver is already able to handle any Ethertype when sending.) > > Originally in the fr_rx function,

[PATCH net-next v2 4/4] net: hdlc_fr: Add support for any Ethertype

2020-10-28 Thread Xie He
Change the fr_rx function to make this driver support any Ethertype when receiving skbs on normal (non-Ethernet-emulating) PVC devices. (This driver is already able to handle any Ethertype when sending.) Originally in the fr_rx function, the code that parses the long (10-byte) header only