X-Git-Url: http://git.droids-corp.org/?a=blobdiff_plain;f=drivers%2Fnet%2Fbnxt%2Fbnxt_rxq.c;h=c4da474e9185d3abbc2ae726a2aa343007ee6b98;hb=4ad5b94e0d13771a48cdf395d0c8b26e5f8cbe91;hp=8459fcc090f180c121f6aefe7fe48a097de1eb17;hpb=4191bc8f79a8ad7cbc36e05152794a8118348015;p=dpdk.git diff --git a/drivers/net/bnxt/bnxt_rxq.c b/drivers/net/bnxt/bnxt_rxq.c index 8459fcc090..c4da474e91 100644 --- a/drivers/net/bnxt/bnxt_rxq.c +++ b/drivers/net/bnxt/bnxt_rxq.c @@ -60,13 +60,14 @@ void bnxt_free_rxq_stats(struct bnxt_rx_queue *rxq) int bnxt_mq_rx_configure(struct bnxt *bp) { struct rte_eth_conf *dev_conf = &bp->eth_dev->data->dev_conf; + const struct rte_eth_vmdq_rx_conf *conf = + &dev_conf->rx_adv_conf.vmdq_rx_conf; unsigned int i, j, nb_q_per_grp = 1, ring_idx = 0; int start_grp_id, end_grp_id = 1, rc = 0; struct bnxt_vnic_info *vnic; struct bnxt_filter_info *filter; enum rte_eth_nb_pools pools = bp->rx_cp_nr_rings, max_pools = 0; struct bnxt_rx_queue *rxq; - bool rss_dflt_cr = false; bp->nr_vnics = 0; @@ -102,9 +103,6 @@ int bnxt_mq_rx_configure(struct bnxt *bp) /* Multi-queue mode */ if (dev_conf->rxmode.mq_mode & ETH_MQ_RX_VMDQ_DCB_RSS) { /* VMDq ONLY, VMDq+RSS, VMDq+DCB, VMDq+DCB+RSS */ - const struct rte_eth_vmdq_rx_conf *conf = - &dev_conf->rx_adv_conf.vmdq_rx_conf; - switch (dev_conf->rxmode.mq_mode) { case ETH_MQ_RX_VMDQ_RSS: @@ -120,7 +118,7 @@ int bnxt_mq_rx_configure(struct bnxt *bp) pools = max_pools; break; case ETH_MQ_RX_RSS: - pools = 1; + pools = bp->rx_cp_nr_rings; break; default: RTE_LOG(ERR, PMD, "Unsupported mq_mod %d\n", @@ -129,13 +127,6 @@ int bnxt_mq_rx_configure(struct bnxt *bp) goto err_out; } } - /* - * If MQ RX w/o RSS no need for per VNIC filter. - */ - if ((dev_conf->rxmode.mq_mode & ETH_MQ_RX_VMDQ_DCB) || - (bp->rx_cp_nr_rings && - !(dev_conf->rxmode.mq_mode & ETH_MQ_RX_RSS))) - rss_dflt_cr = true; nb_q_per_grp = bp->rx_cp_nr_rings / pools; start_grp_id = 0; @@ -152,18 +143,25 @@ int bnxt_mq_rx_configure(struct bnxt *bp) STAILQ_INSERT_TAIL(&bp->ff_pool[i], vnic, next); bp->nr_vnics++; - for (j = 0, ring_idx = 0; j < nb_q_per_grp; j++, ring_idx++) { + for (j = 0; j < nb_q_per_grp; j++, ring_idx++) { rxq = bp->eth_dev->data->rx_queues[ring_idx]; rxq->vnic = vnic; } - if (i == 0) + if (i == 0) { + if (dev_conf->rxmode.mq_mode & ETH_MQ_RX_VMDQ_DCB) { + bp->eth_dev->data->promiscuous = 1; + vnic->flags |= BNXT_VNIC_INFO_PROMISC; + } vnic->func_default = true; + } vnic->ff_pool_idx = i; vnic->start_grp_id = start_grp_id; vnic->end_grp_id = end_grp_id; - if (rss_dflt_cr && i) { - vnic->rss_dflt_cr = true; + if (i) { + if (dev_conf->rxmode.mq_mode & ETH_MQ_RX_VMDQ_DCB || + !(dev_conf->rxmode.mq_mode & ETH_MQ_RX_RSS)) + vnic->rss_dflt_cr = true; goto skip_filter_allocation; } filter = bnxt_alloc_filter(bp); @@ -188,6 +186,11 @@ out: struct rte_eth_rss_conf *rss = &dev_conf->rx_adv_conf.rss_conf; uint16_t hash_type = 0; + if (bp->flags & BNXT_FLAG_UPDATE_HASH) { + rss = &bp->rss_conf; + bp->flags &= ~BNXT_FLAG_UPDATE_HASH; + } + if (rss->rss_hf & ETH_RSS_IPV4) hash_type |= HWRM_VNIC_RSS_CFG_INPUT_HASH_TYPE_IPV4; if (rss->rss_hf & ETH_RSS_NONFRAG_IPV4_TCP) @@ -203,7 +206,7 @@ out: for (i = 0; i < bp->nr_vnics; i++) { STAILQ_FOREACH(vnic, &bp->ff_pool[i], next) { - vnic->hash_type |= hash_type; + vnic->hash_type = hash_type; /* * Use the supplied key if the key length is @@ -357,3 +360,41 @@ int bnxt_rx_queue_setup_op(struct rte_eth_dev *eth_dev, out: return rc; } + +int +bnxt_rx_queue_intr_enable_op(struct rte_eth_dev *eth_dev, uint16_t queue_id) +{ + struct bnxt_rx_queue *rxq; + struct bnxt_cp_ring_info *cpr; + int rc = 0; + + if (eth_dev->data->rx_queues) { + rxq = eth_dev->data->rx_queues[queue_id]; + if (!rxq) { + rc = -EINVAL; + return rc; + } + cpr = rxq->cp_ring; + B_CP_DB_ARM(cpr); + } + return rc; +} + +int +bnxt_rx_queue_intr_disable_op(struct rte_eth_dev *eth_dev, uint16_t queue_id) +{ + struct bnxt_rx_queue *rxq; + struct bnxt_cp_ring_info *cpr; + int rc = 0; + + if (eth_dev->data->rx_queues) { + rxq = eth_dev->data->rx_queues[queue_id]; + if (!rxq) { + rc = -EINVAL; + return rc; + } + cpr = rxq->cp_ring; + B_CP_DB_DISARM(cpr); + } + return rc; +}