bnxt: fix unwanted interrupt config on link state change

Message ID 20230206171113.2176936-1-edwin.brossette@6wind.com (mailing list archive)
State Accepted, archived
Delegated to: Ajit Khaparde
Headers
Series bnxt: fix unwanted interrupt config on link state change |

Checks

Context Check Description
ci/checkpatch warning coding style issues
ci/loongarch-compilation success Compilation OK
ci/loongarch-unit-testing success Unit Testing PASS
ci/iol-mellanox-Performance success Performance Testing PASS
ci/iol-broadcom-Functional success Functional Testing PASS
ci/iol-broadcom-Performance success Performance Testing PASS
ci/github-robot: build fail github build: failed
ci/iol-intel-Functional success Functional Testing PASS
ci/iol-intel-Performance success Performance Testing PASS
ci/iol-aarch64-unit-testing success Testing PASS
ci/iol-testing success Testing PASS
ci/iol-x86_64-unit-testing success Testing PASS
ci/iol-x86_64-compile-testing success Testing PASS
ci/iol-aarch64-compile-testing success Testing PASS
ci/iol-abi-testing success Testing PASS
ci/Intel-compilation success Compilation OK
ci/intel-Testing success Testing PASS

Commit Message

edwin.brossette@6wind.com Feb. 6, 2023, 5:11 p.m. UTC
  From: Edwin Brossette <edwin.brossette@6wind.com>

When getting the device's info via bnxt_dev_info_get_op(), the device
enables interrupts on link state changes because of the following line:

  > eth_dev->data->dev_conf.intr_conf.lsc = 1;

Enabling this mode might not be wanted by the user.

The flag RTE_ETH_DEV_INTR_LSC can be used to inform the above
application that lsc interrupts are supported. Thus, checking this flag,
the user can decide whether or not to enable these interrupts.

Since there is no reason for a function meant to display config to
actually modify it, remove this line. In addition, raise the dev_flag
associated with this state on the device's intialization to show the
device supports link state change interrupts.

Fixes: 7bc8e9a227cc ("net/bnxt: support async link notification")
Signed-off-by: Edwin Brossette <edwin.brossette@6wind.com>
---
 drivers/net/bnxt/bnxt_ethdev.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
  

Comments

Somnath Kotur Feb. 7, 2023, 5:44 a.m. UTC | #1
On Mon, Feb 6, 2023 at 10:44 PM <edwin.brossette@6wind.com> wrote:
>
> From: Edwin Brossette <edwin.brossette@6wind.com>
>
> When getting the device's info via bnxt_dev_info_get_op(), the device
> enables interrupts on link state changes because of the following line:
>
>   > eth_dev->data->dev_conf.intr_conf.lsc = 1;
>
> Enabling this mode might not be wanted by the user.
>
> The flag RTE_ETH_DEV_INTR_LSC can be used to inform the above
> application that lsc interrupts are supported. Thus, checking this flag,
> the user can decide whether or not to enable these interrupts.
>
> Since there is no reason for a function meant to display config to
> actually modify it, remove this line. In addition, raise the dev_flag
> associated with this state on the device's intialization to show the
> device supports link state change interrupts.
>
> Fixes: 7bc8e9a227cc ("net/bnxt: support async link notification")
> Signed-off-by: Edwin Brossette <edwin.brossette@6wind.com>
> ---
>  drivers/net/bnxt/bnxt_ethdev.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/net/bnxt/bnxt_ethdev.c b/drivers/net/bnxt/bnxt_ethdev.c
> index b3de490d3667..753e86b4b2af 100644
> --- a/drivers/net/bnxt/bnxt_ethdev.c
> +++ b/drivers/net/bnxt/bnxt_ethdev.c
> @@ -1017,7 +1017,6 @@ static int bnxt_dev_info_get_op(struct rte_eth_dev *eth_dev,
>                 .tx_free_thresh = 32,
>                 .tx_rs_thresh = 32,
>         };
> -       eth_dev->data->dev_conf.intr_conf.lsc = 1;
>
>         dev_info->rx_desc_lim.nb_min = BNXT_MIN_RING_DESC;
>         dev_info->rx_desc_lim.nb_max = BNXT_MAX_RX_RING_DESC;
> @@ -5859,6 +5858,7 @@ bnxt_dev_init(struct rte_eth_dev *eth_dev, void *params __rte_unused)
>
>         rte_eth_copy_pci_info(eth_dev, pci_dev);
>         eth_dev->data->dev_flags |= RTE_ETH_DEV_AUTOFILL_QUEUE_XSTATS;
> +       eth_dev->data->dev_flags |= RTE_ETH_DEV_INTR_LSC;
>
>         bp = eth_dev->data->dev_private;
>
> --
> 2.35.0.4.g44a5d4affccf
>
Acked-by: Somnath Kotur <somnath.kotur@broadcom.com>
  
