drivers/net: fix RSS hash offload flag if no RSS
[dpdk.git] / drivers / net / bnxt / bnxt_ethdev.c
index 74388f2..06033e3 100644 (file)
@@ -123,7 +123,8 @@ static const struct rte_pci_id bnxt_pci_id_map[] = {
                                     DEV_RX_OFFLOAD_KEEP_CRC | \
                                     DEV_RX_OFFLOAD_VLAN_EXTEND | \
                                     DEV_RX_OFFLOAD_TCP_LRO | \
-                                    DEV_RX_OFFLOAD_SCATTER)
+                                    DEV_RX_OFFLOAD_SCATTER | \
+                                    DEV_RX_OFFLOAD_RSS_HASH)
 
 static int bnxt_vlan_offload_set_op(struct rte_eth_dev *dev, int mask);
 static void bnxt_print_link_info(struct rte_eth_dev *eth_dev);
@@ -504,7 +505,7 @@ static int bnxt_dev_info_get_op(struct rte_eth_dev *eth_dev,
        if (BNXT_PF(bp))
                dev_info->max_vfs = pdev->max_vfs;
 
-       max_rx_rings = RTE_MIN(bp->max_rx_rings, bp->max_stat_ctx);
+       max_rx_rings = BNXT_MAX_RINGS(bp);
        /* For the sake of symmetry, max_rx_queues = max_tx_queues */
        dev_info->max_rx_queues = max_rx_rings;
        dev_info->max_tx_queues = max_rx_rings;
@@ -673,6 +674,10 @@ static int bnxt_dev_configure_op(struct rte_eth_dev *eth_dev)
        bp->rx_cp_nr_rings = bp->rx_nr_rings;
        bp->tx_cp_nr_rings = bp->tx_nr_rings;
 
+       if (eth_dev->data->dev_conf.rxmode.mq_mode & ETH_MQ_RX_RSS_FLAG)
+               rx_offloads |= DEV_RX_OFFLOAD_RSS_HASH;
+       eth_dev->data->dev_conf.rxmode.offloads = rx_offloads;
+
        if (rx_offloads & DEV_RX_OFFLOAD_JUMBO_FRAME) {
                eth_dev->data->mtu =
                        eth_dev->data->dev_conf.rxmode.max_rx_pkt_len -
@@ -1020,7 +1025,7 @@ static int bnxt_add_mac_filter(struct bnxt *bp, struct bnxt_vnic_info *vnic,
        /* Attach requested MAC address to the new l2_filter */
        STAILQ_FOREACH(filter, &vnic->filter, next) {
                if (filter->mac_index == index) {
-                       PMD_DRV_LOG(ERR,
+                       PMD_DRV_LOG(DEBUG,
                                    "MAC addr already existed for pool %d\n",
                                    pool);
                        return 0;
@@ -2063,8 +2068,12 @@ static void
 bnxt_rxq_info_get_op(struct rte_eth_dev *dev, uint16_t queue_id,
        struct rte_eth_rxq_info *qinfo)
 {
+       struct bnxt *bp = dev->data->dev_private;
        struct bnxt_rx_queue *rxq;
 
+       if (is_bnxt_in_error(bp))
+               return;
+
        rxq = dev->data->rx_queues[queue_id];
 
        qinfo->mp = rxq->mb_pool;
@@ -2080,8 +2089,12 @@ static void
 bnxt_txq_info_get_op(struct rte_eth_dev *dev, uint16_t queue_id,
        struct rte_eth_txq_info *qinfo)
 {
+       struct bnxt *bp = dev->data->dev_private;
        struct bnxt_tx_queue *txq;
 
+       if (is_bnxt_in_error(bp))
+               return;
+
        txq = dev->data->tx_queues[queue_id];
 
        qinfo->nb_desc = txq->nb_tx_desc;