diff options
author | Mohammed Hawari <mohammed@hawari.fr> | 2020-11-10 10:26:45 +0100 |
---|---|---|
committer | Damjan Marion <dmarion@me.com> | 2020-12-01 08:00:27 +0000 |
commit | bb7991a037a23eb966aee2d6f8069353c6a64c94 (patch) | |
tree | 4bf032fc1cb66240dcc2b393e02b5675e8bcee4b /src/plugins/avf/device.c | |
parent | 8f5c6107c98b0b0c9a5110858dc403b706e05de2 (diff) |
avf: add TSO support
Change-Id: Ica663e1d07225acf53fd74b0051a5a2a34174960
Signed-off-by: Mohammed Hawari <mohammed@hawari.fr>
Type: improvement
Diffstat (limited to 'src/plugins/avf/device.c')
-rw-r--r-- | src/plugins/avf/device.c | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/src/plugins/avf/device.c b/src/plugins/avf/device.c index bb2dcf74e07..c6bf2df4443 100644 --- a/src/plugins/avf/device.c +++ b/src/plugins/avf/device.c @@ -298,6 +298,8 @@ avf_txq_init (vlib_main_t * vm, avf_device_t * ad, u16 qid, u16 txq_size) { clib_error_t *err; avf_txq_t *txq; + u8 bpi = vlib_buffer_pool_get_default_for_numa (vm, + ad->numa_node); if (qid >= ad->num_queue_pairs) { @@ -313,6 +315,14 @@ avf_txq_init (vlib_main_t * vm, avf_device_t * ad, u16 qid, u16 txq_size) txq = vec_elt_at_index (ad->txqs, qid); txq->size = txq_size; txq->next = 0; + + /* Prepare a placeholder buffer to maintain a 1-1 + relationship between bufs and descs when a context + descriptor is added in descs */ + if (!vlib_buffer_alloc_from_pool + (vm, &txq->ctx_desc_placeholder_bi, 1, bpi)) + return clib_error_return (0, "buffer allocation error"); + txq->descs = vlib_physmem_alloc_aligned_on_numa (vm, txq->size * sizeof (avf_tx_desc_t), 2 * CLIB_CACHE_LINE_BYTES, @@ -1442,6 +1452,8 @@ avf_delete_if (vlib_main_t * vm, avf_device_t * ad, int with_barrier) vlib_buffer_free_from_ring (vm, txq->bufs, first, txq->size, txq->n_enqueued); } + /* Free the placeholder buffer */ + vlib_buffer_free_one(vm, txq->ctx_desc_placeholder_bi); vec_free (txq->bufs); clib_ring_free (txq->rs_slots); } @@ -1638,7 +1650,8 @@ avf_create_if (vlib_main_t * vm, avf_create_if_args_t * args) vnet_hw_interface_t *hi = vnet_get_hw_interface (vnm, ad->hw_if_index); hi->flags |= VNET_HW_INTERFACE_FLAG_SUPPORTS_MAC_FILTER | - VNET_HW_INTERFACE_FLAG_SUPPORTS_TX_L4_CKSUM_OFFLOAD; + VNET_HW_INTERFACE_FLAG_SUPPORTS_TX_L4_CKSUM_OFFLOAD | + VNET_HW_INTERFACE_FLAG_SUPPORTS_GSO; ethernet_set_flags (vnm, ad->hw_if_index, ETHERNET_INTERFACE_FLAG_DEFAULT_L3); |