DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH 1/2] net/bnxt: remove unnecessary check
@ 2022-09-27 15:59 Kalesh A P
  2022-09-27 15:59 ` [dpdk-dev] [PATCH 2/2] net/bnxt: fix freeing of representor info memory Kalesh A P
  2022-10-04  3:58 ` [dpdk-dev] [PATCH 1/2] net/bnxt: remove unnecessary check Ajit Khaparde
  0 siblings, 2 replies; 4+ messages in thread
From: Kalesh A P @ 2022-09-27 15:59 UTC (permalink / raw)
  To: dev; +Cc: ferruh.yigit, ajit.khaparde

From: Kalesh AP <kalesh-anakkur.purayil@broadcom.com>

We are not invoking rte_eth_switch_domain_free currently owing to
an unnecessary check. This patch fixes that.

Fixes: e2895305a5b5 ("net/bnxt: fix resource cleanup")
Cc: stable@dpdk.org

Signed-off-by: Kalesh AP <kalesh-anakkur.purayil@broadcom.com>
Reviewed-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
Reviewed-by: Somnath Kotur <somnath.kotur@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 e275d3a..84cf9a3 100644
--- a/drivers/net/bnxt/bnxt_ethdev.c
+++ b/drivers/net/bnxt/bnxt_ethdev.c
@@ -5977,8 +5977,7 @@ bnxt_uninit_resources(struct bnxt *bp, bool reconfig_dev)
 	bnxt_uninit_ctx_mem(bp);
 
 	bnxt_free_flow_stats_info(bp);
-	if (bp->rep_info != NULL)
-		bnxt_free_switch_domain(bp);
+	bnxt_free_switch_domain(bp);
 	bnxt_free_rep_info(bp);
 	rte_free(bp->ptp_cfg);
 	bp->ptp_cfg = NULL;
-- 
2.10.1


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

* [dpdk-dev] [PATCH 2/2] net/bnxt: fix freeing of representor info memory
  2022-09-27 15:59 [dpdk-dev] [PATCH 1/2] net/bnxt: remove unnecessary check Kalesh A P
@ 2022-09-27 15:59 ` Kalesh A P
  2022-10-04  3:59   ` Ajit Khaparde
  2022-10-04  3:58 ` [dpdk-dev] [PATCH 1/2] net/bnxt: remove unnecessary check Ajit Khaparde
  1 sibling, 1 reply; 4+ messages in thread
From: Kalesh A P @ 2022-09-27 15:59 UTC (permalink / raw)
  To: dev; +Cc: ferruh.yigit, ajit.khaparde

From: Kalesh AP <kalesh-anakkur.purayil@broadcom.com>

Driver allocates "bp->rep_info" inside bnxt_init_rep_info() which is
invoked from bnxt_rep_port_probe(). But the memory is freed inside
bnxt_uninit_resources(), which is wrong. As a result, after error
recovery bp->rep_info will be NULL. The memory should have freed inside
bnxt_drv_uninit() to maintain symmetry of calls.

Fixes: 6dc83230b43b ("net/bnxt: support port representor data path")
Cc: stable@dpdk.org

Signed-off-by: Kalesh AP <kalesh-anakkur.purayil@broadcom.com>
Reviewed-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
Reviewed-by: Somnath Kotur <somnath.kotur@broadcom.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 84cf9a3..b033ad7 100644
--- a/drivers/net/bnxt/bnxt_ethdev.c
+++ b/drivers/net/bnxt/bnxt_ethdev.c
@@ -1654,6 +1654,7 @@ static void bnxt_drv_uninit(struct bnxt *bp)
 	bnxt_free_link_info(bp);
 	bnxt_free_parent_info(bp);
 	bnxt_uninit_locks(bp);
+	bnxt_free_rep_info(bp);
 
 	rte_memzone_free((const struct rte_memzone *)bp->tx_mem_zone);
 	bp->tx_mem_zone = NULL;
@@ -5978,7 +5979,6 @@ bnxt_uninit_resources(struct bnxt *bp, bool reconfig_dev)
 
 	bnxt_free_flow_stats_info(bp);
 	bnxt_free_switch_domain(bp);
-	bnxt_free_rep_info(bp);
 	rte_free(bp->ptp_cfg);
 	bp->ptp_cfg = NULL;
 	return rc;
-- 
2.10.1


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

* Re: [dpdk-dev] [PATCH 1/2] net/bnxt: remove unnecessary check
  2022-09-27 15:59 [dpdk-dev] [PATCH 1/2] net/bnxt: remove unnecessary check Kalesh A P
  2022-09-27 15:59 ` [dpdk-dev] [PATCH 2/2] net/bnxt: fix freeing of representor info memory Kalesh A P
