All of lore.kernel.org
 help / color / mirror / Atom feed
From: Magnus Karlsson <magnus.karlsson@gmail.com>
To: Srivats P <pstavirs@gmail.com>
Cc: Xdp <xdp-newbies@vger.kernel.org>
Subject: Re: AF_XDP sendto kick returning EPERM
Date: Tue, 27 Apr 2021 09:28:11 +0200	[thread overview]
Message-ID: <CAJ8uoz1pwuJ0A+C6wBnSG76Q4j4-BrvDKvKc3gHVCJA=71oJgw@mail.gmail.com> (raw)
In-Reply-To: <CANzUK58=fjW-iqBqm6drSfC679T0C+68bRj8BzxqrTYWAzDHJg@mail.gmail.com>

On Fri, Apr 23, 2021 at 5:44 PM Srivats P <pstavirs@gmail.com> wrote:
>
> Hi,
>
> I'm using sendto() to kick tx in my AF_XDP program after I submit
> descriptors to the tx ring -
>
> ret = sendto(xsk_socket__fd(xsk_), NULL, 0, MSG_DONTWAIT, NULL, 0);
>
> However, I'm receiving EPERM as the return value every time. AFAIK
> this is not an expected return value. Since this is with i40e, I
> checked i40e_xsk_wakeup() - but that also doesn't return EPERM. I am
> running as root and I don't see any problems with creating the xsk,
> configuring umem etc.
>
> Also, no packets seem to go out either.
>
> # uname -a
> Linux Ostinato-1 5.11.15-1-default #1 SMP Fri Apr 16 16:47:34 UTC 2021
> (64fb5bf) x86_64 x86_64 x86_64 GNU/Linux
>
> I don't see the problem on another machine with i40e but older kernel 5.4 series
>
> Any suggestions on what to look for or how to proceed?

Weird. Have not seen this before. What is your command line for
xdpsock? Is it unmodified?

Using bpftrace, we can get the call stack of xsk_sendmsg. Somewhere in
this stack there must be an EPERM. You can run the same command on
your system, but use ftrace to see what a sendto call hits. Then see
where the code terminates.

mkarlsso@kurt:~/src/dna-linux$ sudo bpftrace -e 'kprobe:xsk_sendmsg {
@[kstack()] = count(); }'
Attaching 1 probe...
^C

@[
    xsk_sendmsg+1
    sock_sendmsg+94
    __sys_sendto+238
    __x64_sys_sendto+37
    do_syscall_64+51
    entry_SYSCALL_64_after_hwframe+68
]: 2244805


> Srivats

  reply	other threads:[~2021-04-27  7:28 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-04-23 15:44 AF_XDP sendto kick returning EPERM Srivats P
2021-04-27  7:28 ` Magnus Karlsson [this message]
2021-04-29 15:47   ` Srivats P
2021-05-03  8:24     ` Magnus Karlsson
2021-05-07 14:47       ` Srivats P
2021-05-07 15:09         ` Srivats P
2021-05-09 15:41           ` Maciej Fijalkowski
2021-05-11 12:02             ` Srivats P

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='CAJ8uoz1pwuJ0A+C6wBnSG76Q4j4-BrvDKvKc3gHVCJA=71oJgw@mail.gmail.com' \
    --to=magnus.karlsson@gmail.com \
    --cc=pstavirs@gmail.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.