Ajit Khaparde Feb. 8, 2023, 6:19 p.m. UTC | #2
On Mon, Feb 6, 2023 at 9:44 PM Somnath Kotur <somnath.kotur@broadcom.com> wrote:
>
> On Mon, Feb 6, 2023 at 10:44 PM <edwin.brossette@6wind.com> wrote:
> >
> > From: Edwin Brossette <edwin.brossette@6wind.com>
> >
> > When getting the device's info via bnxt_dev_info_get_op(), the device
> > enables interrupts on link state changes because of the following line:
> >
> >   > eth_dev->data->dev_conf.intr_conf.lsc = 1;
> >
> > Enabling this mode might not be wanted by the user.
> >
> > The flag RTE_ETH_DEV_INTR_LSC can be used to inform the above
> > application that lsc interrupts are supported. Thus, checking this flag,
> > the user can decide whether or not to enable these interrupts.
> >
> > Since there is no reason for a function meant to display config to
> > actually modify it, remove this line. In addition, raise the dev_flag
> > associated with this state on the device's intialization to show the
> > device supports link state change interrupts.
> >
> > Fixes: 7bc8e9a227cc ("net/bnxt: support async link notification")
> > Signed-off-by: Edwin Brossette <edwin.brossette@6wind.com>
> > ---
> >  drivers/net/bnxt/bnxt_ethdev.c | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/drivers/net/bnxt/bnxt_ethdev.c b/drivers/net/bnxt/bnxt_ethdev.c
> > index b3de490d3667..753e86b4b2af 100644
> > --- a/drivers/net/bnxt/bnxt_ethdev.c
> > +++ b/drivers/net/bnxt/bnxt_ethdev.c
> > @@ -1017,7 +1017,6 @@ static int bnxt_dev_info_get_op(struct rte_eth_dev *eth_dev,
> >                 .tx_free_thresh = 32,
> >                 .tx_rs_thresh = 32,
> >         };
> > -       eth_dev->data->dev_conf.intr_conf.lsc = 1;
> >
> >         dev_info->rx_desc_lim.nb_min = BNXT_MIN_RING_DESC;
> >         dev_info->rx_desc_lim.nb_max = BNXT_MAX_RX_RING_DESC;
> > @@ -5859,6 +5858,7 @@ bnxt_dev_init(struct rte_eth_dev *eth_dev, void *params __rte_unused)
> >
> >         rte_eth_copy_pci_info(eth_dev, pci_dev);
> >         eth_dev->data->dev_flags |= RTE_ETH_DEV_AUTOFILL_QUEUE_XSTATS;
> > +       eth_dev->data->dev_flags |= RTE_ETH_DEV_INTR_LSC;
>
> >         bp = eth_dev->data->dev_private;
> >
> > --
> > 2.35.0.4.g44a5d4affccf
> >
> Acked-by: Somnath Kotur <somnath.kotur@broadcom.com>
Acked-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
Patch applied to dpdk-next-net-brcm. Thanks
  

Patch

diff --git a/drivers/net/bnxt/bnxt_ethdev.c b/drivers/net/bnxt/bnxt_ethdev.c
index b3de490d3667..753e86b4b2af 100644
--- a/drivers/net/bnxt/bnxt_ethdev.c
+++ b/drivers/net/bnxt/bnxt_ethdev.c
@@ -1017,7 +1017,6 @@  static int bnxt_dev_info_get_op(struct rte_eth_dev *eth_dev,
 		.tx_free_thresh = 32,
 		.tx_rs_thresh = 32,
 	};
-	eth_dev->data->dev_conf.intr_conf.lsc = 1;
 
 	dev_info->rx_desc_lim.nb_min = BNXT_MIN_RING_DESC;
 	dev_info->rx_desc_lim.nb_max = BNXT_MAX_RX_RING_DESC;
@@ -5859,6 +5858,7 @@  bnxt_dev_init(struct rte_eth_dev *eth_dev, void *params __rte_unused)
 
 	rte_eth_copy_pci_info(eth_dev, pci_dev);
 	eth_dev->data->dev_flags |= RTE_ETH_DEV_AUTOFILL_QUEUE_XSTATS;
+	eth_dev->data->dev_flags |= RTE_ETH_DEV_INTR_LSC;
 
 	bp = eth_dev->data->dev_private;