[v1,2/2] net/pfe: fix misuse of if_index
Checks
Commit Message
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
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.
@@ -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;