net/bnxt: set the hash key size
[dpdk.git] / drivers / net / bnxt / bnxt_ethdev.c
index 6e5cb88..5b17eef 100644 (file)
@@ -378,6 +378,7 @@ static void bnxt_dev_info_get_op(struct rte_eth_dev *eth_dev,
        dev_info->max_rx_queues = max_rx_rings;
        dev_info->max_tx_queues = max_rx_rings;
        dev_info->reta_size = bp->max_rsscos_ctx;
+       dev_info->hash_key_size = 40;
        max_vnics = bp->max_vnics;
 
        /* Fast path specifics */
@@ -837,6 +838,10 @@ static int bnxt_rss_hash_update_op(struct rte_eth_dev *eth_dev,
                if (rss_conf->rss_hf & BNXT_ETH_RSS_SUPPORT)
                        return -EINVAL;
        }
+
+       bp->flags |= BNXT_FLAG_UPDATE_HASH;
+       memcpy(&bp->rss_conf, rss_conf, sizeof(*rss_conf));
+
        if (rss_conf->rss_hf & ETH_RSS_IPV4)
                hash_type |= HWRM_VNIC_RSS_CFG_INPUT_HASH_TYPE_IPV4;
        if (rss_conf->rss_hf & ETH_RSS_NONFRAG_IPV4_TCP)
@@ -1569,6 +1574,8 @@ static const struct eth_dev_ops bnxt_dev_ops = {
        .txq_info_get = bnxt_txq_info_get_op,
        .dev_led_on = bnxt_dev_led_on_op,
        .dev_led_off = bnxt_dev_led_off_op,
+       .xstats_get_by_id = bnxt_dev_xstats_get_by_id_op,
+       .xstats_get_names_by_id = bnxt_dev_xstats_get_names_by_id_op,
 };
 
 static bool bnxt_vf_pciid(uint16_t id)
@@ -1648,6 +1655,9 @@ bnxt_dev_init(struct rte_eth_dev *eth_dev)
        rte_atomic64_init(&bp->rx_mbuf_alloc_fail);
        bp->dev_stopped = 1;
 
+       if (rte_eal_process_type() != RTE_PROC_PRIMARY)
+               goto skip_init;
+
        if (bnxt_vf_pciid(pci_dev->id.device_id))
                bp->flags |= BNXT_FLAG_VF;
 
@@ -1657,7 +1667,10 @@ bnxt_dev_init(struct rte_eth_dev *eth_dev)
                        "Board initialization failed rc: %x\n", rc);
                goto error;
        }
+skip_init:
        eth_dev->dev_ops = &bnxt_dev_ops;
+       if (rte_eal_process_type() != RTE_PROC_PRIMARY)
+               return 0;
        eth_dev->rx_pkt_burst = &bnxt_recv_pkts;
        eth_dev->tx_pkt_burst = &bnxt_xmit_pkts;
 
@@ -1882,6 +1895,9 @@ bnxt_dev_uninit(struct rte_eth_dev *eth_dev) {
        struct bnxt *bp = eth_dev->data->dev_private;
        int rc;
 
+       if (rte_eal_process_type() != RTE_PROC_PRIMARY)
+               return -EPERM;
+
        bnxt_disable_int(bp);
        bnxt_free_int(bp);
        bnxt_free_mem(bp);