All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jun Hu <hujun.work@gmail.com>
To: Konrad Zemek <konrad@zemek.io>
Cc: "Toke Høiland-Jørgensen" <toke@redhat.com>, xdp-newbies@vger.kernel.org
Subject: Re: AF_XDP socket TX path interact with TC?
Date: Tue, 26 Oct 2021 11:34:30 -0700	[thread overview]
Message-ID: <CAEM4-kBho+aUNNSAoGWWF-Ou=2QC+7b6OD6m+JixOHCcye9RFw@mail.gmail.com> (raw)
In-Reply-To: <oM1Y-n6UaYUi_6m-lAXmxeqxarfyIBRoZcEpq5WObujvHCCFRZZNwjrBIn0ycTo5oevKJvw6JtlR2UeE2qqzwtKV_QNrpxHBfFgJ_EQLdfQ=@zemek.io>

On Tue, Oct 26, 2021 at 4:08 AM Konrad Zemek <konrad@zemek.io> wrote:
>
> On Monday, October 25th, 2021 at 8:26 PM, Jun Hu <hujun.work@gmail.com> wrote:
>
> > On Mon, Oct 25, 2021 at 3:48 AM Toke Høiland-Jørgensen toke@redhat.com wrote:
> >
> > > Jun Hu hujun.work@gmail.com writes:
> > >
> > > > Hi,
> > > >
> > > > I want to put a timestamp in the egress packets, and I want to use
> > > >
> > > > AF_XDP socket for both sending and receiving packets; since a XDP
> > > >
> > > > kernel program only work in ingress direction, I wonder if I could use
> > > >
> > > > a tc kernel program to change a packet sent out via an AF_XDP socket?
> > > >
> > > > I searched around, but couldn't find any direct answer...
> > >
> > > Nope, AF_XDP bypasses the stack completely, so TC won't see the packet
> > >
> > > on egress...
> > >
> > > -Toke
> >
> > Ok, thanks for the clarification, I guess I have to wait for the XDP
> >
> > egress support ...
>
> You can also directly modify the packet that you send out through an AF_XDP socket, before putting it on the outgoing queue. Is there anything specific that you would want to do in an egress-attached BPF program that you would not be able to do in the userspace program that manages your AF_XDP socket?
>
> Konrad

Yes, that's what I am doing right now, however ideally I want to add a
timestamp to the packet as close as it egress the NIC; since AF_XDP
doesn't have access to hardware timestamp, that's why I was searching
for an alternative solution.

  reply	other threads:[~2021-10-26 18:34 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-10-21 22:41 AF_XDP socket TX path interact with TC? Jun Hu
2021-10-25 10:48 ` Toke Høiland-Jørgensen
2021-10-25 18:26   ` Jun Hu
2021-10-26 11:08     ` Konrad Zemek
2021-10-26 18:34       ` Jun Hu [this message]
2021-10-27 11:35         ` Toke Høiland-Jørgensen
2021-10-27 14:03           ` Jesper Dangaard Brouer
2021-10-27 15:48             ` Jun Hu

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='CAEM4-kBho+aUNNSAoGWWF-Ou=2QC+7b6OD6m+JixOHCcye9RFw@mail.gmail.com' \
    --to=hujun.work@gmail.com \
    --cc=konrad@zemek.io \
    --cc=toke@redhat.com \
    --cc=xdp-newbies@vger.kernel.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.