DPDK patches and discussions
 help / color / mirror / Atom feed
* [PATCH 1/2] common/cnxk: revert check on bitmap for tm
@ 2022-03-03  7:00 Nithin Dabilpuram
  2022-03-03  7:00 ` [PATCH 2/2] common/cnxk: fix VF data offset Nithin Dabilpuram
  2022-03-03 17:33 ` [PATCH 1/2] common/cnxk: revert check on bitmap for tm Jerin Jacob
  0 siblings, 2 replies; 4+ messages in thread
From: Nithin Dabilpuram @ 2022-03-03  7:00 UTC (permalink / raw)
  To: jerinj, Nithin Dabilpuram, Kiran Kumar K, Sunil Kumar Kori, Satha Rao
  Cc: dev, gmuthukrishn

Revert change to return error on case where no slab of free
resources is found. That error check break's a case where
there is a spare schq to be reused that was just allocated
for sake of contiguous static TM nodes.

Fixes: 14f7e5d4bf2d ("common/cnxk: add missing checks of return values")
Cc: gmuthukrishn@marvell.com

Signed-off-by: Nithin Dabilpuram <ndabilpuram@marvell.com>
---
 drivers/common/cnxk/roc_nix_tm.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/common/cnxk/roc_nix_tm.c b/drivers/common/cnxk/roc_nix_tm.c
index 7a17780..5b70c7b 100644
--- a/drivers/common/cnxk/roc_nix_tm.c
+++ b/drivers/common/cnxk/roc_nix_tm.c
@@ -1042,10 +1042,8 @@ nix_tm_assign_hw_id(struct nix *nix, struct nix_tm_node *parent,
 			return -EFAULT;
 		}
 
