[PATCH] failsafe: fix segfault on hotplug event
Stephen Hemminger
stephen at networkplumber.org
Wed Nov 16 23:25:48 CET 2022
On Wed, 16 Nov 2022 16:51:59 -0500
Luc Pelletier <lucp.at.work at gmail.com> wrote:
> Hi Konstantin,
>
> > It is not recommended way to update rte_eth_fp_ops[] contents directly.
> > There are eth_dev_fp_ops_setup()/ eth_dev_fp_ops_reset() that supposed
> > to be used for that.
>
> Good to know. I see another fix that was made in a different PMD that
> does exactly the same thing:
>
> https://github.com/DPDK/dpdk/commit/bcd68b68415172815e55fc67cf3947c0433baf74
>
> CC'ing the authors for awareness.
>
> > About the fix itself - while it might help till some extent,
> > I think it will not remove the problem completely.
> > There still remain a race-condition between rte_eth_rx_burst() and failsafe_eth_rmv_event_callback().
> > Right now DPDK doesn't support switching PMD fast-ops functions (or updating rxq/txq data)
> > on the fly.
>
> Thanks for the information. This is very helpful.
>
> Are you saying that the previous code also had that same race
> condition? It was only updating the rte_eth_dev structure, but I
> assume the problem would have been the same since rte_eth_rx_burst()
> in DPDK versions <=20 use the function pointers in rte_eth_dev, not
> rte_eth_fp_ops.
>
> Can you think of a possible solution to this problem? I'm happy to
> provide a patch to properly fix the problem. Having your guidance
> would be extremely helpful.
>
> Thanks!
Changing burst mode on a running device is not safe because
of lack of locking and/or memory barriers.
Would have been better to not to do this optimization.
Just have one rx_burst/tx_burst function and look at what
ever conditions are present there.
More information about the dev
mailing list