@ 2022-10-04  3:58 ` Ajit Khaparde
  1 sibling, 0 replies; 4+ messages in thread
From: Ajit Khaparde @ 2022-10-04  3:58 UTC (permalink / raw)
  To: Kalesh A P; +Cc: dev, ferruh.yigit

[-- Attachment #1: Type: text/plain, Size: 1256 bytes --]

On Tue, Sep 27, 2022 at 9:00 AM Kalesh A P
<kalesh-anakkur.purayil@broadcom.com> wrote:
>
> From: Kalesh AP <kalesh-anakkur.purayil@broadcom.com>
>
> We are not invoking rte_eth_switch_domain_free currently owing to
> an unnecessary check. This patch fixes that.
>
> Fixes: e2895305a5b5 ("net/bnxt: fix resource cleanup")
> Cc: stable@dpdk.org
>
> Signed-off-by: Kalesh AP <kalesh-anakkur.purayil@broadcom.com>
> Reviewed-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
> Reviewed-by: Somnath Kotur <somnath.kotur@broadcom.com>
Patch applied to dpdk-next-net-brcm. Thanks

> ---
>  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 e275d3a..84cf9a3 100644
> --- a/drivers/net/bnxt/bnxt_ethdev.c
> +++ b/drivers/net/bnxt/bnxt_ethdev.c
> @@ -5977,8 +5977,7 @@ bnxt_uninit_resources(struct bnxt *bp, bool reconfig_dev)
>         bnxt_uninit_ctx_mem(bp);
>
>         bnxt_free_flow_stats_info(bp);
> -       if (bp->rep_info != NULL)
> -               bnxt_free_switch_domain(bp);
> +       bnxt_free_switch_domain(bp);
>         bnxt_free_rep_info(bp);
>         rte_free(bp->ptp_cfg);
>         bp->ptp_cfg = NULL;
> --
> 2.10.1
>

[-- Attachment #2: S/MIME Cryptographic Signature --]
[-- Type: application/pkcs7-signature, Size: 4218 bytes --]

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

* Re: [dpdk-dev] [PATCH 2/2] net/bnxt: fix freeing of representor info memory
  2022-09-27 15:59 ` [dpdk-dev] [PATCH 2/2] net/bnxt: fix freeing of representor info memory Kalesh A P
@ 2022-10-04  3:59   ` Ajit Khaparde
  0 siblings, 0 replies; 4+ messages in thread
From: Ajit Khaparde @ 2022-10-04  3:59 UTC (permalink / raw)
  To: Kalesh A P; +Cc: dev, ferruh.yigit

[-- Attachment #1: Type: text/plain, Size: 803 bytes --]

On Tue, Sep 27, 2022 at 9:00 AM Kalesh A P
<kalesh-anakkur.purayil@broadcom.com> wrote:
>
> From: Kalesh AP <kalesh-anakkur.purayil@broadcom.com>
>
> Driver allocates "bp->rep_info" inside bnxt_init_rep_info() which is
> invoked from bnxt_rep_port_probe(). But the memory is freed inside
> bnxt_uninit_resources(), which is wrong. As a result, after error
> recovery bp->rep_info will be NULL. The memory should have freed inside
> bnxt_drv_uninit() to maintain symmetry of calls.
>
> Fixes: 6dc83230b43b ("net/bnxt: support port representor data path")
> Cc: stable@dpdk.org
>
> Signed-off-by: Kalesh AP <kalesh-anakkur.purayil@broadcom.com>
> Reviewed-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
> Reviewed-by: Somnath Kotur <somnath.kotur@broadcom.com>
Patch applied to dpdk-next-net-brcm, Thanks

[-- Attachment #2: S/MIME Cryptographic Signature --]
[-- Type: application/pkcs7-signature, Size: 4218 bytes --]

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

end of thread, other threads:[~2022-10-04  4:00 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-09-27 15:59 [dpdk-dev] [PATCH 1/2] net/bnxt: remove unnecessary check Kalesh A P
2022-09-27 15:59 ` [dpdk-dev] [PATCH 2/2] net/bnxt: fix freeing of representor info memory Kalesh A P
2022-10-04  3:59   ` Ajit Khaparde
2022-10-04  3:58 ` [dpdk-dev] [PATCH 1/2] net/bnxt: remove unnecessary check Ajit Khaparde

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).