d3b61f4b7c
After memory optimization, some action object handles are changed to index to save the overhead. Assertion in debug mode will be helpful for trouble shooting. In the current implementation, only one port action is supported in switchdev mode for one device flow. In debug mode, an assertion will be used to check the if the port action is none, and it should locate before the port action resource registration but not after it. The action index in the handle should be 0 before registration. Or else it will always cause a failure because the port action is registered and the index is not 0. Fixes: f3faf9ea1185 ("net/mlx5: convert port id action to indexed") Signed-off-by: Bing Zhao <bingz@mellanox.com> Reviewed-by: Matan Azrad <matan@mellanox.com> Reviewed-by: Suanming Mou <suanmingm@mellanox.com> Acked-by: Viacheslav Ovsiienko <viacheslavo@mellanox.com>