net/mlx5: optimize device spawn time with representors
authorJiawei Wang <jiaweiw@nvidia.com>
Wed, 27 Oct 2021 10:35:10 +0000 (13:35 +0300)
committerRaslan Darawsheh <rasland@nvidia.com>
Wed, 27 Oct 2021 12:04:39 +0000 (14:04 +0200)
commit3c4338a421344d9671adc26f6e92949169276c47
treefcd2d177703a54b05cd6e0c023100e7e42e07483
parent53712685d73d3d2c8a7e0948227de86f52652b5e
net/mlx5: optimize device spawn time with representors

During the device spawn process, mlx5 PMD queried the available flow
priorities by calling mlx5_flow_discover_priorities, queried
if the DR drop action was supported on the root table by calling
the mlx5_flow_discover_dr_action_support routine, and queried the
availability of metadata register C by calling mlx5_flow_discover_mreg_c

These functions created the test flows to get the supported fields, and
at the end destroyed the test flows. The test flows in the first two
functions was created on the root table.
If the device was spawned with multiple representors, these test flows
were created and destroyed on each representor as well. The above
operations took a significant amount of init time during the device
spawn.

This patch optimizes the device discover functions, if there is
the device with multiple representors (VF/SF) being spawned,
the priority and drop action and metadata register support check can be
done only ones and check results can be shared for all representors.

Signed-off-by: Jiawei Wang <jiaweiw@nvidia.com>
Acked-by: Viacheslav Ovsiienko <viacheslavo@nvidia.com>
drivers/net/mlx5/linux/mlx5_os.c
drivers/net/mlx5/mlx5.h
drivers/net/mlx5/mlx5_flow.c
drivers/net/mlx5/mlx5_flow_verbs.c
drivers/net/mlx5/windows/mlx5_os.c