[v1,2/2] net/pfe: fix misuse of if_index

Message ID 20200911093921.28398-1-sachin.saxena@oss.nxp.com (mailing list archive)
State Superseded, archived
Delegated to: Ferruh Yigit
Headers
Series [v1,1/2] net/dpaa2: fix misuse of if_index |

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/iol-broadcom-Functional success Functional Testing PASS
ci/iol-broadcom-Performance success Performance Testing PASS
ci/iol-testing fail Testing issues
ci/iol-intel-Functional success Functional Testing PASS
ci/iol-intel-Performance success Performance Testing PASS
ci/travis-robot success Travis build: passed
ci/iol-mellanox-Performance success Performance Testing PASS
ci/Intel-compilation success Compilation OK

Commit Message

Sachin Saxena (OSS) Sept. 11, 2020, 9:39 a.m. UTC
From: Sachin Saxena <sachin.saxena@oss.nxp.com>

Pfe pmd has no need to bound host interface
for which we require if_index field.
Setting it to 0 as unused.

Signed-off-by: Sachin Saxena <sachin.saxena@oss.nxp.com>
---
 drivers/net/pfe/pfe_ethdev.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)
  

Comments

Ferruh Yigit Sept. 11, 2020, 1:03 p.m. UTC | #1
On 9/11/2020 10:39 AM, Sachin Saxena (OSS) wrote:
> From: Sachin Saxena <sachin.saxena@oss.nxp.com>
> 
> Pfe pmd has no need to bound host interface
> for which we require if_index field.
> Setting it to 0 as unused.
> 
> Signed-off-by: Sachin Saxena <sachin.saxena@oss.nxp.com>
> ---
>  drivers/net/pfe/pfe_ethdev.c | 4 +---
>  1 file changed, 1 insertion(+), 3 deletions(-)
> 
> diff --git a/drivers/net/pfe/pfe_ethdev.c b/drivers/net/pfe/pfe_ethdev.c
> index 368acfa55..8cbd51abb 100644
> --- a/drivers/net/pfe/pfe_ethdev.c
> +++ b/drivers/net/pfe/pfe_ethdev.c
> @@ -427,9 +427,7 @@ static int
>  pfe_eth_info(struct rte_eth_dev *dev,
>  		struct rte_eth_dev_info *dev_info)
>  {
> -	struct pfe_eth_priv_s *internals = dev->data->dev_private;
> -
> -	dev_info->if_index = internals->id;
> +	dev_info->if_index = 0;

No need to set 'if_index' to anything, assignment can be removed completely.
  

Patch

diff --git a/drivers/net/pfe/pfe_ethdev.c b/drivers/net/pfe/pfe_ethdev.c
index 368acfa55..8cbd51abb 100644
--- a/drivers/net/pfe/pfe_ethdev.c
+++ b/drivers/net/pfe/pfe_ethdev.c
@@ -427,9 +427,7 @@  static int
 pfe_eth_info(struct rte_eth_dev *dev,
 		struct rte_eth_dev_info *dev_info)
 {
-	struct pfe_eth_priv_s *internals = dev->data->dev_private;
-
-	dev_info->if_index = internals->id;
+	dev_info->if_index = 0;
 	dev_info->max_mac_addrs = PFE_MAX_MACS;
 	dev_info->max_rx_queues = dev->data->nb_rx_queues;
 	dev_info->max_tx_queues = dev->data->nb_tx_queues;