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
622622 struct mlx5_sq_bfreg bfreg;
623623 };
624624
625+enum mlx5_sw_icm_type {
626+ MLX5_SW_ICM_TYPE_STEERING,
627+ MLX5_SW_ICM_TYPE_HEADER_MODIFY,
628+};
629+
625630 #define MLX5_MAX_RESERVED_GIDS 8
626631
627632 struct mlx5_rsvd_gids {
@@ -653,10 +658,14 @@ struct mlx5_clock { · 25 unmodified lines
653658 struct mlx5_pps pps_info;
654659 };
655660
661+struct mlx5_dm;
656662 struct mlx5_fw_tracer;
657663 struct mlx5_vxlan;
658664 struct mlx5_geneve;
659665
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+
660669 struct mlx5_core_dev {
661670 struct device *device;
662671 enum mlx5_coredev_type coredev_type;
@@ -690,6 +699,7 @@ struct mlx5_core_dev { · 27 unmodified lines
690699 atomic_t num_qps;
691700 u32 issi;
692701 struct mlx5e_resources mlx5e_res;
702+ struct mlx5_dm *dm;
693703 struct mlx5_vxlan *vxlan;
694704 struct mlx5_geneve *geneve;
695705 struct {
@@ -1072,6 +1082,10 @@ int mlx5_lag_query_cong_counters(struct mlx5_core_dev *dev, · 376 unmodified lines
10721082 size_t *offsets);
10731083 struct mlx5_uars_page *mlx5_get_uars_page(struct mlx5_core_dev *mdev);
10741084 void mlx5_put_uars_page(struct mlx5_core_dev *mdev, struct mlx5_uars_page *up);
1085+int 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);
1087+int 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);
10751089
10761090 #ifdef CONFIG_MLX5_CORE_IPOIB
10771091 struct 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