/* Get the CQ index from a Start of Packet(SOP) RQ index */
static inline unsigned int enic_sop_rq_idx_to_cq_idx(unsigned int sop_idx)
{
- return sop_idx / 2;
+ return sop_idx;
}
/* Get the RTE RQ index from a Start of Packet(SOP) RQ index */
static inline unsigned int enic_sop_rq_idx_to_rte_idx(unsigned int sop_idx)
{
- return sop_idx / 2;
+ return sop_idx;
}
/* Get the Start of Packet(SOP) RQ index from a RTE RQ index */
static inline unsigned int enic_rte_rq_idx_to_sop_idx(unsigned int rte_idx)
{
- return rte_idx * 2;
+ return rte_idx;
}
/* Get the Data RQ index from a RTE RQ index */
-static inline unsigned int enic_rte_rq_idx_to_data_idx(unsigned int rte_idx)
+static inline unsigned int enic_rte_rq_idx_to_data_idx(unsigned int rte_idx,
+ struct enic *enic)
{
- return rte_idx * 2 + 1;
+ return enic->rq_count + rte_idx;
}
static inline unsigned int enic_vnic_rq_count(struct enic *enic)
* completion queue, so the completion queue number is no
* longer the same as the rq number.
*/
- return rq / 2;
+ return rq;
}
static inline unsigned int enic_cq_wq(struct enic *enic, unsigned int wq)
error_interrupt_enable,
error_interrupt_offset);
- data_rq = &enic->rq[enic_rte_rq_idx_to_data_idx(index)];
+ data_rq = &enic->rq[enic_rte_rq_idx_to_data_idx(index, enic)];
if (data_rq->in_use)
vnic_rq_init(data_rq,
cq_idx,
error_interrupt_enable,
error_interrupt_offset);
-
vnic_cq_init(&enic->cq[cq_idx],
0 /* flow_control_enable */,
1 /* color_enable */,
return err;
}
err = enic_alloc_rx_queue_mbufs(enic,
- &enic->rq[enic_rte_rq_idx_to_data_idx(index)]);
+ &enic->rq[enic_rte_rq_idx_to_data_idx(index, enic)]);
if (err) {
/* release the allocated mbufs for the sop rq*/
enic_rxmbuf_queue_release(enic,
{
int rc;
uint16_t sop_queue_idx = enic_rte_rq_idx_to_sop_idx(queue_idx);
- uint16_t data_queue_idx = enic_rte_rq_idx_to_data_idx(queue_idx);
+ uint16_t data_queue_idx = enic_rte_rq_idx_to_data_idx(queue_idx, enic);
struct vnic_rq *rq_sop = &enic->rq[sop_queue_idx];
struct vnic_rq *rq_data = &enic->rq[data_queue_idx];
unsigned int mbuf_size, mbufs_per_pkt;
int rc = 0;
sop_rq = &enic->rq[enic_rte_rq_idx_to_sop_idx(rq_idx)];
- data_rq = &enic->rq[enic_rte_rq_idx_to_data_idx(rq_idx)];
+ data_rq = &enic->rq[enic_rte_rq_idx_to_data_idx(rq_idx, enic)];
cq_idx = rq_idx;
vnic_cq_clean(&enic->cq[cq_idx]);
if (data_rq->in_use) {
vnic_rq_init_start(data_rq,
enic_cq_rq(enic,
- enic_rte_rq_idx_to_data_idx(rq_idx)), 0,
- data_rq->ring.desc_count - 1, 1, 0);
+ enic_rte_rq_idx_to_data_idx(rq_idx, enic)),
+ 0, data_rq->ring.desc_count - 1, 1, 0);
}
rc = enic_alloc_rx_queue_mbufs(enic, sop_rq);