net/cxgbe: do not dereference global config struct
authorDavid Marchand <david.marchand@redhat.com>
Wed, 15 May 2019 07:54:19 +0000 (09:54 +0200)
committerThomas Monjalon <thomas@monjalon.net>
Wed, 29 May 2019 22:28:40 +0000 (00:28 +0200)
Prefer the existing apis rather than direct access the configuration
structure.

Fixes: 92c8a63223e5 ("cxgbe: add device configuration and Rx support")
Cc: stable@dpdk.org
Signed-off-by: David Marchand <david.marchand@redhat.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
drivers/net/cxgbe/cxgbe_main.c

index b5d5cd0..c3036e1 100644 (file)
@@ -504,7 +504,6 @@ int cxgbe_cfg_queue_count(struct rte_eth_dev *eth_dev)
 
 void cxgbe_cfg_queues(struct rte_eth_dev *eth_dev)
 {
-       struct rte_config *config = rte_eal_get_configuration();
        struct port_info *pi = (struct port_info *)(eth_dev->data->dev_private);
        struct adapter *adap = pi->adapter;
        struct sge *s = &adap->sge;
@@ -527,8 +526,8 @@ void cxgbe_cfg_queues(struct rte_eth_dev *eth_dev)
                                     (adap->params.nports - nb_ports)) /
                                     nb_ports;
 
-               if (q_per_port > config->lcore_count)
-                       q_per_port = config->lcore_count;
+               if (q_per_port > rte_lcore_count())
+                       q_per_port = rte_lcore_count();
 
                for_each_port(adap, i) {
                        struct port_info *pi = adap2pinfo(adap, i);