DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev]  [PATCH] net/bnxt: fix UDP tunnel port remove
@ 2020-10-12 15:44 Kalesh A P
  2020-10-14 23:27 ` Ajit Khaparde
  0 siblings, 1 reply; 2+ messages in thread
From: Kalesh A P @ 2020-10-12 15:44 UTC (permalink / raw)
  To: dev; +Cc: ajit.khaparde

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

The HWRM supports only one global destination port for a tunnel type.

When port is stopped, driver deletes the UDP tunnel port configured
in the HW, but it does not update the counter which causes the
tunnel port addition to fail after port is started again.

Fixed to update the counter when tunnel port is deleted.

Fixes: 10d074b2022d ("net/bnxt: support tunneling")
Cc: stable@dpdk.org

Signed-off-by: Kalesh AP <kalesh-anakkur.purayil@broadcom.com>
Reviewed-by: Ajit Kumar Khaparde <ajit.khaparde@broadcom.com>
Reviewed-by: Somnath Kotur <somnath.kotur@broadcom.com>
---
 drivers/net/bnxt/bnxt_ethdev.c |  8 --------
 drivers/net/bnxt/bnxt_hwrm.c   | 15 +++++++++++++--
 2 files changed, 13 insertions(+), 10 deletions(-)

diff --git a/drivers/net/bnxt/bnxt_ethdev.c b/drivers/net/bnxt/bnxt_ethdev.c
index 8b63134..6c1025e 100644
--- a/drivers/net/bnxt/bnxt_ethdev.c
+++ b/drivers/net/bnxt/bnxt_ethdev.c
@@ -2192,14 +2192,6 @@ bnxt_udp_tunnel_port_del_op(struct rte_eth_dev *eth_dev,
 	}
 
 	rc = bnxt_hwrm_tunnel_dst_port_free(bp, port, tunnel_type);
-	if (!rc) {
-		if (tunnel_type ==
-		    HWRM_TUNNEL_DST_PORT_FREE_INPUT_TUNNEL_TYPE_VXLAN)
-			bp->vxlan_port = 0;
-		if (tunnel_type ==
-		    HWRM_TUNNEL_DST_PORT_FREE_INPUT_TUNNEL_TYPE_GENEVE)
-			bp->geneve_port = 0;
-	}
 	return rc;
 }
 
diff --git a/drivers/net/bnxt/bnxt_hwrm.c b/drivers/net/bnxt/bnxt_hwrm.c
index faeaf4b..a495dac 100644
--- a/drivers/net/bnxt/bnxt_hwrm.c
+++ b/drivers/net/bnxt/bnxt_hwrm.c
@@ -2750,11 +2750,10 @@ bnxt_free_tunnel_ports(struct bnxt *bp)
 	if (bp->vxlan_port_cnt)
 		bnxt_hwrm_tunnel_dst_port_free(bp, bp->vxlan_fw_dst_port_id,
 			HWRM_TUNNEL_DST_PORT_FREE_INPUT_TUNNEL_TYPE_VXLAN);
-	bp->vxlan_port = 0;
+
 	if (bp->geneve_port_cnt)
 		bnxt_hwrm_tunnel_dst_port_free(bp, bp->geneve_fw_dst_port_id,
 			HWRM_TUNNEL_DST_PORT_FREE_INPUT_TUNNEL_TYPE_GENEVE);
-	bp->geneve_port = 0;
 }
 
 void bnxt_free_all_hwrm_resources(struct bnxt *bp)
@@ -3713,6 +3712,18 @@ int bnxt_hwrm_tunnel_dst_port_free(struct bnxt *bp, uint16_t port,
 	HWRM_CHECK_RESULT();
 	HWRM_UNLOCK();
 
+	if (tunnel_type ==
+	    HWRM_TUNNEL_DST_PORT_FREE_INPUT_TUNNEL_TYPE_VXLAN) {
+		bp->vxlan_port = 0;
+		bp->vxlan_port_cnt = 0;
+	}
+
+	if (tunnel_type ==
+	    HWRM_TUNNEL_DST_PORT_FREE_INPUT_TUNNEL_TYPE_GENEVE) {
+		bp->geneve_port = 0;
+		bp->geneve_port_cnt = 0;
+	}
+
 	return rc;
 }
 
-- 
2.10.1


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

* Re: [dpdk-dev] [PATCH] net/bnxt: fix UDP tunnel port remove
  2020-10-12 15:44 [dpdk-dev] [PATCH] net/bnxt: fix UDP tunnel port remove Kalesh A P
@ 2020-10-14 23:27 ` Ajit Khaparde
  0 siblings, 0 replies; 2+ messages in thread
