habanalabs/gaudi: do not set EB in collective slave queues
PATCH 1/1 habanalabs/gaudi: do not set EB in collective slave queues
From: Alon Mizrahi <[email protected]>
We don't need to set EB on signal packets from collective slave queues as it degrades performance. Because the slaves are the network queues, the engine barrier doesn't actually guarantee that the packet has been sent.
Signed-off-by Alon Mizrahi <[email protected]>
Reviewed-by Oded Gabbay <[email protected]>
Signed-off-by Oded Gabbay <[email protected]>
--- drivers/misc/habanalabs/common/habanalabs.h | 2 +- drivers/misc/habanalabs/common/hw_queue.c | 5 ++++- drivers/misc/habanalabs/gaudi/gaudi.c | 8 ++++---- drivers/misc/habanalabs/goya/goya.c | 2 +- 4 files changed, 10 insertions(+), 7 deletions(-)
drivers/misc/habanalabs/common/habanalabs.h +1 -1
@@ -944,7 +944,7 @@ struct hl_asic_funcs {u32 (*get_signal_cb_size)(struct hl_device *hdev);u32 (*get_wait_cb_size)(struct hl_device *hdev);u32 (*gen_signal_cb)(struct hl_device *hdev,void *data,u16 sob_id, -u32 size); +u32 size,bool eb);u32 (*gen_wait_cb)(struct hl_device *hdev,struct hl_gen_wait_properties *prop);void (*reset_sob)(struct hl_device *hdev,void *data);
drivers/misc/habanalabs/common/hw_queue.c +4 -1
@@ -418,8 +418,11 @@ static void init_signal_cs(struct hl_device *hdev,"generate signal CB, sob_id: %d, sob val: 0x%x, q_idx: %d\n" , cs_cmpl->hw_sob->sob_id, cs_cmpl->sob_val, q_idx); +/* we set an EB since we must make sure all oeprations are done +* when sending the signal +*/ hdev->asic_funcs->gen_signal_cb (hdev, job->patched_cb, - cs_cmpl->hw_sob->sob_id,0 ); + cs_cmpl->hw_sob->sob_id,0 , true);kref_get (&hw_sob->kref);
drivers/misc/habanalabs/gaudi/gaudi.c +4 -4
@@ -361,7 +361,7 @@ static int gaudi_cpucp_info_get(struct hl_device *hdev);static void gaudi_disable_clock_gating (struct hl_device *hdev);static void gaudi_mmu_prepare (struct hl_device *hdev,u32 asid);static u32 gaudi_gen_signal_cb (struct hl_device *hdev,void *data,u16 sob_id, -u32 size); +u32 size,bool eb);static u32 gaudi_gen_wait_cb (struct hl_device *hdev,struct hl_gen_wait_properties *prop);
@@ -1064,7 +1064,7 @@ static void gaudi_collective_slave_init_job(struct hl_device *hdev, prop->collective_sob_id, queue_id); cb_size +=gaudi_gen_signal_cb (hdev, job->user_cb, - prop->collective_sob_id, cb_size); + prop->collective_sob_id, cb_size, false); }static void gaudi_collective_wait_init_cs (struct hl_cs *cs)
@@ -7893,7 +7893,7 @@ static u32 gaudi_get_wait_cb_size(struct hl_device *hdev) }static u32 gaudi_gen_signal_cb (struct hl_device *hdev,void *data,u16 sob_id, -u32 size) +u32 size,bool eb) {struct hl_cb *cb = (struct hl_cb *) data;struct packet_msg_short *pkt;
@@ -7910,7 +7910,7 @@ static u32 gaudi_gen_signal_cb(struct hl_device *hdev, void *data, u16 sob_id, ctl |=FIELD_PREP (GAUDI_PKT_SHORT_CTL_OP_MASK ,0 );/* write the value */ ctl |=FIELD_PREP (GAUDI_PKT_SHORT_CTL_BASE_MASK ,3 );/* W_S SOB base */ ctl |=FIELD_PREP (GAUDI_PKT_SHORT_CTL_OPCODE_MASK ,PACKET_MSG_SHORT ); - ctl |=FIELD_PREP (GAUDI_PKT_SHORT_CTL_EB_MASK ,1 ); + ctl |=FIELD_PREP (GAUDI_PKT_SHORT_CTL_EB_MASK , eb); ctl |=FIELD_PREP (GAUDI_PKT_SHORT_CTL_RB_MASK ,1 ); ctl |=FIELD_PREP (GAUDI_PKT_SHORT_CTL_MB_MASK ,1 );
drivers/misc/habanalabs/goya/goya.c +1 -1
@@ -5339,7 +5339,7 @@ static u32 goya_get_wait_cb_size(struct hl_device *hdev) }static u32 goya_gen_signal_cb (struct hl_device *hdev,void *data,u16 sob_id, -u32 size) +u32 size,bool eb) {return 0 ; }
Signature · 1 line
2.17.1
PATCH 1/1 habanalabs: Revise comment to align with mirror list name
From: Tomer Tayar <[email protected]>
hw_queues_mirror was renamed to cs_mirror, so revise accordingly a comment that refers to this list.
Signed-off-by Tomer Tayar <[email protected]>
Reviewed-by Oded Gabbay <[email protected]>
Signed-off-by Oded Gabbay <[email protected]>
--- drivers/misc/habanalabs/common/command_submission.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/misc/habanalabs/common/command_submission.c +1 -1
@@ -562,7 +562,7 @@ void hl_cs_rollback_all(struct hl_device *hdev)for (i =0 ; i < hdev->asic_prop.completion_queues_count ; i++)flush_workqueue (hdev->cq_wq[i]); -/* Make sure we don't have leftovers in the H/W queues mirror list */ +/* Make sure we don't have leftovers in the CS mirror list */ list_for_each_entry_safe (cs, tmp, &hdev->cs_mirror_list, mirror_node) {cs_get (cs); cs->aborted = true;
Signature · 1 line
2.17.1