aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDamjan Marion <damarion@cisco.com>2018-07-26 12:48:39 +0200
committerDamjan Marion <dmarion@me.com>2018-07-26 12:25:32 +0000
commitc4b094eae0386c103958e185456995b8608bf111 (patch)
treefd5296ddb3ceb4b405ecd8e2b8d8c7cba7060ad0
parent48a87f2c9546bc60b776c4812339647616b2f46d (diff)
avf: used tx queue should be enabled
Change-Id: I51cc4522df2dd6682148a13e7e1903850b4b3d08 Signed-off-by: Damjan Marion <damarion@cisco.com>
-rw-r--r--src/plugins/avf/avf.h2
-rw-r--r--src/plugins/avf/device.c8
2 files changed, 8 insertions, 2 deletions
diff --git a/src/plugins/avf/avf.h b/src/plugins/avf/avf.h
index d8c64737c32..3ee80158667 100644
--- a/src/plugins/avf/avf.h
+++ b/src/plugins/avf/avf.h
@@ -115,6 +115,8 @@ typedef struct
/* queues */
avf_rxq_t *rxqs;
avf_txq_t *txqs;
+ u16 n_tx_queues;
+ u16 n_rx_queues;
/* Admin queues */
avf_aq_desc_t *atq;
diff --git a/src/plugins/avf/device.c b/src/plugins/avf/device.c
index 29dcb99bb4a..a6af902a7fc 100644
--- a/src/plugins/avf/device.c
+++ b/src/plugins/avf/device.c
@@ -250,6 +250,8 @@ avf_rxq_init (vlib_main_t * vm, avf_device_t * ad, u16 qid, u16 rxq_size)
vlib_get_buffer_data_physical_address (vm, rxq->bufs[i]);
d++;
}
+
+ ad->n_rx_queues = clib_min (ad->num_queue_pairs, qid + 1);
return 0;
}
@@ -279,6 +281,8 @@ avf_txq_init (vlib_main_t * vm, avf_device_t * ad, u16 qid, u16 txq_size)
2 * CLIB_CACHE_LINE_BYTES);
vec_validate_aligned (txq->bufs, txq->size, CLIB_CACHE_LINE_BYTES);
txq->qtx_tail = ad->bar0 + AVF_QTX_TAIL (qid);
+
+ ad->n_tx_queues = clib_min (ad->num_queue_pairs, qid + 1);
return 0;
}
@@ -789,10 +793,10 @@ avf_device_init (vlib_main_t * vm, avf_device_t * ad,
if ((error = avf_op_add_eth_addr (vm, ad, 1, ad->hwaddr)))
return error;
- if ((error = avf_op_enable_queues (vm, ad, 1, 0)))
+ if ((error = avf_op_enable_queues (vm, ad, ad->n_rx_queues, 0)))
return error;
- if ((error = avf_op_enable_queues (vm, ad, 0, 1)))
+ if ((error = avf_op_enable_queues (vm, ad, 0, ad->n_tx_queues)))
return error;
ad->flags |= AVF_DEVICE_F_INITIALIZED;