diff mbox series

[net-next,09/10] net: microchip: sparx5: initialize PSFP

Message ID 20230202104355.1612823-10-daniel.machon@microchip.com (mailing list archive)
State Accepted
Commit e116b19db20205fba39a64e1cb357c012ef29dc1
Delegated to: Netdev Maintainers
Headers show
Series Add support for PSFP in Sparx5 | expand

Checks

Context Check Description
netdev/tree_selection success Clearly marked for net-next, async
netdev/fixes_present success Fixes tag not required for -next series
netdev/subject_prefix success Link
netdev/cover_letter success Series has a cover letter
netdev/patch_count success Link
netdev/header_inline success No static functions without inline keyword in header files
netdev/build_32bit success Errors and warnings before: 0 this patch: 0
netdev/cc_maintainers success CCed 12 of 12 maintainers
netdev/build_clang success Errors and warnings before: 0 this patch: 0
netdev/module_param success Was 0 now: 0
netdev/verify_signedoff success Signed-off-by tag matches author and committer
netdev/check_selftest success No net selftest shell script
netdev/verify_fixes success No Fixes tag
netdev/build_allmodconfig_warn success Errors and warnings before: 0 this patch: 0
netdev/checkpatch success total: 0 errors, 0 warnings, 0 checks, 44 lines checked
netdev/kdoc success Errors and warnings before: 0 this patch: 0
netdev/source_inline success Was 0 now: 0

Commit Message

Daniel Machon Feb. 2, 2023, 10:43 a.m. UTC
Initialize the SDLB's, stream gates and stream filters.

Signed-off-by: Daniel Machon <daniel.machon@microchip.com>
---
 .../ethernet/microchip/sparx5/sparx5_main.h    |  3 +++
 .../ethernet/microchip/sparx5/sparx5_psfp.c    | 18 ++++++++++++++++++
 .../net/ethernet/microchip/sparx5/sparx5_qos.c |  2 ++
 3 files changed, 23 insertions(+)

Comments

Simon Horman Feb. 4, 2023, 12:46 p.m. UTC | #1
On Thu, Feb 02, 2023 at 11:43:54AM +0100, Daniel Machon wrote:
> Initialize the SDLB's, stream gates and stream filters.
> 
> Signed-off-by: Daniel Machon <daniel.machon@microchip.com>

Reviewed-by: Simon Horman <simon.horman@corigine.com>

> ---
>  .../ethernet/microchip/sparx5/sparx5_main.h    |  3 +++
>  .../ethernet/microchip/sparx5/sparx5_psfp.c    | 18 ++++++++++++++++++
>  .../net/ethernet/microchip/sparx5/sparx5_qos.c |  2 ++
>  3 files changed, 23 insertions(+)
> 
> diff --git a/drivers/net/ethernet/microchip/sparx5/sparx5_main.h b/drivers/net/ethernet/microchip/sparx5/sparx5_main.h
> index cffed893fb7b..72e7928912eb 100644
> --- a/drivers/net/ethernet/microchip/sparx5/sparx5_main.h
> +++ b/drivers/net/ethernet/microchip/sparx5/sparx5_main.h
> @@ -456,6 +456,7 @@ int sparx5_sdlb_group_del(struct sparx5 *sparx5, u32 group, u32 idx);
>  
>  void sparx5_sdlb_group_init(struct sparx5 *sparx5, u64 max_rate, u32 min_burst,
>  			    u32 frame_size, u32 idx);
> +

nit: This hunk appears to belong in patch 4/9
     No need to respin because of this, afaic.

>  /* sparx5_police.c */
>  enum {
>  	/* More policer types will be added later */

...
diff mbox series

Patch

diff --git a/drivers/net/ethernet/microchip/sparx5/sparx5_main.h b/drivers/net/ethernet/microchip/sparx5/sparx5_main.h
index cffed893fb7b..72e7928912eb 100644
--- a/drivers/net/ethernet/microchip/sparx5/sparx5_main.h
+++ b/drivers/net/ethernet/microchip/sparx5/sparx5_main.h
@@ -456,6 +456,7 @@  int sparx5_sdlb_group_del(struct sparx5 *sparx5, u32 group, u32 idx);
 
 void sparx5_sdlb_group_init(struct sparx5 *sparx5, u64 max_rate, u32 min_burst,
 			    u32 frame_size, u32 idx);
+
 /* sparx5_police.c */
 enum {
 	/* More policer types will be added later */
@@ -530,6 +531,8 @@  u32 sparx5_psfp_isdx_get_fm(struct sparx5 *sparx5, u32 isdx);
 u32 sparx5_psfp_sf_get_sg(struct sparx5 *sparx5, u32 sfid);
 void sparx5_isdx_conf_set(struct sparx5 *sparx5, u32 isdx, u32 sfid, u32 fmid);
 
+void sparx5_psfp_init(struct sparx5 *sparx5);
+
 /* sparx5_qos.c */
 void sparx5_new_base_time(struct sparx5 *sparx5, const u32 cycle_time,
 			  const ktime_t org_base_time, ktime_t *new_base_time);
diff --git a/drivers/net/ethernet/microchip/sparx5/sparx5_psfp.c b/drivers/net/ethernet/microchip/sparx5/sparx5_psfp.c
index b70601a5e4c5..8dee1ab1fa75 100644
--- a/drivers/net/ethernet/microchip/sparx5/sparx5_psfp.c
+++ b/drivers/net/ethernet/microchip/sparx5/sparx5_psfp.c
@@ -312,3 +312,21 @@  int sparx5_psfp_fm_del(struct sparx5 *sparx5, u32 id)
 
 	return sparx5_sdlb_conf_set(sparx5, &fm);
 }
+
+void sparx5_psfp_init(struct sparx5 *sparx5)
+{
+	const struct sparx5_sdlb_group *group;
+	int i;
+
+	for (i = 0; i < SPX5_SDLB_GROUP_CNT; i++) {
+		group = &sdlb_groups[i];
+		sparx5_sdlb_group_init(sparx5, group->max_rate,
+				       group->min_burst, group->frame_size, i);
+	}
+
+	spx5_wr(ANA_AC_SG_CYCLETIME_UPDATE_PERIOD_SG_CT_UPDATE_ENA_SET(1),
+		sparx5, ANA_AC_SG_CYCLETIME_UPDATE_PERIOD);
+
+	spx5_rmw(ANA_L2_FWD_CFG_ISDX_LOOKUP_ENA_SET(1),
+		 ANA_L2_FWD_CFG_ISDX_LOOKUP_ENA, sparx5, ANA_L2_FWD_CFG);
+}
diff --git a/drivers/net/ethernet/microchip/sparx5/sparx5_qos.c b/drivers/net/ethernet/microchip/sparx5/sparx5_qos.c
index ebfdbbf0a1ce..5f34febaee6b 100644
--- a/drivers/net/ethernet/microchip/sparx5/sparx5_qos.c
+++ b/drivers/net/ethernet/microchip/sparx5/sparx5_qos.c
@@ -450,6 +450,8 @@  int sparx5_qos_init(struct sparx5 *sparx5)
 	if (ret < 0)
 		return ret;
 
+	sparx5_psfp_init(sparx5);
+
 	return 0;
 }