From: Simon Horman <horms@kernel.org>
To: Larysa Zaremba <larysa.zaremba@intel.com>
Cc: intel-wired-lan@lists.osuosl.org,
Jacob Keller <jacob.e.keller@intel.com>,
maciej.fijalkowski@intel.com,
Magnus Karlsson <magnus.karlsson@gmail.com>,
Przemek Kitszel <przemyslaw.kitszel@intel.com>,
igor.bagnucki@intel.com, "David S. Miller" <davem@davemloft.net>,
Eric Dumazet <edumazet@google.com>,
Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
Alexei Starovoitov <ast@kernel.org>,
Daniel Borkmann <daniel@iogearbox.net>,
Jesper Dangaard Brouer <hawk@kernel.org>,
John Fastabend <john.fastabend@gmail.com>,
netdev@vger.kernel.org, linux-kernel@vger.kernel.org,
bpf@vger.kernel.org
Subject: Re: [PATCH iwl-net 2/3] ice: add flag to distinguish reset from .ndo_bpf in XDP rings config
Date: Thu, 16 May 2024 09:27:33 +0100 [thread overview]
Message-ID: <20240516082733.GD179178@kernel.org> (raw)
In-Reply-To: <20240515160246.5181-3-larysa.zaremba@intel.com>
On Wed, May 15, 2024 at 06:02:15PM +0200, Larysa Zaremba wrote:
> Commit 6624e780a577 ("ice: split ice_vsi_setup into smaller functions")
> has placed ice_vsi_free_q_vectors() after ice_destroy_xdp_rings() in
> the rebuild process. The behaviour of the XDP rings config functions is
> context-dependent, so the change of order has led to
> ice_destroy_xdp_rings() doing additional work and removing XDP prog, when
> it was supposed to be preserved.
>
> Also, dependency on the PF state reset flags creates an additional,
> fortunately less common problem:
>
> * PFR is requested e.g. by tx_timeout handler
> * .ndo_bpf() is asked to delete the program, calls ice_destroy_xdp_rings(),
> but reset flag is set, so rings are destroyed without deleting the
> program
> * ice_vsi_rebuild tries to delete non-existent XDP rings, because the
> program is still on the VSI
> * system crashes
>
> With a similar race, when requested to attach a program,
> ice_prepare_xdp_rings() can actually skip setting the program in the VSI
> and nevertheless report success.
>
> Instead of reverting to the old order of function calls, add an enum
> argument to both ice_prepare_xdp_rings() and ice_destroy_xdp_rings() in
> order to distinguish between calls from rebuild and .ndo_bpf().
>
> Fixes: efc2214b6047 ("ice: Add support for XDP")
> Reviewed-by: Igor Bagnucki <igor.bagnucki@intel.com>
> Signed-off-by: Larysa Zaremba <larysa.zaremba@intel.com>
Reviewed-by: Simon Horman <horms@kernel.org>
WARNING: multiple messages have this Message-ID (diff)
From: Simon Horman <horms@kernel.org>
To: Larysa Zaremba <larysa.zaremba@intel.com>
Cc: maciej.fijalkowski@intel.com,
Jesper Dangaard Brouer <hawk@kernel.org>,
Daniel Borkmann <daniel@iogearbox.net>,
Przemek Kitszel <przemyslaw.kitszel@intel.com>,
John Fastabend <john.fastabend@gmail.com>,
Alexei Starovoitov <ast@kernel.org>,
"David S. Miller" <davem@davemloft.net>,
Eric Dumazet <edumazet@google.com>,
intel-wired-lan@lists.osuosl.org, netdev@vger.kernel.org,
Jacob Keller <jacob.e.keller@intel.com>,
Jakub Kicinski <kuba@kernel.org>,
bpf@vger.kernel.org, Paolo Abeni <pabeni@redhat.com>,
Magnus Karlsson <magnus.karlsson@gmail.com>,
igor.bagnucki@intel.com, linux-kernel@vger.kernel.org
Subject: Re: [Intel-wired-lan] [PATCH iwl-net 2/3] ice: add flag to distinguish reset from .ndo_bpf in XDP rings config
Date: Thu, 16 May 2024 09:27:33 +0100 [thread overview]
Message-ID: <20240516082733.GD179178@kernel.org> (raw)
In-Reply-To: <20240515160246.5181-3-larysa.zaremba@intel.com>
On Wed, May 15, 2024 at 06:02:15PM +0200, Larysa Zaremba wrote:
> Commit 6624e780a577 ("ice: split ice_vsi_setup into smaller functions")
> has placed ice_vsi_free_q_vectors() after ice_destroy_xdp_rings() in
> the rebuild process. The behaviour of the XDP rings config functions is
> context-dependent, so the change of order has led to
> ice_destroy_xdp_rings() doing additional work and removing XDP prog, when
> it was supposed to be preserved.
>
> Also, dependency on the PF state reset flags creates an additional,
> fortunately less common problem:
>
> * PFR is requested e.g. by tx_timeout handler
> * .ndo_bpf() is asked to delete the program, calls ice_destroy_xdp_rings(),
> but reset flag is set, so rings are destroyed without deleting the
> program
> * ice_vsi_rebuild tries to delete non-existent XDP rings, because the
> program is still on the VSI
> * system crashes
>
> With a similar race, when requested to attach a program,
> ice_prepare_xdp_rings() can actually skip setting the program in the VSI
> and nevertheless report success.
>
> Instead of reverting to the old order of function calls, add an enum
> argument to both ice_prepare_xdp_rings() and ice_destroy_xdp_rings() in
> order to distinguish between calls from rebuild and .ndo_bpf().
>
> Fixes: efc2214b6047 ("ice: Add support for XDP")
> Reviewed-by: Igor Bagnucki <igor.bagnucki@intel.com>
> Signed-off-by: Larysa Zaremba <larysa.zaremba@intel.com>
Reviewed-by: Simon Horman <horms@kernel.org>
next prev parent reply other threads:[~2024-05-16 8:27 UTC|newest]
Thread overview: 27+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-05-15 16:02 [PATCH iwl-net 0/3] Fix AF_XDP problems after changing queue number Larysa Zaremba
2024-05-15 16:02 ` [Intel-wired-lan] " Larysa Zaremba
2024-05-15 16:02 ` [PATCH iwl-net 1/3] ice: remove af_xdp_zc_qps bitmap Larysa Zaremba
2024-05-15 16:02 ` [Intel-wired-lan] " Larysa Zaremba
2024-05-16 8:27 ` Simon Horman
2024-05-16 8:27 ` [Intel-wired-lan] " Simon Horman
2024-05-30 5:53 ` Rout, ChandanX
2024-05-30 5:53 ` Rout, ChandanX
2024-05-15 16:02 ` [PATCH iwl-net 2/3] ice: add flag to distinguish reset from .ndo_bpf in XDP rings config Larysa Zaremba
2024-05-15 16:02 ` [Intel-wired-lan] " Larysa Zaremba
2024-05-16 8:27 ` Simon Horman [this message]
2024-05-16 8:27 ` Simon Horman
2024-05-16 10:00 ` Sergey Temerkhanov
2024-05-16 10:00 ` [Intel-wired-lan] " Sergey Temerkhanov
2024-05-30 5:55 ` Rout, ChandanX
2024-05-30 5:55 ` Rout, ChandanX
2024-05-15 16:02 ` [PATCH iwl-net 3/3] ice: map XDP queues to vectors in ice_vsi_map_rings_to_vectors() Larysa Zaremba
2024-05-15 16:02 ` [Intel-wired-lan] " Larysa Zaremba
2024-05-16 8:27 ` Simon Horman
2024-05-16 8:27 ` [Intel-wired-lan] " Simon Horman
2024-05-16 11:43 ` Larysa Zaremba
2024-05-16 11:43 ` [Intel-wired-lan] " Larysa Zaremba
2024-05-16 11:59 ` Simon Horman
2024-05-16 11:59 ` [Intel-wired-lan] " Simon Horman
2024-05-16 17:12 ` Jacob Keller
2024-05-30 5:57 ` Rout, ChandanX
2024-05-30 5:57 ` Rout, ChandanX
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=20240516082733.GD179178@kernel.org \
--to=horms@kernel.org \
--cc=ast@kernel.org \
--cc=bpf@vger.kernel.org \
--cc=daniel@iogearbox.net \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=hawk@kernel.org \
--cc=igor.bagnucki@intel.com \
--cc=intel-wired-lan@lists.osuosl.org \
--cc=jacob.e.keller@intel.com \
--cc=john.fastabend@gmail.com \
--cc=kuba@kernel.org \
--cc=larysa.zaremba@intel.com \
--cc=linux-kernel@vger.kernel.org \
--cc=maciej.fijalkowski@intel.com \
--cc=magnus.karlsson@gmail.com \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=przemyslaw.kitszel@intel.com \
/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.