From mboxrd@z Thu Jan 1 00:00:00 1970 From: Toshiaki Makita Subject: Re: [PATCH v7 bpf-next 05/10] veth: Handle xdp_frames in xdp napi ring Date: Thu, 2 Aug 2018 22:17:53 +0900 Message-ID: <4402804f-bf7b-9ca0-baa9-1415884b0a80@gmail.com> References: <1533207314-2572-1-git-send-email-makita.toshiaki@lab.ntt.co.jp> <1533207314-2572-6-git-send-email-makita.toshiaki@lab.ntt.co.jp> <20180802134548.2230455b@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Cc: Alexei Starovoitov , Daniel Borkmann , netdev@vger.kernel.org, Jakub Kicinski , John Fastabend To: Jesper Dangaard Brouer , Toshiaki Makita Return-path: Received: from mail-pf1-f193.google.com ([209.85.210.193]:46111 "EHLO mail-pf1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732270AbeHBPJG (ORCPT ); Thu, 2 Aug 2018 11:09:06 -0400 Received: by mail-pf1-f193.google.com with SMTP id u24-v6so1289080pfn.13 for ; Thu, 02 Aug 2018 06:17:56 -0700 (PDT) In-Reply-To: <20180802134548.2230455b@redhat.com> Content-Language: en-US Sender: netdev-owner@vger.kernel.org List-ID: On 18/08/02 (木) 20:45, Jesper Dangaard Brouer wrote: > On Thu, 2 Aug 2018 19:55:09 +0900 > Toshiaki Makita 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. Supposing xdp_frame is not located in the top of data area, what ensures that additional sizeof(struct xdp_frame) can be used? Toshiaki Makita