{
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)
{
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,
format_ethernet_address, &al->list[i].addr);
}
return avf_send_to_pf (vm, ad, is_add ? VIRTCHNL_OP_ADD_ETH_ADDR :
- VIRTCHNL_OP_ADD_ETH_ADDR, msg, msg_len, 0, 0);
+ VIRTCHNL_OP_DEL_ETH_ADDR, msg, msg_len, 0, 0);
}
clib_error_t *
* during suspend */
vec_reset_length (dev_pointers);
/* *INDENT-OFF* */
- pool_foreach_index (i, am->devices,
+ pool_foreach_index (i, am->devices)
{
vec_add1 (dev_pointers, avf_get_device (i));
- });
+ }
vec_foreach_index (i, dev_pointers)
{
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);
}
return;
/* *INDENT-OFF* */
- pool_foreach (adp, am->devices, ({
+ pool_foreach (adp, am->devices) {
if ((*adp)->pci_addr.as_u32 == args->addr.as_u32)
{
args->rv = VNET_API_ERROR_ADDRESS_IN_USE;
&args->addr, "pci address in use");
return;
}
- }));
+ }
/* *INDENT-ON* */
pool_get (am->devices, adp);
/* Indicate ability to support L3 DMAC filtering and
* initialize interface to L3 non-promisc mode */
vnet_hw_interface_t *hi = vnet_get_hw_interface (vnm, ad->hw_if_index);
- hi->flags |= VNET_HW_INTERFACE_FLAG_SUPPORTS_MAC_FILTER;
+ hi->flags |=
+ VNET_HW_INTERFACE_FLAG_SUPPORTS_MAC_FILTER |
+ 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);