Thread (16 messages) 16 messages, 2 authors, 2017-08-29

Re: [PATCH 2/8] net/bnxt: add support for rx_queue_count

From: Ferruh Yigit <hidden>
Date: 2017-08-29 16:10:37

On 8/24/2017 5:29 PM, Ajit Khaparde wrote:
add support for rx_queue_count dev_op
Signed-off-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
<...>
+static uint32_t
+bnxt_rx_queue_count_op(struct rte_eth_dev *dev, uint16_t rx_queue_id)
+{
+	uint32_t desc = 0, raw_cons = 0, cons;
+	struct bnxt_cp_ring_info *cpr;
+	struct bnxt_rx_queue *rxq;
+	struct rx_pkt_cmpl *rxcmp;
+
+	rxq = dev->data->rx_queues[rx_queue_id];
+	cpr = rxq->cp_ring;
+
+	while (raw_cons < rxq->nb_rx_desc) {
+		cons = RING_CMP(cpr->cp_ring_struct, raw_cons++);
+		rxcmp = (struct rx_pkt_cmpl *)&cpr->cp_desc_ring[cons];
+
+		if (CMP_VALID(rxcmp, raw_cons, cpr->cp_ring_struct))
"raw_cons" increased above, the "raw_cons" here and the one used to get
"cons" are different. Is this an issue for cmp_valid ?
+			desc++;
+	}
+
+	return desc;
+}
<...>
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help