All of lore.kernel.org
 help / color / mirror / Atom feed
From: Maxim Mikityanskiy <maximmi@mellanox.com>
To: Maciej Fijalkowski <maciej.fijalkowski@intel.com>, daniel@iogearbox.net
Cc: ast@kernel.org, netdev@vger.kernel.org, bpf@vger.kernel.org,
	bjorn.topel@intel.com, magnus.karlsson@intel.com
Subject: Re: [PATCH bpf 0/3] XSK related fixes
Date: Thu, 6 Feb 2020 15:58:17 +0200	[thread overview]
Message-ID: <d843052f-e0a5-7a8c-da65-7cb15c274483@mellanox.com> (raw)
In-Reply-To: <20200205045834.56795-1-maciej.fijalkowski@intel.com>

On 2020-02-05 06:58, Maciej Fijalkowski wrote:
> Cameron reported [0] that on fresh bpf-next he could not run multiple
> xdpsock instances in Tx-only mode on single network interface with i40e
> driver.
> 
> Turns out that Maxim's series [1] which was adding RCU protection around
> ndo_xsk_wakeup added check against the __I40E_CONFIG_BUSY being set on
> pf->state within i40e_xsk_wakeup() - if it's set, return -ENETDOWN.
> Since this bit is set per PF when UMEM is being enabled/disabled, the
> situation Cameron stumbled upon was that when he launched second xdpsock
> instance, second UMEM was being registered, hence set __I40E_CONFIG_BUSY
> which is now observed by first xdpsock and therefore xdpsock's kick_tx()
> gets -ENETDOWN as errno.
> 
> -ENETDOWN currently is not allowed in kick_tx(), so we were exiting the
> first application. Such exit means also XDP program being unloaded and
> its dedicated resources, which caused an -ENXIO being return in the
> second xdpsock instance.
> 
> Let's fix the issue from both sides - protect ourselves from future
> xdpsock crashes by allowing for -ENETDOWN errno being set in kick_tx()
> (patch 3) and from driver side, return -EAGAIN for the case where PF is
> busy (patch 1).
> 
> Remove also doubled variable from xdpsock_user.c (patch 2).
> 
> Note that ixgbe seems not to be affected since UMEM registration sets
> the busy/disable bit per ring, not per PF.
> 
> Thanks!
> Maciej
> 
> [0]: https://www.spinics.net/lists/xdp-newbies/msg01558.html
> [1]: https://lore.kernel.org/netdev/20191217162023.16011-1-maximmi@mellanox.com/
> 
> Maciej Fijalkowski (3):
>    i40e: Relax i40e_xsk_wakeup's return value when PF is busy
>    samples: bpf: drop doubled variable declaration in xdpsock
>    samples: bpf: allow for -ENETDOWN in xdpsock
> 
>   drivers/net/ethernet/intel/i40e/i40e_xsk.c | 2 +-
>   samples/bpf/xdpsock_user.c                 | 4 ++--
>   2 files changed, 3 insertions(+), 3 deletions(-)
> 

Acked-by: Maxim Mikityanskiy <maximmi@mellanox.com>

Though it's already merged (that was too fast).

      parent reply	other threads:[~2020-02-06 13:58 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-02-05  4:58 [PATCH bpf 0/3] XSK related fixes Maciej Fijalkowski
2020-02-05  4:58 ` [PATCH bpf 1/3] i40e: Relax i40e_xsk_wakeup's return value when PF is busy Maciej Fijalkowski
2020-02-05  4:58 ` [PATCH bpf 2/3] samples: bpf: drop doubled variable declaration in xdpsock Maciej Fijalkowski
2020-02-05  4:58 ` [PATCH bpf 3/3] samples: bpf: allow for -ENETDOWN " Maciej Fijalkowski
2020-02-05 21:21 ` [PATCH bpf 0/3] XSK related fixes Daniel Borkmann
2020-02-06 13:58 ` Maxim Mikityanskiy [this message]

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=d843052f-e0a5-7a8c-da65-7cb15c274483@mellanox.com \
    --to=maximmi@mellanox.com \
    --cc=ast@kernel.org \
    --cc=bjorn.topel@intel.com \
    --cc=bpf@vger.kernel.org \
    --cc=daniel@iogearbox.net \
    --cc=maciej.fijalkowski@intel.com \
    --cc=magnus.karlsson@intel.com \
    --cc=netdev@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.