netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Kal Cutter Conley <kal.conley@dectris.com>
To: Jonathan Lemon <jonathan.lemon@gmail.com>
Cc: Saeed Mahameed <saeedm@mellanox.com>,
	"brouer@redhat.com" <brouer@redhat.com>,
	Maxim Mikityanskiy <maximmi@mellanox.com>,
	"magnus.karlsson@intel.com" <magnus.karlsson@intel.com>,
	"toke.hoiland-jorgensen@kau.se" <toke.hoiland-jorgensen@kau.se>,
	"xdp-newbies@vger.kernel.org" <xdp-newbies@vger.kernel.org>,
	Tariq Toukan <tariqt@mellanox.com>,
	"gospo@broadcom.com" <gospo@broadcom.com>,
	"netdev@vger.kernel.org" <netdev@vger.kernel.org>,
	"bjorn.topel@intel.com" <bjorn.topel@intel.com>
Subject: Re: net/mlx5e: bind() always returns EINVAL with XDP_ZEROCOPY
Date: Sat, 20 Jun 2020 12:42:36 +0200	[thread overview]
Message-ID: <CAHApi-kMwnvRwJO8LT2UtrixVSd_bDgWybOP6H_eLTBmSFsd4A@mail.gmail.com> (raw)
In-Reply-To: <20200618150347.ihtdvsfuurgfka7i@bsd-mbp.dhcp.thefacebook.com>

On Thu, Jun 18, 2020 at 5:23 PM Jonathan Lemon <jonathan.lemon@gmail.com> wrote:
>
> On Sun, Jun 14, 2020 at 10:55:30AM +0200, Kal Cutter Conley wrote:
> > Hi Saeed,
> > Thanks for explaining the reasoning behind the special mlx5 queue
> > numbering with XDP zerocopy.
> >
> > We have a process using AF_XDP that also shares the network interface
> > with other processes on the system. ethtool rx flow classification
> > rules are used to route the traffic to the appropriate XSK queue
> > N..(2N-1). The issue is these queues are only valid as long they are
> > active (as far as I can tell). This means if my AF_XDP process dies
> > other processes no longer receive ingress traffic routed over queues
> > N..(2N-1) even though my XDP program is still loaded and would happily
> > always return XDP_PASS. Other drivers do not have this usability issue
> > because they use queues that are always valid. Is there a simple
> > workaround for this issue? It seems to me queues N..(2N-1) should
> > simply map to 0..(N-1) when they are not active?
>
> If your XDP program returns XDP_PASS, the packet should be delivered to
> the xsk socket.  If the application isn't running, where would it go?
>
> I do agree that the usability of this can be improved.  What if the flow
> rules are inserted and removed along with queue creatioin/destruction?

I think I misunderstood your suggestion here. Do you mean the rules
should be inserted / removed on the hardware level but still show in
ethtool even if they are not active in the hardware? In this case the
rules always occupy a "location" but just never apply if the
respective queues are not "enabled". I think this would be the best
possible solution.

> --
> Jonathan

Kal

  parent reply	other threads:[~2020-06-20 10:42 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <CAHApi-mMi2jYAOCrGhpkRVybz0sDpOSkLFCZfVe-2wOcAO_MqQ@mail.gmail.com>
     [not found] ` <CAHApi-=YSo=sOTkRxmY=fct3TePFFdG9oPTRHWYd1AXjk0ACfw@mail.gmail.com>
2019-09-02  9:08   ` net/mlx5e: bind() always returns EINVAL with XDP_ZEROCOPY Jesper Dangaard Brouer
2019-09-03 20:19     ` Saeed Mahameed
2020-06-14  8:55       ` Kal Cutter Conley
2020-06-18 15:23         ` Jonathan Lemon
2020-06-18 17:31           ` Kal Cutter Conley
2020-06-20 10:42           ` Kal Cutter Conley [this message]
2020-06-20 18:42             ` Jonathan Lemon
2020-06-21 10:03               ` Kal Cutter Conley
2020-06-21 19:20                 ` Jonathan Lemon

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=CAHApi-kMwnvRwJO8LT2UtrixVSd_bDgWybOP6H_eLTBmSFsd4A@mail.gmail.com \
    --to=kal.conley@dectris.com \
    --cc=bjorn.topel@intel.com \
    --cc=brouer@redhat.com \
    --cc=gospo@broadcom.com \
    --cc=jonathan.lemon@gmail.com \
    --cc=magnus.karlsson@intel.com \
    --cc=maximmi@mellanox.com \
    --cc=netdev@vger.kernel.org \
    --cc=saeedm@mellanox.com \
    --cc=tariqt@mellanox.com \
    --cc=toke.hoiland-jorgensen@kau.se \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).