DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev]  [PATCH] net/octeontx2: disable HIGIG on port stop
@ 2020-01-24 13:54 kirankumark
  2020-01-28 11:27 ` Jerin Jacob
  0 siblings, 1 reply; 2+ messages in thread
From: kirankumark @ 2020-01-24 13:54 UTC (permalink / raw)
  To: Jerin Jacob, Nithin Dabilpuram, Kiran Kumar K; +Cc: dev

From: Kiran Kumar K <kirankumark@marvell.com>

If HIGIG mode is enabled on configure, This needs to be disabled
on port stop. Adding support to send mbox message on port stop
to configure the port to default.

Signed-off-by: Kiran Kumar K <kirankumark@marvell.com>
---
 drivers/net/octeontx2/otx2_ethdev.c | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/drivers/net/octeontx2/otx2_ethdev.c b/drivers/net/octeontx2/otx2_ethdev.c
index 268b383db..11f8c786b 100644
--- a/drivers/net/octeontx2/otx2_ethdev.c
+++ b/drivers/net/octeontx2/otx2_ethdev.c
@@ -93,7 +93,7 @@ nix_lf_alloc(struct otx2_eth_dev *dev, uint32_t nb_rxq, uint32_t nb_txq)
 }
 
 static int
-nix_lf_switch_header_type_enable(struct otx2_eth_dev *dev)
+nix_lf_switch_header_type_enable(struct otx2_eth_dev *dev, bool enable)
 {
 	struct otx2_mbox *mbox = dev->mbox;
 	struct npc_set_pkind *req;
@@ -106,12 +106,16 @@ nix_lf_switch_header_type_enable(struct otx2_eth_dev *dev)
 	/* Notify AF about higig2 config */
 	req = otx2_mbox_alloc_msg_npc_set_pkind(mbox);
 	req->mode = dev->npc_flow.switch_header_type;
+	if (enable == 0)
+		req->mode = OTX2_PRIV_FLAGS_DEFAULT;
 	req->dir = PKIND_RX;
 	rc = otx2_mbox_process_msg(mbox, (void *)&rsp);
 	if (rc)
 		return rc;
 	req = otx2_mbox_alloc_msg_npc_set_pkind(mbox);
 	req->mode = dev->npc_flow.switch_header_type;
+	if (enable == 0)
+		req->mode = OTX2_PRIV_FLAGS_DEFAULT;
 	req->dir = PKIND_TX;
 	return otx2_mbox_process_msg(mbox, (void *)&rsp);
 }
@@ -1648,7 +1652,7 @@ otx2_nix_configure(struct rte_eth_dev *eth_dev)
 		goto free_nix_lf;
 	}
 
-	rc = nix_lf_switch_header_type_enable(dev);
+	rc = nix_lf_switch_header_type_enable(dev, true);
 	if (rc) {
 		otx2_err("Failed to enable switch type nix_lf rc=%d", rc);
 		goto free_nix_lf;
@@ -1882,6 +1886,7 @@ otx2_nix_dev_stop(struct rte_eth_dev *eth_dev)
 	struct otx2_eth_rxq *rxq;
 	int count, i, j, rc;
 
+	nix_lf_switch_header_type_enable(dev, false);
 	nix_cgx_stop_link_event(dev);
 	npc_rx_disable(dev);
 
-- 
2.17.1


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

* Re: [dpdk-dev] [PATCH] net/octeontx2: disable HIGIG on port stop
  2020-01-24 13:54 [dpdk-dev] [PATCH] net/octeontx2: disable HIGIG on port stop kirankumark
@ 2020-01-28 11:27 ` Jerin Jacob
  0 siblings, 0 replies; 2+ messages in thread
From: Jerin Jacob @ 2020-01-28 11:27 UTC (permalink / raw)
  To: Kiran Kumar K, Ferruh Yigit; +Cc: Jerin Jacob, Nithin Dabilpuram, dpdk-dev

On Fri, Jan 24, 2020 at 7:25 PM <kirankumark@marvell.com> wrote:
>
> From: Kiran Kumar K <kirankumark@marvell.com>
>
> If HIGIG mode is enabled on configure, This needs to be disabled
> on port stop. Adding support to send mbox message on port stop
> to configure the port to default.
>
> Signed-off-by: Kiran Kumar K <kirankumark@marvell.com>

Acked-by: Jerin Jacob <jerinj@marvell.com>
Applied to dpdk-next-net-mrvl/master. Thanks


> ---
>  drivers/net/octeontx2/otx2_ethdev.c | 9 +++++++--
>  1 file changed, 7 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/net/octeontx2/otx2_ethdev.c b/drivers/net/octeontx2/otx2_ethdev.c
> index 268b383db..11f8c786b 100644
> --- a/drivers/net/octeontx2/otx2_ethdev.c
> +++ b/drivers/net/octeontx2/otx2_ethdev.c
> @@ -93,7 +93,7 @@ nix_lf_alloc(struct otx2_eth_dev *dev, uint32_t nb_rxq, uint32_t nb_txq)
>  }
>
>  static int
> -nix_lf_switch_header_type_enable(struct otx2_eth_dev *dev)
> +nix_lf_switch_header_type_enable(struct otx2_eth_dev *dev, bool enable)
>  {
>         struct otx2_mbox *mbox = dev->mbox;
>         struct npc_set_pkind *req;
> @@ -106,12 +106,16 @@ nix_lf_switch_header_type_enable(struct otx2_eth_dev *dev)
>         /* Notify AF about higig2 config */
>         req = otx2_mbox_alloc_msg_npc_set_pkind(mbox);
>         req->mode = dev->npc_flow.switch_header_type;
> +       if (enable == 0)
> +               req->mode = OTX2_PRIV_FLAGS_DEFAULT;
>         req->dir = PKIND_RX;
>         rc = otx2_mbox_process_msg(mbox, (void *)&rsp);
>         if (rc)
>                 return rc;
>         req = otx2_mbox_alloc_msg_npc_set_pkind(mbox);
>         req->mode = dev->npc_flow.switch_header_type;
> +       if (enable == 0)
> +               req->mode = OTX2_PRIV_FLAGS_DEFAULT;
>         req->dir = PKIND_TX;
>         return otx2_mbox_process_msg(mbox, (void *)&rsp);
>  }
> @@ -1648,7 +1652,7 @@ otx2_nix_configure(struct rte_eth_dev *eth_dev)
>                 goto free_nix_lf;
>         }
>
> -       rc = nix_lf_switch_header_type_enable(dev);
> +       rc = nix_lf_switch_header_type_enable(dev, true);
>         if (rc) {
>                 otx2_err("Failed to enable switch type nix_lf rc=%d", rc);
>                 goto free_nix_lf;
> @@ -1882,6 +1886,7 @@ otx2_nix_dev_stop(struct rte_eth_dev *eth_dev)
>         struct otx2_eth_rxq *rxq;
>         int count, i, j, rc;
>
> +       nix_lf_switch_header_type_enable(dev, false);
>         nix_cgx_stop_link_event(dev);
>         npc_rx_disable(dev);
>
> --
> 2.17.1
>

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

end of thread, other threads:[~2020-01-28 11:27 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-01-24 13:54 [dpdk-dev] [PATCH] net/octeontx2: disable HIGIG on port stop kirankumark
2020-01-28 11:27 ` Jerin Jacob

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).