From: Ajit Khaparde @ 2020-10-14 23:27 UTC (permalink / raw)
  To: Kalesh A P; +Cc: dpdk-dev

On Mon, Oct 12, 2020 at 8:30 AM Kalesh A P
<kalesh-anakkur.purayil@broadcom.com> wrote:
>
> From: Kalesh AP <kalesh-anakkur.purayil@broadcom.com>
>
> The HWRM supports only one global destination port for a tunnel type.
>
> When port is stopped, driver deletes the UDP tunnel port configured
> in the HW, but it does not update the counter which causes the
> tunnel port addition to fail after port is started again.
>
> Fixed to update the counter when tunnel port is deleted.
>
> Fixes: 10d074b2022d ("net/bnxt: support tunneling")
> Cc: stable@dpdk.org
>
> Signed-off-by: Kalesh AP <kalesh-anakkur.purayil@broadcom.com>
> Reviewed-by: Ajit Kumar 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 |  8 --------
>  drivers/net/bnxt/bnxt_hwrm.c   | 15 +++++++++++++--
>  2 files changed, 13 insertions(+), 10 deletions(-)
>
> diff --git a/drivers/net/bnxt/bnxt_ethdev.c b/drivers/net/bnxt/bnxt_ethdev.c
> index 8b63134..6c1025e 100644
> --- a/drivers/net/bnxt/bnxt_ethdev.c
> +++ b/drivers/net/bnxt/bnxt_ethdev.c
> @@ -2192,14 +2192,6 @@ bnxt_udp_tunnel_port_del_op(struct rte_eth_dev *eth_dev,
>         }
>
>         rc = bnxt_hwrm_tunnel_dst_port_free(bp, port, tunnel_type);
> -       if (!rc) {
> -               if (tunnel_type ==
> -                   HWRM_TUNNEL_DST_PORT_FREE_INPUT_TUNNEL_TYPE_VXLAN)
> -                       bp->vxlan_port = 0;
> -               if (tunnel_type ==
> -                   HWRM_TUNNEL_DST_PORT_FREE_INPUT_TUNNEL_TYPE_GENEVE)
> -                       bp->geneve_port = 0;
> -       }
>         return rc;
>  }
>
> diff --git a/drivers/net/bnxt/bnxt_hwrm.c b/drivers/net/bnxt/bnxt_hwrm.c
> index faeaf4b..a495dac 100644
> --- a/drivers/net/bnxt/bnxt_hwrm.c
> +++ b/drivers/net/bnxt/bnxt_hwrm.c
> @@ -2750,11 +2750,10 @@ bnxt_free_tunnel_ports(struct bnxt *bp)
>         if (bp->vxlan_port_cnt)
>                 bnxt_hwrm_tunnel_dst_port_free(bp, bp->vxlan_fw_dst_port_id,
>                         HWRM_TUNNEL_DST_PORT_FREE_INPUT_TUNNEL_TYPE_VXLAN);
> -       bp->vxlan_port = 0;
> +
>         if (bp->geneve_port_cnt)
>                 bnxt_hwrm_tunnel_dst_port_free(bp, bp->geneve_fw_dst_port_id,
>                         HWRM_TUNNEL_DST_PORT_FREE_INPUT_TUNNEL_TYPE_GENEVE);
> -       bp->geneve_port = 0;
>  }
>
>  void bnxt_free_all_hwrm_resources(struct bnxt *bp)
> @@ -3713,6 +3712,18 @@ int bnxt_hwrm_tunnel_dst_port_free(struct bnxt *bp, uint16_t port,
>         HWRM_CHECK_RESULT();
>         HWRM_UNLOCK();
>
> +       if (tunnel_type ==
> +           HWRM_TUNNEL_DST_PORT_FREE_INPUT_TUNNEL_TYPE_VXLAN) {
> +               bp->vxlan_port = 0;
> +               bp->vxlan_port_cnt = 0;
> +       }
> +
> +       if (tunnel_type ==
> +           HWRM_TUNNEL_DST_PORT_FREE_INPUT_TUNNEL_TYPE_GENEVE) {
> +               bp->geneve_port = 0;
> +               bp->geneve_port_cnt = 0;
> +       }
> +
>         return rc;
>  }
>
> --
> 2.10.1
>

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

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

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-10-12 15:44 [dpdk-dev] [PATCH] net/bnxt: fix UDP tunnel port remove Kalesh A P
2020-10-14 23:27 ` 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