Skip to content

Commit

Permalink
ON-16158: [aux_ef10ct] rename vi to evq_id
Browse files Browse the repository at this point in the history
In struct ef10ct_shared_kernel_evq, rename vi to evq_id to avoid
confusion.
  • Loading branch information
ligallag-amd committed Nov 29, 2024
1 parent b0e16eb commit 7011ed0
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 14 deletions.
2 changes: 1 addition & 1 deletion src/include/ci/efhw/ef10ct.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ struct efhw_nic_ef10ct_rxq {
};

struct ef10ct_shared_kernel_evq {
int vi;
int evq_id;
struct efhw_nic_ef10ct_evq *evq;
struct page *page;
/* Some kind of interrupt stuff? */
Expand Down
24 changes: 12 additions & 12 deletions src/lib/efhw/ef10ct/aux_ef10ct.c
Original file line number Diff line number Diff line change
Expand Up @@ -176,17 +176,17 @@ static int ef10ct_nic_init_shared_evq(struct efhw_nic *nic, int qid)
dma_addr_t dma_addr;
dma_addr_t *dma_addrs;
struct efhw_evq_params params = {};
int vi, rc;
int evq_id, rc;
struct ef10ct_shared_kernel_evq *shared_evq = &ef10ct->shared[qid];

vi = ef10ct_alloc_evq(nic);
if(vi < 0) {
rc = vi;
evq_id = ef10ct_alloc_evq(nic);
if(evq_id < 0) {
rc = evq_id;
goto fail1;
}
EFHW_ASSERT(vi <= ef10ct->evq_n);
EFHW_ASSERT(evq_id <= ef10ct->evq_n);

ef10ct_evq = &ef10ct->evq[vi];
ef10ct_evq = &ef10ct->evq[evq_id];

/* TODO: We may want to use alloc_pages_node to get memory on a specific numa
* node. */
Expand All @@ -207,7 +207,7 @@ static int ef10ct_nic_init_shared_evq(struct efhw_nic *nic, int qid)
EFHW_ASSERT(n_pages == 1);
dma_addrs = &dma_addr;

params.evq = vi;
params.evq = evq_id;
params.evq_size = (n_pages << PAGE_SHIFT) / sizeof(efhw_event_t);
params.dma_addrs = dma_addrs;
params.n_pages = n_pages;
Expand All @@ -218,16 +218,16 @@ static int ef10ct_nic_init_shared_evq(struct efhw_nic *nic, int qid)
if( rc < 0 )
goto fail3;

shared_evq->vi = vi;
shared_evq->evq = &ef10ct->evq[vi];
shared_evq->evq_id = evq_id;
shared_evq->evq = &ef10ct->evq[evq_id];
shared_evq->page = page;

return 0;

fail3:
put_page(page);
fail2:
ef10ct_free_evq(nic, vi);
ef10ct_free_evq(nic, evq_id);
fail1:
return rc;
}
Expand All @@ -242,9 +242,9 @@ static void ef10ct_nic_free_shared_evq(struct efhw_nic *nic, int qid)
shared_evq = &ef10ct->shared[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_event_queue_disable(nic, shared_evq->evq_id, 0);

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

/* Just to be safe */
Expand Down
2 changes: 1 addition & 1 deletion src/lib/efhw/ef10ct/ef10ct.c
Original file line number Diff line number Diff line change
Expand Up @@ -599,7 +599,7 @@ ef10ct_shared_rxq_bind(struct efhw_nic* nic,
* start supporting onload with interrupts we'll need to be able to alloc
* and attach to an evq. */
EFHW_ASSERT(ef10ct->shared_n >= 1 );
evq = ef10ct->shared[0].vi;
evq = ef10ct->shared[0].evq_id;
EFHW_WARN("%s: Using shared evq %d", __func__, evq);

EFHW_MCDI_INITIALISE_BUF(in);
Expand Down

0 comments on commit 7011ed0

Please sign in to comment.