net/bnxt: fix drop enable in get Rx queue info
authorLance Richardson <lance.richardson@broadcom.com>
Tue, 22 Sep 2020 17:30:34 +0000 (13:30 -0400)
committerFerruh Yigit <ferruh.yigit@intel.com>
Wed, 30 Sep 2020 17:19:10 +0000 (19:19 +0200)
Return correct value for rx_drop_en. Add per-queue field to
track rx_drop_en configuration.

Fixes: 2fc201884be8 ("net/bnxt: support rxq/txq get information")
Cc: stable@dpdk.org
Signed-off-by: Lance Richardson <lance.richardson@broadcom.com>
Reviewed-by: Somnath Kotur <somnath.kotur@broadcom.com>
Reviewed-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
drivers/net/bnxt/bnxt_ethdev.c
drivers/net/bnxt/bnxt_rxq.c
drivers/net/bnxt/bnxt_rxq.h

index 5fc8d1c..d0d11a6 100644 (file)
@@ -929,8 +929,7 @@ static int bnxt_dev_info_get_op(struct rte_eth_dev *eth_dev,
                        .wthresh = 0,
                },
                .rx_free_thresh = 32,
-               /* If no descriptors available, pkts are dropped by default */
-               .rx_drop_en = 1,
+               .rx_drop_en = BNXT_DEFAULT_RX_DROP_EN,
        };
 
        dev_info->default_txconf = (struct rte_eth_txconf) {
@@ -2644,7 +2643,7 @@ bnxt_rxq_info_get_op(struct rte_eth_dev *dev, uint16_t queue_id,
        qinfo->nb_desc = rxq->nb_rx_desc;
 
        qinfo->conf.rx_free_thresh = rxq->rx_free_thresh;
-       qinfo->conf.rx_drop_en = 0;
+       qinfo->conf.rx_drop_en = rxq->drop_en;
        qinfo->conf.rx_deferred_start = rxq->rx_deferred_start;
 }
 
index 793a47d..8cc77f7 100644 (file)
@@ -330,6 +330,11 @@ int bnxt_rx_queue_setup_op(struct rte_eth_dev *eth_dev,
        rxq->rx_free_thresh =
                RTE_MIN(rte_align32pow2(nb_desc) / 4, RTE_BNXT_MAX_RX_BURST);
 
+       if (rx_conf->rx_drop_en != BNXT_DEFAULT_RX_DROP_EN)
+               PMD_DRV_LOG(NOTICE,
+                           "Per-queue config of drop-en is not supported.\n");
+       rxq->drop_en = BNXT_DEFAULT_RX_DROP_EN;
+
        PMD_DRV_LOG(DEBUG, "RX Buf MTU %d\n", eth_dev->data->mtu);
 
        rc = bnxt_init_rx_ring_struct(rxq, socket_id);
index fae92ea..f70cb04 100644 (file)
@@ -9,6 +9,9 @@
 /* Maximum receive burst supported in vector mode. */
 #define RTE_BNXT_MAX_RX_BURST          64U
 
+/* Drop by default when receive desc is not available. */
+#define BNXT_DEFAULT_RX_DROP_EN                1
+
 struct bnxt;
 struct bnxt_rx_ring_info;
 struct bnxt_cp_ring_info;
@@ -34,6 +37,7 @@ struct bnxt_rx_queue {
        uint8_t                 crc_len; /* 0 if CRC stripped, 4 otherwise */
        uint8_t                 rx_deferred_start; /* not in global dev start */
        uint8_t                 rx_started; /* RX queue is started */
+       uint8_t                 drop_en; /* Drop when rx desc not available. */
 
        struct bnxt             *bp;
        int                     index;