[1/4] net/cxgbe: do not dereference global config struct

Message ID 1557906862-1116-1-git-send-email-david.marchand@redhat.com (mailing list archive)
State Accepted, archived
Delegated to: Thomas Monjalon
Headers
Series [1/4] net/cxgbe: do not dereference global config struct |

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/intel-Performance-Testing success Performance Testing PASS
ci/mellanox-Performance-Testing success Performance Testing PASS
ci/Intel-compilation success Compilation OK

Commit Message

David Marchand May 15, 2019, 7:54 a.m. UTC
  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>
---
 drivers/net/cxgbe/cxgbe_main.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)
  

Comments

Maxime Coquelin May 15, 2019, 9:29 a.m. UTC | #1
On 5/15/19 9:54 AM, David Marchand wrote:
> 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>
> ---
>   drivers/net/cxgbe/cxgbe_main.c | 5 ++---
>   1 file changed, 2 insertions(+), 3 deletions(-)


Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>

Thanks,
Maxime
  
Thomas Monjalon May 29, 2019, 10:31 p.m. UTC | #2
15/05/2019 11:29, Maxime Coquelin:
> 
> On 5/15/19 9:54 AM, David Marchand wrote:
> > 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>
> > ---
> >   drivers/net/cxgbe/cxgbe_main.c | 5 ++---
> >   1 file changed, 2 insertions(+), 3 deletions(-)
> 
> 
> Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>

Series applied, thanks
  

Patch

diff --git a/drivers/net/cxgbe/cxgbe_main.c b/drivers/net/cxgbe/cxgbe_main.c
index 28c3c66..987aab4 100644
--- a/drivers/net/cxgbe/cxgbe_main.c
+++ b/drivers/net/cxgbe/cxgbe_main.c
@@ -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);