sfxge(4): add API to allocate and free RSS contexts
Submitted by: Mark Spender <mspender at solarflare.com> Sponsored by: Solarflare Communications, Inc. Differential Revision: https://reviews.freebsd.org/D18079
This commit is contained in:
parent
7f6e8fadc8
commit
60bf8df9b0
@ -899,6 +899,18 @@ ef10_rx_scatter_enable(
|
||||
|
||||
#if EFSYS_OPT_RX_SCALE
|
||||
|
||||
extern __checkReturn efx_rc_t
|
||||
ef10_rx_scale_context_alloc(
|
||||
__in efx_nic_t *enp,
|
||||
__in efx_rx_scale_context_type_t type,
|
||||
__in uint32_t num_queues,
|
||||
__out uint32_t *rss_contextp);
|
||||
|
||||
extern __checkReturn efx_rc_t
|
||||
ef10_rx_scale_context_free(
|
||||
__in efx_nic_t *enp,
|
||||
__in uint32_t rss_context);
|
||||
|
||||
extern __checkReturn efx_rc_t
|
||||
ef10_rx_scale_mode_set(
|
||||
__in efx_nic_t *enp,
|
||||
|
@ -492,6 +492,48 @@ ef10_rx_scatter_enable(
|
||||
}
|
||||
#endif /* EFSYS_OPT_RX_SCATTER */
|
||||
|
||||
#if EFSYS_OPT_RX_SCALE
|
||||
__checkReturn efx_rc_t
|
||||
ef10_rx_scale_context_alloc(
|
||||
__in efx_nic_t *enp,
|
||||
__in efx_rx_scale_context_type_t type,
|
||||
__in uint32_t num_queues,
|
||||
__out uint32_t *rss_contextp)
|
||||
{
|
||||
efx_rc_t rc;
|
||||
|
||||
rc = efx_mcdi_rss_context_alloc(enp, type, num_queues, rss_contextp);
|
||||
if (rc != 0)
|
||||
goto fail1;
|
||||
|
||||
return (0);
|
||||
|
||||
fail1:
|
||||
EFSYS_PROBE1(fail1, efx_rc_t, rc);
|
||||
return (rc);
|
||||
}
|
||||
#endif /* EFSYS_OPT_RX_SCALE */
|
||||
|
||||
#if EFSYS_OPT_RX_SCALE
|
||||
__checkReturn efx_rc_t
|
||||
ef10_rx_scale_context_free(
|
||||
__in efx_nic_t *enp,
|
||||
__in uint32_t rss_context)
|
||||
{
|
||||
efx_rc_t rc;
|
||||
|
||||
rc = efx_mcdi_rss_context_free(enp, rss_context);
|
||||
if (rc != 0)
|
||||
goto fail1;
|
||||
|
||||
return (0);
|
||||
|
||||
fail1:
|
||||
EFSYS_PROBE1(fail1, efx_rc_t, rc);
|
||||
return (rc);
|
||||
}
|
||||
#endif /* EFSYS_OPT_RX_SCALE */
|
||||
|
||||
#if EFSYS_OPT_RX_SCALE
|
||||
__checkReturn efx_rc_t
|
||||
ef10_rx_scale_mode_set(
|
||||
|
@ -1933,6 +1933,18 @@ efx_rx_scale_default_support_get(
|
||||
__in efx_nic_t *enp,
|
||||
__out efx_rx_scale_context_type_t *typep);
|
||||
|
||||
extern __checkReturn efx_rc_t
|
||||
efx_rx_scale_context_alloc(
|
||||
__in efx_nic_t *enp,
|
||||
__in efx_rx_scale_context_type_t type,
|
||||
__in uint32_t num_queues,
|
||||
__out uint32_t *rss_contextp);
|
||||
|
||||
extern __checkReturn efx_rc_t
|
||||
efx_rx_scale_context_free(
|
||||
__in efx_nic_t *enp,
|
||||
__in uint32_t rss_context);
|
||||
|
||||
extern __checkReturn efx_rc_t
|
||||
efx_rx_scale_mode_set(
|
||||
__in efx_nic_t *enp,
|
||||
|
@ -156,6 +156,10 @@ typedef struct efx_rx_ops_s {
|
||||
efx_rc_t (*erxo_scatter_enable)(efx_nic_t *, unsigned int);
|
||||
#endif
|
||||
#if EFSYS_OPT_RX_SCALE
|
||||
efx_rc_t (*erxo_scale_context_alloc)(efx_nic_t *,
|
||||
efx_rx_scale_context_type_t,
|
||||
uint32_t, uint32_t *);
|
||||
efx_rc_t (*erxo_scale_context_free)(efx_nic_t *, uint32_t);
|
||||
efx_rc_t (*erxo_scale_mode_set)(efx_nic_t *, efx_rx_hash_alg_t,
|
||||
efx_rx_hash_type_t, boolean_t);
|
||||
efx_rc_t (*erxo_scale_key_set)(efx_nic_t *, uint8_t *, size_t);
|
||||
|
@ -154,6 +154,8 @@ static const efx_rx_ops_t __efx_rx_siena_ops = {
|
||||
siena_rx_scatter_enable, /* erxo_scatter_enable */
|
||||
#endif
|
||||
#if EFSYS_OPT_RX_SCALE
|
||||
NULL, /* erxo_scale_context_alloc */
|
||||
NULL, /* erxo_scale_context_free */
|
||||
siena_rx_scale_mode_set, /* erxo_scale_mode_set */
|
||||
siena_rx_scale_key_set, /* erxo_scale_key_set */
|
||||
siena_rx_scale_tbl_set, /* erxo_scale_tbl_set */
|
||||
@ -181,6 +183,8 @@ static const efx_rx_ops_t __efx_rx_ef10_ops = {
|
||||
ef10_rx_scatter_enable, /* erxo_scatter_enable */
|
||||
#endif
|
||||
#if EFSYS_OPT_RX_SCALE
|
||||
ef10_rx_scale_context_alloc, /* erxo_scale_context_alloc */
|
||||
ef10_rx_scale_context_free, /* erxo_scale_context_free */
|
||||
ef10_rx_scale_mode_set, /* erxo_scale_mode_set */
|
||||
ef10_rx_scale_key_set, /* erxo_scale_key_set */
|
||||
ef10_rx_scale_tbl_set, /* erxo_scale_tbl_set */
|
||||
@ -365,7 +369,71 @@ fail1:
|
||||
|
||||
return (rc);
|
||||
}
|
||||
#endif /* EFSYS_OPT_RX_SCALE */
|
||||
|
||||
#if EFSYS_OPT_RX_SCALE
|
||||
__checkReturn efx_rc_t
|
||||
efx_rx_scale_context_alloc(
|
||||
__in efx_nic_t *enp,
|
||||
__in efx_rx_scale_context_type_t type,
|
||||
__in uint32_t num_queues,
|
||||
__out uint32_t *rss_contextp)
|
||||
{
|
||||
const efx_rx_ops_t *erxop = enp->en_erxop;
|
||||
efx_rc_t rc;
|
||||
|
||||
EFSYS_ASSERT3U(enp->en_magic, ==, EFX_NIC_MAGIC);
|
||||
EFSYS_ASSERT3U(enp->en_mod_flags, &, EFX_MOD_RX);
|
||||
|
||||
if (erxop->erxo_scale_context_alloc == NULL) {
|
||||
rc = ENOTSUP;
|
||||
goto fail1;
|
||||
}
|
||||
if ((rc = erxop->erxo_scale_context_alloc(enp, type,
|
||||
num_queues, rss_contextp)) != 0) {
|
||||
goto fail2;
|
||||
}
|
||||
|
||||
return (0);
|
||||
|
||||
fail2:
|
||||
EFSYS_PROBE(fail2);
|
||||
fail1:
|
||||
EFSYS_PROBE1(fail1, efx_rc_t, rc);
|
||||
return (rc);
|
||||
}
|
||||
#endif /* EFSYS_OPT_RX_SCALE */
|
||||
|
||||
#if EFSYS_OPT_RX_SCALE
|
||||
__checkReturn efx_rc_t
|
||||
efx_rx_scale_context_free(
|
||||
__in efx_nic_t *enp,
|
||||
__in uint32_t rss_context)
|
||||
{
|
||||
const efx_rx_ops_t *erxop = enp->en_erxop;
|
||||
efx_rc_t rc;
|
||||
|
||||
EFSYS_ASSERT3U(enp->en_magic, ==, EFX_NIC_MAGIC);
|
||||
EFSYS_ASSERT3U(enp->en_mod_flags, &, EFX_MOD_RX);
|
||||
|
||||
if (erxop->erxo_scale_context_free == NULL) {
|
||||
rc = ENOTSUP;
|
||||
goto fail1;
|
||||
}
|
||||
if ((rc = erxop->erxo_scale_context_free(enp, rss_context)) != 0)
|
||||
goto fail2;
|
||||
|
||||
return (0);
|
||||
|
||||
fail2:
|
||||
EFSYS_PROBE(fail2);
|
||||
fail1:
|
||||
EFSYS_PROBE1(fail1, efx_rc_t, rc);
|
||||
return (rc);
|
||||
}
|
||||
#endif /* EFSYS_OPT_RX_SCALE */
|
||||
|
||||
#if EFSYS_OPT_RX_SCALE
|
||||
__checkReturn efx_rc_t
|
||||
efx_rx_scale_mode_set(
|
||||
__in efx_nic_t *enp,
|
||||
|
Loading…
x
Reference in New Issue
Block a user