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

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

Checks

Context Check Description
ci/checkpatch success coding style OK

Commit Message

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

Dpaa2 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/dpaa2/dpaa2_ethdev.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
  

Comments

Ferruh Yigit Sept. 11, 2020, 1:05 p.m. UTC | #1
On 9/11/2020 10:37 AM, Sachin Saxena (OSS) wrote:
> From: Sachin Saxena <sachin.saxena@oss.nxp.com>
> 
> Dpaa2 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/dpaa2/dpaa2_ethdev.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/net/dpaa2/dpaa2_ethdev.c b/drivers/net/dpaa2/dpaa2_ethdev.c
> index 0e9f836e5..c91543131 100644
> --- a/drivers/net/dpaa2/dpaa2_ethdev.c
> +++ b/drivers/net/dpaa2/dpaa2_ethdev.c
> @@ -241,7 +241,7 @@ dpaa2_dev_info_get(struct rte_eth_dev *dev, struct rte_eth_dev_info *dev_info)
>  
>  	PMD_INIT_FUNC_TRACE();
>  
> -	dev_info->if_index = priv->hw_id;
> +	dev_info->if_index = 0;
>  

Same here, I think assignment can be dropped completely.
  

Patch

diff --git a/drivers/net/dpaa2/dpaa2_ethdev.c b/drivers/net/dpaa2/dpaa2_ethdev.c
index 0e9f836e5..c91543131 100644
--- a/drivers/net/dpaa2/dpaa2_ethdev.c
+++ b/drivers/net/dpaa2/dpaa2_ethdev.c
@@ -241,7 +241,7 @@  dpaa2_dev_info_get(struct rte_eth_dev *dev, struct rte_eth_dev_info *dev_info)
 
 	PMD_INIT_FUNC_TRACE();
 
-	dev_info->if_index = priv->hw_id;
+	dev_info->if_index = 0;
 
 	dev_info->max_mac_addrs = priv->max_mac_filters;
 	dev_info->max_rx_pktlen = DPAA2_MAX_RX_PKT_LEN;