[PATCH net] net/packet: Fix a comment about hard_header_len and headroom allocation

2020-09-05 Thread Xie He
This comment is outdated and no longer reflects the actual implementation of af_packet.c. Reasons for the new comment: 1. In this file, the function packet_snd first reserves a headroom of length (dev->hard_header_len + dev->needed_headroom). Then if the socket is a SOCK_DGRAM socket, it calls d

Re: [PATCH net] net/packet: Fix a comment about hard_header_len and headroom allocation

2020-09-07 Thread Willem de Bruijn
On Sun, Sep 6, 2020 at 5:18 AM Xie He wrote: > > This comment is outdated and no longer reflects the actual implementation > of af_packet.c. If it was previously true, can you point to a commit that changes the behavior? > > Reasons for the new comment: > > 1. > > In this file, the function pack

Re: [PATCH net] net/packet: Fix a comment about hard_header_len and headroom allocation

2020-09-07 Thread Xie He
Thank you for your comment! On Mon, Sep 7, 2020 at 2:41 AM Willem de Bruijn wrote: > > On Sun, Sep 6, 2020 at 5:18 AM Xie He wrote: > > > > This comment is outdated and no longer reflects the actual implementation > > of af_packet.c. > > If it was previously true, can you point to a commit that

Re: [PATCH net] net/packet: Fix a comment about hard_header_len and headroom allocation

2020-09-08 Thread Willem de Bruijn
On Tue, Sep 8, 2020 at 2:07 AM Xie He wrote: > > Thank you for your comment! > > On Mon, Sep 7, 2020 at 2:41 AM Willem de Bruijn > wrote: > > > > On Sun, Sep 6, 2020 at 5:18 AM Xie He wrote: > > > > > > This comment is outdated and no longer reflects the actual implementation > > > of af_packet.

Re: [PATCH net] net/packet: Fix a comment about hard_header_len and headroom allocation

2020-09-08 Thread Xie He
On Tue, Sep 8, 2020 at 1:56 AM Willem de Bruijn wrote: > > > > > /* > > > > Assumptions: > > > > - - if device has no dev->hard_header routine, it adds and removes ll > > > > header > > > > - inside itself. In this case ll header is invisible outside of > > > > device, > > > > - b

Re: [PATCH net] net/packet: Fix a comment about hard_header_len and headroom allocation

2020-09-08 Thread Willem de Bruijn
> > > > More about the older comment, but if reusing: it's not entirely clear > > > > to me what "outside of the device" means. The upper layers that > > > > receive data from the device and send data to it, including > > > > packet_snd, I suppose? Not the lower layers, clearly. Maybe that can > >