-		if (!slab) {
-			if (!plt_bitmap_scan(bmp, &pos, &slab))
-				return -ENOENT;
-		}
+		if (!slab)
+			plt_bitmap_scan(bmp, &pos, &slab);
 
 		if (child->priority == parent->rr_prio && spare_schq != -1) {
 			/* Use spare schq first if present */
-- 
2.8.4


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

* [PATCH 2/2] common/cnxk: fix VF data offset
  2022-03-03  7:00 [PATCH 1/2] common/cnxk: revert check on bitmap for tm Nithin Dabilpuram
@ 2022-03-03  7:00 ` Nithin Dabilpuram
  2022-03-03 17:35   ` Jerin Jacob
  2022-03-03 17:33 ` [PATCH 1/2] common/cnxk: revert check on bitmap for tm Jerin Jacob
  1 sibling, 1 reply; 4+ messages in thread
From: Nithin Dabilpuram @ 2022-03-03  7:00 UTC (permalink / raw)
  To: jerinj, Nithin Dabilpuram, Kiran Kumar K, Sunil Kumar Kori,
	Satha Rao, Ray Kinsella
  Cc: dev, Harman Kalra

From: Harman Kalra <hkalra@marvell.com>

Data offset should be adjusted for VF to skip extra 8 bytes of timestamp,
if its PF has PTP enabled.

Fixes: c443e0d326e1 ("common/cnxk: support NIX PTP")
Cc: skori@marvell.com

Signed-off-by: Harman Kalra <hkalra@marvell.com>
---
 drivers/common/cnxk/roc_nix.h     | 1 +
 drivers/common/cnxk/roc_nix_ptp.c | 8 ++++++++
 drivers/common/cnxk/version.map   | 1 +
 drivers/net/cnxk/cnxk_ethdev.c    | 4 ++++
 4 files changed, 14 insertions(+)

diff --git a/drivers/common/cnxk/roc_nix.h b/drivers/common/cnxk/roc_nix.h
index 5e6eb58..dbb816d 100644
--- a/drivers/common/cnxk/roc_nix.h
+++ b/drivers/common/cnxk/roc_nix.h
@@ -864,6 +864,7 @@ int __roc_api roc_nix_ptp_sync_time_adjust(struct roc_nix *roc_nix,
 int __roc_api roc_nix_ptp_info_cb_register(struct roc_nix *roc_nix,
 					   ptp_info_update_t ptp_update);
 void __roc_api roc_nix_ptp_info_cb_unregister(struct roc_nix *roc_nix);
+bool __roc_api roc_nix_ptp_is_enable(struct roc_nix *roc_nix);
 
 /* VLAN */
 int __roc_api
diff --git a/drivers/common/cnxk/roc_nix_ptp.c b/drivers/common/cnxk/roc_nix_ptp.c
index 03c4c6e..05e4211 100644
--- a/drivers/common/cnxk/roc_nix_ptp.c
+++ b/drivers/common/cnxk/roc_nix_ptp.c
@@ -120,3 +120,11 @@ roc_nix_ptp_info_cb_unregister(struct roc_nix *roc_nix)
 
 	dev->ops->ptp_info_update = NULL;
 }
+
+bool
+roc_nix_ptp_is_enable(struct roc_nix *roc_nix)
+{
+	struct nix *nix = roc_nix_to_nix_priv(roc_nix);
+
+	return nix->ptp_en;
+}
diff --git a/drivers/common/cnxk/version.map b/drivers/common/cnxk/version.map
index d346e6f..2a122e5 100644
--- a/drivers/common/cnxk/version.map
+++ b/drivers/common/cnxk/version.map
@@ -206,6 +206,7 @@ INTERNAL {
 	roc_nix_ptp_clock_read;
 	roc_nix_ptp_info_cb_register;
 	roc_nix_ptp_info_cb_unregister;
+	roc_nix_ptp_is_enable;
 	roc_nix_ptp_rx_ena_dis;
 	roc_nix_ptp_sync_time_adjust;
 	roc_nix_ptp_tx_ena_dis;
diff --git a/drivers/net/cnxk/cnxk_ethdev.c b/drivers/net/cnxk/cnxk_ethdev.c
index deb95ae..1fa4131 100644
--- a/drivers/net/cnxk/cnxk_ethdev.c
+++ b/drivers/net/cnxk/cnxk_ethdev.c
@@ -1123,6 +1123,10 @@ cnxk_nix_configure(struct rte_eth_dev *eth_dev)
 		goto fail_configure;
 	}
 
+	/* Check if ptp is enable in PF owning this VF*/
+	if (!roc_nix_is_pf(nix) && (!roc_nix_is_sdp(nix)))
+		dev->ptp_en = roc_nix_ptp_is_enable(nix);
+
 	dev->npc.channel = roc_nix_get_base_chan(nix);
 
 	nb_rxq = data->nb_rx_queues;
-- 
2.8.4


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

* Re: [PATCH 1/2] common/cnxk: revert check on bitmap for tm
  2022-03-03  7:00 [PATCH 1/2] common/cnxk: revert check on bitmap for tm Nithin Dabilpuram
  2022-03-03  7:00 ` [PATCH 2/2] common/cnxk: fix VF data offset Nithin Dabilpuram
@ 2022-03-03 17:33 ` Jerin Jacob
  1 sibling, 0 replies; 4+ messages in thread
From: Jerin Jacob @ 2022-03-03 17:33 UTC (permalink / raw)
  To: Nithin Dabilpuram, Ferruh Yigit
  Cc: Jerin Jacob, Kiran Kumar K, Sunil Kumar Kori, Satha Rao,
	dpdk-dev, Gowrishankar Muthukrishnan

On Thu, Mar 3, 2022 at 12:30 PM Nithin Dabilpuram
<ndabilpuram@marvell.com> wrote:
>
> Revert change to return error on case where no slab of free
> resources is found. That error check break's a case where
> there is a spare schq to be reused that was just allocated
> for sake of contiguous static TM nodes.
>
> Fixes: 14f7e5d4bf2d ("common/cnxk: add missing checks of return values")
> Cc: gmuthukrishn@marvell.com
>
> Signed-off-by: Nithin Dabilpuram <ndabilpuram@marvell.com>

Acked-by: Jerin Jacob <jerinj@marvell.com>

Updated the git commit as follows and applied to
dpdk-next-net-mrvl/for-next-net. Thanks

    common/cnxk: fix bitmap usage for TM

    Revert change [1] to return error on case where no slab of free
    resources is found. That error check break's a case where
    there is a spare schedule queue to be reused that was just
    allocated for sake of contiguous static TM nodes.

    [1]
    Fixes: 14f7e5d4bf2d ("common/cnxk: add missing checks of return values")

    Signed-off-by: Nithin Dabilpuram <ndabilpuram@marvell.com>
    Acked-by: Jerin Jacob <jerinj@marvell.com>

> ---
>  drivers/common/cnxk/roc_nix_tm.c | 6 ++----
>  1 file changed, 2 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/common/cnxk/roc_nix_tm.c b/drivers/common/cnxk/roc_nix_tm.c
> index 7a17780..5b70c7b 100644
> --- a/drivers/common/cnxk/roc_nix_tm.c
> +++ b/drivers/common/cnxk/roc_nix_tm.c
> @@ -1042,10 +1042,8 @@ nix_tm_assign_hw_id(struct nix *nix, struct nix_tm_node *parent,
>                         return -EFAULT;
>                 }
>
> -               if (!slab) {
> -                       if (!plt_bitmap_scan(bmp, &pos, &slab))
> -                               return -ENOENT;
> -               }
> +               if (!slab)
> +                       plt_bitmap_scan(bmp, &pos, &slab);
>
>                 if (child->priority == parent->rr_prio && spare_schq != -1) {
>                         /* Use spare schq first if present */
> --
> 2.8.4
>

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

* Re: [PATCH 2/2] common/cnxk: fix VF data offset
  2022-03-03  7:00 ` [PATCH 2/2] common/cnxk: fix VF data offset Nithin Dabilpuram
@ 2022-03-03 17:35   ` Jerin Jacob
  0 siblings, 0 replies; 4+ messages in thread
From: Jerin Jacob @ 2022-03-03 17:35 UTC (permalink / raw)
  To: Nithin Dabilpuram
  Cc: Jerin Jacob, Kiran Kumar K, Sunil Kumar Kori, Satha Rao,
	Ray Kinsella, dpdk-dev, Harman Kalra

On Thu, Mar 3, 2022 at 12:31 PM Nithin Dabilpuram
<ndabilpuram@marvell.com> wrote:
>
> From: Harman Kalra <hkalra@marvell.com>
>
> Data offset should be adjusted for VF to skip extra 8 bytes of timestamp,
> if its PF has PTP enabled.
>
> Fixes: c443e0d326e1 ("common/cnxk: support NIX PTP")
> Cc: skori@marvell.com
>
> Signed-off-by: Harman Kalra <hkalra@marvell.com>

Acked-by: Jerin Jacob <jerinj@marvell.com>

Updated the git commit as follows and applied to
dpdk-next-net-mrvl/for-next-net. Thanks

    common/cnxk: fix mbuf data offset for VF

    If PF has PTP enabled the data offset should be adjusted for VF to
    skip extra 8 bytes of timestamp as the MAC inserts 8 bytes before
    the ethernet header.

    Fixes: c443e0d326e1 ("common/cnxk: support NIX PTP")
    Cc: stable@dpdk.org

    Signed-off-by: Harman Kalra <hkalra@marvell.com>
    Acked-by: Jerin Jacob <jerinj@marvell.com>



> ---
>  drivers/common/cnxk/roc_nix.h     | 1 +
>  drivers/common/cnxk/roc_nix_ptp.c | 8 ++++++++
>  drivers/common/cnxk/version.map   | 1 +
>  drivers/net/cnxk/cnxk_ethdev.c    | 4 ++++
>  4 files changed, 14 insertions(+)
>
> diff --git a/drivers/common/cnxk/roc_nix.h b/drivers/common/cnxk/roc_nix.h
> index 5e6eb58..dbb816d 100644
> --- a/drivers/common/cnxk/roc_nix.h
> +++ b/drivers/common/cnxk/roc_nix.h
> @@ -864,6 +864,7 @@ int __roc_api roc_nix_ptp_sync_time_adjust(struct roc_nix *roc_nix,
>  int __roc_api roc_nix_ptp_info_cb_register(struct roc_nix *roc_nix,
>                                            ptp_info_update_t ptp_update);
>  void __roc_api roc_nix_ptp_info_cb_unregister(struct roc_nix *roc_nix);
> +bool __roc_api roc_nix_ptp_is_enable(struct roc_nix *roc_nix);
>
>  /* VLAN */
>  int __roc_api
> diff --git a/drivers/common/cnxk/roc_nix_ptp.c b/drivers/common/cnxk/roc_nix_ptp.c
> index 03c4c6e..05e4211 100644
> --- a/drivers/common/cnxk/roc_nix_ptp.c
> +++ b/drivers/common/cnxk/roc_nix_ptp.c
> @@ -120,3 +120,11 @@ roc_nix_ptp_info_cb_unregister(struct roc_nix *roc_nix)
>
>         dev->ops->ptp_info_update = NULL;
>  }
> +
> +bool
> +roc_nix_ptp_is_enable(struct roc_nix *roc_nix)
> +{
> +       struct nix *nix = roc_nix_to_nix_priv(roc_nix);
> +
> +       return nix->ptp_en;
> +}
> diff --git a/drivers/common/cnxk/version.map b/drivers/common/cnxk/version.map
> index d346e6f..2a122e5 100644
> --- a/drivers/common/cnxk/version.map
> +++ b/drivers/common/cnxk/version.map
> @@ -206,6 +206,7 @@ INTERNAL {
>         roc_nix_ptp_clock_read;
>         roc_nix_ptp_info_cb_register;
>         roc_nix_ptp_info_cb_unregister;
> +       roc_nix_ptp_is_enable;
>         roc_nix_ptp_rx_ena_dis;
>         roc_nix_ptp_sync_time_adjust;
>         roc_nix_ptp_tx_ena_dis;
> diff --git a/drivers/net/cnxk/cnxk_ethdev.c b/drivers/net/cnxk/cnxk_ethdev.c
> index deb95ae..1fa4131 100644
> --- a/drivers/net/cnxk/cnxk_ethdev.c
> +++ b/drivers/net/cnxk/cnxk_ethdev.c
> @@ -1123,6 +1123,10 @@ cnxk_nix_configure(struct rte_eth_dev *eth_dev)
>                 goto fail_configure;
>         }
>
> +       /* Check if ptp is enable in PF owning this VF*/
> +       if (!roc_nix_is_pf(nix) && (!roc_nix_is_sdp(nix)))
> +               dev->ptp_en = roc_nix_ptp_is_enable(nix);
> +
>         dev->npc.channel = roc_nix_get_base_chan(nix);
>
>         nb_rxq = data->nb_rx_queues;
> --
> 2.8.4
>

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

end of thread, other threads:[~2022-03-03 17:35 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-03-03  7:00 [PATCH 1/2] common/cnxk: revert check on bitmap for tm Nithin Dabilpuram
2022-03-03  7:00 ` [PATCH 2/2] common/cnxk: fix VF data offset Nithin Dabilpuram
2022-03-03 17:35   ` Jerin Jacob
2022-03-03 17:33 ` [PATCH 1/2] common/cnxk: revert check on bitmap for tm 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).