public inbox for netdev@vger.kernel.org 
 help / color / mirror / Atom feed
From: Jesper Dangaard Brouer <brouer@redhat•com>
To: Toshiaki Makita <toshiaki.makita1@gmail•com>
Cc: Toshiaki Makita <makita.toshiaki@lab•ntt.co.jp>,
	Alexei Starovoitov <ast@kernel•org>,
	Daniel Borkmann <daniel@iogearbox•net>,
	netdev@vger•kernel.org,
	Jakub Kicinski <jakub.kicinski@netronome•com>,
	John Fastabend <john.fastabend@gmail•com>,
	brouer@redhat•com
Subject: Re: [PATCH v7 bpf-next 05/10] veth: Handle xdp_frames in xdp napi ring
Date: Thu, 2 Aug 2018 15:53:36 +0200	[thread overview]
Message-ID: <20180802155336.15169974@redhat.com> (raw)
In-Reply-To: <4402804f-bf7b-9ca0-baa9-1415884b0a80@gmail.com>

On Thu, 2 Aug 2018 22:17:53 +0900
Toshiaki Makita <toshiaki.makita1@gmail•com> wrote:

> On 18/08/02 (木) 20:45, Jesper Dangaard Brouer wrote:
> > On Thu,  2 Aug 2018 19:55:09 +0900
> > Toshiaki Makita <makita.toshiaki@lab•ntt.co.jp> wrote:
> >   
> >> +	headroom = frame->data - delta - (void *)frame;  
> > 
> > Your calculation of headroom is still adding an assumption that
> > xdp_frame is located in the top of data area, that is unnecessary.
> > 
> > The headroom can be calculated as:
> > 
> >   headroom = sizeof(struct xdp_frame) + frame->headroom - delta;  
> 
> Thanks. But I'm not sure I get what you are requesting.

I'm simply requesting you do not use the (void *)frame pointer address,
to calculate the headroom, as it can be calculated in another way.

> Supposing xdp_frame is not located in the top of data area, what ensures 
> that additional sizeof(struct xdp_frame) can be used?

The calculation in convert_to_xdp_frame() assures this.  If we later
add an xdp_frame that is not located in the top of data area, and want
to change the reserved headroom size, then we deal with it, and update
the code.

-- 
Best regards,
  Jesper Dangaard Brouer
  MSc.CS, Principal Kernel Engineer at Red Hat
  LinkedIn: http://www.linkedin.com/in/brouer

  reply	other threads:[~2018-08-02 15:45 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-08-02 10:55 [PATCH v7 bpf-next 00/10] veth: Driver XDP Toshiaki Makita
2018-08-02 10:55 ` [PATCH v7 bpf-next 01/10] net: Export skb_headers_offset_update Toshiaki Makita
2018-08-02 10:55 ` [PATCH v7 bpf-next 02/10] veth: Add driver XDP Toshiaki Makita
2018-08-02 10:55 ` [PATCH v7 bpf-next 03/10] veth: Avoid drops by oversized packets when XDP is enabled Toshiaki Makita
2018-08-02 10:55 ` [PATCH v7 bpf-next 04/10] xdp: Helper function to clear kernel pointers in xdp_frame Toshiaki Makita
2018-08-02 10:55 ` [PATCH v7 bpf-next 05/10] veth: Handle xdp_frames in xdp napi ring Toshiaki Makita
2018-08-02 11:45   ` Jesper Dangaard Brouer
2018-08-02 13:17     ` Toshiaki Makita
2018-08-02 13:53       ` Jesper Dangaard Brouer [this message]
2018-08-02 14:10         ` Toshiaki Makita
2018-08-02 10:55 ` [PATCH v7 bpf-next 06/10] veth: Add ndo_xdp_xmit Toshiaki Makita
2018-08-02 10:55 ` [PATCH v7 bpf-next 07/10] bpf: Make redirect_info accessible from modules Toshiaki Makita
2018-08-02 10:55 ` [PATCH v7 bpf-next 08/10] xdp: Helpers for disabling napi_direct of xdp_return_frame Toshiaki Makita
2018-08-02 10:55 ` [PATCH v7 bpf-next 09/10] veth: Add XDP TX and REDIRECT Toshiaki Makita
2018-08-02 10:55 ` [PATCH v7 bpf-next 10/10] veth: Support per queue XDP ring Toshiaki Makita

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20180802155336.15169974@redhat.com \
    --to=brouer@redhat$(echo .)com \
    --cc=ast@kernel$(echo .)org \
    --cc=daniel@iogearbox$(echo .)net \
    --cc=jakub.kicinski@netronome$(echo .)com \
    --cc=john.fastabend@gmail$(echo .)com \
    --cc=makita.toshiaki@lab$(echo .)ntt.co.jp \
    --cc=netdev@vger$(echo .)kernel.org \
    --cc=toshiaki.makita1@gmail$(echo .)com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox