net: mana: Add support for auxiliary device servicing events
Handle soc servicing events which require the rdma auxiliary device resources to be cleaned up during a suspend, and re-initialized during a resume. Signed-off-by: Shiraz Saleem <shirazsaleem@microsoft.com> Signed-off-by: Konstantin Taranov <kotaranov@microsoft.com> Link: https://patch.msgid.link/1746633545-17653-5-git-send-email-kotaranov@linux.microsoft.com Signed-off-by: Leon Romanovsky <leon@kernel.org>
This commit is contained in:
committed by
Leon Romanovsky
parent
d4293f96ce
commit
505cc26bca
@@ -60,6 +60,7 @@ enum gdma_eqe_type {
|
||||
GDMA_EQE_HWC_INIT_DONE = 131,
|
||||
GDMA_EQE_HWC_SOC_RECONFIG = 132,
|
||||
GDMA_EQE_HWC_SOC_RECONFIG_DATA = 133,
|
||||
GDMA_EQE_HWC_SOC_SERVICE = 134,
|
||||
GDMA_EQE_RNIC_QP_FATAL = 176,
|
||||
};
|
||||
|
||||
@@ -70,6 +71,18 @@ enum {
|
||||
GDMA_DEVICE_MANA_IB = 3,
|
||||
};
|
||||
|
||||
enum gdma_service_type {
|
||||
GDMA_SERVICE_TYPE_NONE = 0,
|
||||
GDMA_SERVICE_TYPE_RDMA_SUSPEND = 1,
|
||||
GDMA_SERVICE_TYPE_RDMA_RESUME = 2,
|
||||
};
|
||||
|
||||
struct mana_service_work {
|
||||
struct work_struct work;
|
||||
struct gdma_dev *gdma_dev;
|
||||
enum gdma_service_type event;
|
||||
};
|
||||
|
||||
struct gdma_resource {
|
||||
/* Protect the bitmap */
|
||||
spinlock_t lock;
|
||||
@@ -224,6 +237,8 @@ struct gdma_dev {
|
||||
void *driver_data;
|
||||
|
||||
struct auxiliary_device *adev;
|
||||
bool is_suspended;
|
||||
bool rdma_teardown;
|
||||
};
|
||||
|
||||
/* MANA_PAGE_SIZE is the DMA unit */
|
||||
@@ -409,6 +424,8 @@ struct gdma_context {
|
||||
struct gdma_dev mana_ib;
|
||||
|
||||
u64 pf_cap_flags1;
|
||||
|
||||
struct workqueue_struct *service_wq;
|
||||
};
|
||||
|
||||
static inline bool mana_gd_is_mana(struct gdma_dev *gd)
|
||||
@@ -891,4 +908,6 @@ int mana_gd_destroy_dma_region(struct gdma_context *gc, u64 dma_region_handle);
|
||||
void mana_register_debugfs(void);
|
||||
void mana_unregister_debugfs(void);
|
||||
|
||||
int mana_rdma_service_event(struct gdma_context *gc, enum gdma_service_type event);
|
||||
|
||||
#endif /* _GDMA_H */
|
||||
|
||||
@@ -49,6 +49,15 @@ union hwc_init_type_data {
|
||||
};
|
||||
}; /* HW DATA */
|
||||
|
||||
union hwc_init_soc_service_type {
|
||||
u32 as_uint32;
|
||||
|
||||
struct {
|
||||
u32 value : 28;
|
||||
u32 type : 4;
|
||||
};
|
||||
}; /* HW DATA */
|
||||
|
||||
struct hwc_rx_oob {
|
||||
u32 type : 6;
|
||||
u32 eom : 1;
|
||||
|
||||
Reference in New Issue
Block a user