Skip to content

Commit

Permalink
ON-16158: Allow alloc of shared HW EVQ without TXQ
Browse files Browse the repository at this point in the history
Expose ef10ct_alloc/free_evq to allocate an evq directly rather than
going through efhw_nic_vi_alloc and also allocating a txq along the way.
  • Loading branch information
ligallag-amd committed Nov 29, 2024
1 parent d6d5cde commit b0e16eb
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 10 deletions.
3 changes: 3 additions & 0 deletions src/include/ci/efhw/ef10ct.h
Original file line number Diff line number Diff line change
Expand Up @@ -56,4 +56,7 @@ struct efhw_nic_ef10ct {
struct dentry* debug_dir;
};

int ef10ct_alloc_evq(struct efhw_nic *nic);
void ef10ct_free_evq(struct efhw_nic *nic, int evq);

#endif /* CI_EFHW_EF10CT_H */
11 changes: 3 additions & 8 deletions src/lib/efhw/ef10ct/aux_ef10ct.c
Original file line number Diff line number Diff line change
Expand Up @@ -178,13 +178,8 @@ static int ef10ct_nic_init_shared_evq(struct efhw_nic *nic, int qid)
struct efhw_evq_params params = {};
int vi, rc;
struct ef10ct_shared_kernel_evq *shared_evq = &ef10ct->shared[qid];
struct efhw_vi_constraints evc = {
.want_txq = true, /* Setting `want_txq` will give us a real evq/vi */
/* Other fields are ignored for ef10ct */
};

/* FIXME EF10CT check assumption here about qid */
vi = efhw_nic_vi_alloc(nic, &evc, 1);
vi = ef10ct_alloc_evq(nic);
if(vi < 0) {
rc = vi;
goto fail1;
Expand Down Expand Up @@ -232,7 +227,7 @@ static int ef10ct_nic_init_shared_evq(struct efhw_nic *nic, int qid)
fail3:
put_page(page);
fail2:
efhw_nic_vi_free(nic, vi, 1);
ef10ct_free_evq(nic, vi);
fail1:
return rc;
}
Expand All @@ -249,7 +244,7 @@ static void ef10ct_nic_free_shared_evq(struct efhw_nic *nic, int qid)
/* Neither client_id nor time_sync_events_enabled are used for ef10ct */
efhw_nic_event_queue_disable(nic, shared_evq->vi, 0);

efhw_nic_vi_free(nic, shared_evq->vi, 1);
ef10ct_free_evq(nic, shared_evq->vi);
put_page(shared_evq->page);

/* Just to be safe */
Expand Down
4 changes: 2 additions & 2 deletions src/lib/efhw/ef10ct/ef10ct.c
Original file line number Diff line number Diff line change
Expand Up @@ -322,7 +322,7 @@ ef10ct_nic_wakeup_request(struct efhw_nic *nic, volatile void __iomem* io_page,
{
}

static int ef10ct_alloc_evq(struct efhw_nic *nic)
int ef10ct_alloc_evq(struct efhw_nic *nic)
{
struct efx_auxdev_client* cli;
struct efx_auxdev* edev;
Expand All @@ -336,7 +336,7 @@ static int ef10ct_alloc_evq(struct efhw_nic *nic)
return evq;
}

static void ef10ct_free_evq(struct efhw_nic *nic, int evq)
void ef10ct_free_evq(struct efhw_nic *nic, int evq)
{
struct efx_auxdev_client* cli;
struct efx_auxdev* edev;
Expand Down

0 comments on commit b0e16eb

Please sign in to comment.