DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH] net/bnxt: fix a segfault during close
@ 2020-05-22 21:27 Ajit Khaparde
  2020-05-23  0:26 ` Ajit Khaparde
  0 siblings, 1 reply; 2+ messages in thread
From: Ajit Khaparde @ 2020-05-22 21:27 UTC (permalink / raw)
  To: dev; +Cc: ferruh.yigit

We are freeing flow_stats a little early. This results in a
segfault when the driver accesses the members during cleanup.
Move the call to bnxt_free_flow_stats_info() to prevent this.

Fixes: 02a95625fe9c ("net/bnxt: add flow stats in extended stats")
Signed-off-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
---
 drivers/net/bnxt/bnxt_ethdev.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/net/bnxt/bnxt_ethdev.c b/drivers/net/bnxt/bnxt_ethdev.c
index e63578109..e8b4c058a 100644
--- a/drivers/net/bnxt/bnxt_ethdev.c
+++ b/drivers/net/bnxt/bnxt_ethdev.c
@@ -221,8 +221,6 @@ static void bnxt_free_cos_queues(struct bnxt *bp)
 
 static void bnxt_free_mem(struct bnxt *bp, bool reconfig)
 {
-	bnxt_free_flow_stats_info(bp);
-
 	bnxt_free_filter_mem(bp);
 	bnxt_free_vnic_attributes(bp);
 	bnxt_free_vnic_mem(bp);
@@ -5613,6 +5611,7 @@ bnxt_uninit_resources(struct bnxt *bp, bool reconfig_dev)
 	bnxt_uninit_ctx_mem(bp);
 
 	bnxt_uninit_locks(bp);
+	bnxt_free_flow_stats_info(bp);
 	rte_free(bp->ptp_cfg);
 	bp->ptp_cfg = NULL;
 	return rc;
-- 
2.21.1 (Apple Git-122.3)


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [dpdk-dev] [PATCH] net/bnxt: fix a segfault during close
  2020-05-22 21:27 [dpdk-dev] [PATCH] net/bnxt: fix a segfault during close Ajit Khaparde
@ 2020-05-23  0:26 ` Ajit Khaparde
  0 siblings, 0 replies; 2+ messages in thread
From: Ajit Khaparde @ 2020-05-23  0:26 UTC (permalink / raw)
  To: dpdk-dev; +Cc: Ferruh Yigit

On Fri, May 22, 2020 at 2:27 PM Ajit Khaparde <ajit.khaparde@broadcom.com>
wrote:

> We are freeing flow_stats a little early. This results in a
> segfault when the driver accesses the members during cleanup.
> Move the call to bnxt_free_flow_stats_info() to prevent this.
>
> Fixes: 02a95625fe9c ("net/bnxt: add flow stats in extended stats")
> Signed-off-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
>
Patch applied to dpdk-next-net-brcm.


> ---
>  drivers/net/bnxt/bnxt_ethdev.c | 3 +--
>  1 file changed, 1 insertion(+), 2 deletions(-)
>
> diff --git a/drivers/net/bnxt/bnxt_ethdev.c
> b/drivers/net/bnxt/bnxt_ethdev.c
> index e63578109..e8b4c058a 100644
> --- a/drivers/net/bnxt/bnxt_ethdev.c
> +++ b/drivers/net/bnxt/bnxt_ethdev.c
> @@ -221,8 +221,6 @@ static void bnxt_free_cos_queues(struct bnxt *bp)
>
>  static void bnxt_free_mem(struct bnxt *bp, bool reconfig)
>  {
> -       bnxt_free_flow_stats_info(bp);
> -
>         bnxt_free_filter_mem(bp);
>         bnxt_free_vnic_attributes(bp);
>         bnxt_free_vnic_mem(bp);
> @@ -5613,6 +5611,7 @@ bnxt_uninit_resources(struct bnxt *bp, bool
> reconfig_dev)
>         bnxt_uninit_ctx_mem(bp);
>
>         bnxt_uninit_locks(bp);
> +       bnxt_free_flow_stats_info(bp);
>         rte_free(bp->ptp_cfg);
>         bp->ptp_cfg = NULL;
>         return rc;
> --
> 2.21.1 (Apple Git-122.3)
>
>

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2020-05-23  0:27 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-05-22 21:27 [dpdk-dev] [PATCH] net/bnxt: fix a segfault during close Ajit Khaparde
2020-05-23  0:26 ` Ajit Khaparde

DPDK patches and discussions

This inbox may be cloned and mirrored by anyone:

	git clone --mirror https://inbox.dpdk.org/dev/0 dev/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 dev dev/ https://inbox.dpdk.org/dev \
		dev@dpdk.org
	public-inbox-index dev

Example config snippet for mirrors.
Newsgroup available over NNTP:
	nntp://inbox.dpdk.org/inbox.dpdk.dev


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git