diff options
author | Edward Cree <ecree@solarflare.com> | 2020-09-11 23:40:03 +0100 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2020-09-11 17:15:22 -0700 |
commit | 1679c72cf48552e75a624b9c9230e2c7c18cfffc (patch) | |
tree | 0a01a45d7b955a904a17a0be7e371a3d42eefd32 /drivers/net/ethernet/sfc/mcdi_functions.c | |
parent | fe0c4060c1b90fabfcab387dc374edde420a98d6 (diff) |
sfc: de-indirect TSO handling
Remove the tx_queue->handle_tso function pointer, and just use
tx_queue->tso_version to decide which function to call, thus removing
an indirect call from the fast path.
Instead of passing a tso_v2 flag to efx_mcdi_tx_init(), set the desired
tx_queue->tso_version before calling it.
In efx_mcdi_tx_init(), report back failure to obtain a TSOv2 context by
setting tx_queue->tso_version to 0, which will cause the TX path to
use the GSO-based fallback.
Signed-off-by: Edward Cree <ecree@solarflare.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet/sfc/mcdi_functions.c')
-rw-r--r-- | drivers/net/ethernet/sfc/mcdi_functions.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/drivers/net/ethernet/sfc/mcdi_functions.c b/drivers/net/ethernet/sfc/mcdi_functions.c index 58582a0a42e4..d3e6d8239f5c 100644 --- a/drivers/net/ethernet/sfc/mcdi_functions.c +++ b/drivers/net/ethernet/sfc/mcdi_functions.c @@ -160,7 +160,7 @@ fail: outbuf, outlen, rc); } -int efx_mcdi_tx_init(struct efx_tx_queue *tx_queue, bool tso_v2) +int efx_mcdi_tx_init(struct efx_tx_queue *tx_queue) { MCDI_DECLARE_BUF(inbuf, MC_CMD_INIT_TXQ_IN_LEN(EFX_MAX_DMAQ_SIZE * 8 / EFX_BUF_SIZE)); @@ -195,6 +195,8 @@ int efx_mcdi_tx_init(struct efx_tx_queue *tx_queue, bool tso_v2) inlen = MC_CMD_INIT_TXQ_IN_LEN(entries); do { + bool tso_v2 = tx_queue->tso_version == 2; + /* TSOv2 implies IP header checksum offload for TSO frames, * so we can safely disable IP header checksum offload for * everything else. If we don't have TSOv2, then we have to @@ -217,7 +219,7 @@ int efx_mcdi_tx_init(struct efx_tx_queue *tx_queue, bool tso_v2) NULL, 0, NULL); if (rc == -ENOSPC && tso_v2) { /* Retry without TSOv2 if we're short on contexts. */ - tso_v2 = false; + tx_queue->tso_version = 0; netif_warn(efx, probe, efx->net_dev, "TSOv2 context not available to segment in " "hardware. TCP performance may be reduced.\n" |