Intel-Wired-Lan Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Kurt Kanzenbach <kurt@linutronix.de>
To: intel-wired-lan@osuosl.org
Subject: [Intel-wired-lan] [PATCH RFC net] igb: Fix XDP with PTP enabled
Date: Tue, 13 Apr 2021 09:34:49 +0200	[thread overview]
Message-ID: <874kga1vty.fsf@kurt> (raw)
In-Reply-To: <20210412162846.42706d99@carbon>

On Mon Apr 12 2021, Jesper Dangaard Brouer wrote:
> On Mon, 12 Apr 2021 12:17:13 +0200
> Kurt Kanzenbach <kurt@linutronix.de> wrote:
>
>> When using native XDP with the igb driver, the XDP frame data doesn't point to
>> the beginning of the packet. It's off by 16 bytes. Everything works as expected
>> with XDP skb mode.
>> 
>> Actually these 16 bytes are used to store the packet timestamps. Therefore, pull
>> the timestamp before executing any XDP operations and adjust all other code
>> accordingly. The igc driver does it like that as well.
>
> (Cc. Alexander Duyck)

Thanks.

>
> Do we have enough room for the packet page-split tricks when these 16
> bytes are added?

I think so. AFAICT the timestamp header is accounted. There is
IGB_2K_TOO_SMALL_WITH_PADDING. If 2k isn't sufficient, then 3k buffers
are used.

The only thing this patch does, is adjusting the xdp->data pointer
before executing igb_run_xdp() instead of doing it afterwards. So, that
in the eBPF program `data' points to the packet data, and not to the
timestamp.

Thanks,
Kurt
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 832 bytes
Desc: not available
URL: <http://lists.osuosl.org/pipermail/intel-wired-lan/attachments/20210413/d36749d6/attachment.asc>

  reply	other threads:[~2021-04-13  7:34 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-04-12 10:17 [Intel-wired-lan] [PATCH RFC net] igb: Fix XDP with PTP enabled Kurt Kanzenbach
2021-04-12 14:28 ` Jesper Dangaard Brouer
2021-04-13  7:34   ` Kurt Kanzenbach [this message]
2021-04-13 15:25   ` Alexander Duyck
2021-04-13 17:21     ` Kurt Kanzenbach
2021-06-02 10:49 ` Penigalapati, Sandeep

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=874kga1vty.fsf@kurt \
    --to=kurt@linutronix.de \
    --cc=intel-wired-lan@osuosl.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
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