History

net/mlx5: Move device memory management to mlx5_core

Move the device memory allocation and deallocation commands SW ICM memory to mlx5_core to expose this API for all mlx5_core users. This comes as preparation for supporting SW steering in kernel where it will be required to allocate and register device memory for direct rule insertion. In addition, an API to register this device memory for future remote access operations is introduced using the create_mkey commands.

Ariel Levkovich committed 7 years ago

Commit c9b9dcb1 parent 00679b69 files · +276 −209Browse files

Showing the changes to include/linux (1 of 9 files). Show all

Unified · Split

include/linux/mlx5/driver.h+14−0
@@ -622,6 +622,11 @@ struct mlx5e_resources { · 621 unmodified lines
622 struct mlx5_sq_bfreg bfreg;622 struct mlx5_sq_bfreg bfreg;
623};623};
624 624
625enum mlx5_sw_icm_type {
626 MLX5_SW_ICM_TYPE_STEERING,
627 MLX5_SW_ICM_TYPE_HEADER_MODIFY,
628};
629
625#define MLX5_MAX_RESERVED_GIDS 8630#define MLX5_MAX_RESERVED_GIDS 8
626 631
627struct mlx5_rsvd_gids {632struct mlx5_rsvd_gids {
@@ -653,10 +658,14 @@ struct mlx5_clock { · 25 unmodified lines
653 struct mlx5_pps pps_info;658 struct mlx5_pps pps_info;
654};659};
655 660
661struct mlx5_dm;
656struct mlx5_fw_tracer;662struct mlx5_fw_tracer;
657struct mlx5_vxlan;663struct mlx5_vxlan;
658struct mlx5_geneve;664struct mlx5_geneve;
659 665
666#define MLX5_LOG_SW_ICM_BLOCK_SIZE(dev) (MLX5_CAP_DEV_MEM(dev, log_sw_icm_alloc_granularity))
667#define MLX5_SW_ICM_BLOCK_SIZE(dev) (1 << MLX5_LOG_SW_ICM_BLOCK_SIZE(dev))
668
660struct mlx5_core_dev {669struct mlx5_core_dev {
661 struct device *device;670 struct device *device;
662 enum mlx5_coredev_type coredev_type;671 enum mlx5_coredev_type coredev_type;
@@ -690,6 +699,7 @@ struct mlx5_core_dev { · 27 unmodified lines
690 atomic_t num_qps;699 atomic_t num_qps;
691 u32 issi;700 u32 issi;
692 struct mlx5e_resources mlx5e_res;701 struct mlx5e_resources mlx5e_res;
702 struct mlx5_dm *dm;
693 struct mlx5_vxlan *vxlan;703 struct mlx5_vxlan *vxlan;
694 struct mlx5_geneve *geneve;704 struct mlx5_geneve *geneve;
695 struct {705 struct {
@@ -1072,6 +1082,10 @@ int mlx5_lag_query_cong_counters(struct mlx5_core_dev *dev, · 376 unmodified lines
1072 size_t *offsets);1082 size_t *offsets);
1073struct mlx5_uars_page *mlx5_get_uars_page(struct mlx5_core_dev *mdev);1083struct mlx5_uars_page *mlx5_get_uars_page(struct mlx5_core_dev *mdev);
1074void mlx5_put_uars_page(struct mlx5_core_dev *mdev, struct mlx5_uars_page *up);1084void mlx5_put_uars_page(struct mlx5_core_dev *mdev, struct mlx5_uars_page *up);
1085int mlx5_dm_sw_icm_alloc(struct mlx5_core_dev *dev, enum mlx5_sw_icm_type type,
1086 u64 length, u16 uid, phys_addr_t *addr, u32 *obj_id);
1087int mlx5_dm_sw_icm_dealloc(struct mlx5_core_dev *dev, enum mlx5_sw_icm_type type,
1088 u64 length, u16 uid, phys_addr_t addr, u32 obj_id);
1075 1089
1076#ifdef CONFIG_MLX5_CORE_IPOIB1090#ifdef CONFIG_MLX5_CORE_IPOIB
1077struct net_device *mlx5_rdma_netdev_alloc(struct mlx5_core_dev *mdev,1091struct net_device *mlx5_rdma_netdev_alloc(struct mlx5_core_dev *mdev,

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t