Skip to content

Commit

Permalink
ON-15163: Update to use generic warming functions
Browse files Browse the repository at this point in the history
Change has been made to deprecate the architecture specific and transmit method
specific warming functions. Generic functions for enabling or disabling
transmit warming functionality should be used instead.

This commit updates TCPDirect to use the generic ef_vi functions.
  • Loading branch information
ibeecraft-amd authored and jfeather-amd committed Jul 2, 2024
1 parent da134ec commit 7d4498c
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 25 deletions.
2 changes: 1 addition & 1 deletion src/include/zf_internal/tx_warm.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
#include <zf_internal/tx_types.h>
#include <zf_internal/zf_pool.h>
extern "C" {
#include <etherfabric/internal/internal.h>
#include <etherfabric/ef_vi.h>
}

struct zf_tx_warm_state {
Expand Down
36 changes: 12 additions & 24 deletions src/lib/zf/tx_warm.c
Original file line number Diff line number Diff line change
Expand Up @@ -14,22 +14,16 @@ int enable_tx_warm(struct zf_tx* tx, zf_tx_warm_state* state)
ef_vi* vi = zf_stack_nic_tx_vi(st_nic);
zf_assert_nflags(st->flags, ZF_STACK_FLAG_TRANSMIT_WARM_ENABLED);
zf_log_stack_trace(st, "%s: TX warm enabled\n", __func__);
/* TODO better way to distuinguish X2 vs X3 style CTPIO */
if( vi->nic_type.arch == EF_VI_ARCH_EFCT ) {
efct_vi_start_transmit_warm(vi);
}
else {
char* ctpio_warm_buf = NULL;
state->ctpio_warm_buf_id = PKT_INVALID;
if( vi->vi_flags & EF_VI_TX_CTPIO ) {
int rc = zft_alloc_pkt(&st->pool, &state->ctpio_warm_buf_id);
if( rc < 0 )
return rc;
ctpio_warm_buf = PKT_BUF_BY_ID(&st->pool, state->ctpio_warm_buf_id);
}
ef_vi_start_transmit_warm(vi, &state->ef_vi_state[tx->path.nicno],
ctpio_warm_buf);
char* ctpio_warm_buf = NULL;
state->ctpio_warm_buf_id = PKT_INVALID;
if( vi->vi_flags & EF_VI_TX_CTPIO && vi->nic_type.arch != EF_VI_ARCH_EFCT ) {
int rc = zft_alloc_pkt(&st->pool, &state->ctpio_warm_buf_id);
if( rc < 0 )
return rc;
ctpio_warm_buf = PKT_BUF_BY_ID(&st->pool, state->ctpio_warm_buf_id);
}
ef_vi_start_transmit_warm(vi, &state->ef_vi_state[tx->path.nicno],
ctpio_warm_buf);
st->flags |= ZF_STACK_FLAG_TRANSMIT_WARM_ENABLED;
return 0;
}
Expand All @@ -42,15 +36,9 @@ void disable_tx_warm(struct zf_tx* tx, zf_tx_warm_state* state)
ef_vi* vi = zf_stack_nic_tx_vi(st_nic);
zf_assert_flags(st->flags, ZF_STACK_FLAG_TRANSMIT_WARM_ENABLED);
zf_log_stack_trace(st, "%s: TX warm disabled\n", __func__);
/* TODO better way to distuinguish X2 vs X3 style CTPIO */
if( vi->nic_type.arch == EF_VI_ARCH_EFCT ) {
efct_vi_stop_transmit_warm(vi);
}
else {
ef_vi_stop_transmit_warm(vi, &state->ef_vi_state[tx->path.nicno]);
if( state->ctpio_warm_buf_id != PKT_INVALID )
zf_pool_free_pkt(&st->pool, state->ctpio_warm_buf_id);
}
ef_vi_stop_transmit_warm(vi, &state->ef_vi_state[tx->path.nicno]);
if( state->ctpio_warm_buf_id != PKT_INVALID )
zf_pool_free_pkt(&st->pool, state->ctpio_warm_buf_id);
st->flags &= ~ZF_STACK_FLAG_TRANSMIT_WARM_ENABLED;
}

0 comments on commit 7d4498c

Please sign in to comment.