Skip to content

Commit

Permalink
net/mlx5: disable config restore
Browse files Browse the repository at this point in the history
mlx5 PMD does not require configuration restore
on rte_eth_dev_start().
Add implementation of get_restore_flags() indicating that.

Signed-off-by: Dariusz Sosnowski <dsosnowski@nvidia.com>
Acked-by: Ferruh Yigit <ferruh.yigit@amd.com>
  • Loading branch information
sodar authored and ferruhy committed Oct 11, 2024
1 parent e14495c commit 89cedad
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 0 deletions.
2 changes: 2 additions & 0 deletions drivers/net/mlx5/mlx5.c
Original file line number Diff line number Diff line change
Expand Up @@ -2571,6 +2571,7 @@ const struct eth_dev_ops mlx5_dev_ops = {
.count_aggr_ports = mlx5_count_aggr_ports,
.map_aggr_tx_affinity = mlx5_map_aggr_tx_affinity,
.rx_metadata_negotiate = mlx5_flow_rx_metadata_negotiate,
.get_restore_flags = mlx5_get_restore_flags,
};

/* Available operations from secondary process. */
Expand Down Expand Up @@ -2663,6 +2664,7 @@ const struct eth_dev_ops mlx5_dev_ops_isolate = {
.get_monitor_addr = mlx5_get_monitor_addr,
.count_aggr_ports = mlx5_count_aggr_ports,
.map_aggr_tx_affinity = mlx5_map_aggr_tx_affinity,
.get_restore_flags = mlx5_get_restore_flags,
};

/**
Expand Down
2 changes: 2 additions & 0 deletions drivers/net/mlx5/mlx5.h
Original file line number Diff line number Diff line change
Expand Up @@ -2228,6 +2228,8 @@ eth_rx_burst_t mlx5_select_rx_function(struct rte_eth_dev *dev);
struct mlx5_priv *mlx5_port_to_eswitch_info(uint16_t port, bool valid);
struct mlx5_priv *mlx5_dev_to_eswitch_info(struct rte_eth_dev *dev);
int mlx5_dev_configure_rss_reta(struct rte_eth_dev *dev);
uint64_t mlx5_get_restore_flags(struct rte_eth_dev *dev,
enum rte_eth_dev_operation op);

/* mlx5_ethdev_os.c */

Expand Down
18 changes: 18 additions & 0 deletions drivers/net/mlx5/mlx5_ethdev.c
Original file line number Diff line number Diff line change
Expand Up @@ -796,3 +796,21 @@ mlx5_hairpin_cap_get(struct rte_eth_dev *dev, struct rte_eth_hairpin_cap *cap)
cap->tx_cap.rte_memory = hca_attr->hairpin_sq_wq_in_host_mem;
return 0;
}

/**
* Indicate to ethdev layer, what configuration must be restored.
*
* @param[in] dev
* Pointer to Ethernet device structure.
* @param[in] op
* Type of operation which might require.
* @param[out] flags
* Restore flags will be stored here.
*/
uint64_t
mlx5_get_restore_flags(__rte_unused struct rte_eth_dev *dev,
__rte_unused enum rte_eth_dev_operation op)
{
/* mlx5 PMD does not require any configuration restore. */
return 0;
}

0 comments on commit 89cedad

Please sign in to comment.