From f488de6741d5ba805b9fe813d2ddf32368d3a888 Mon Sep 17 00:00:00 2001 From: Haiying Wang Date: Thu, 4 Jun 2015 15:49:39 -0400 Subject: fsl_qbman: hardcode mps field to 60 In LNI shaper setup, setting mps to 60 to round up the frame length to 60 for shaper calculations, for any dequeued frame length less than 60 bytes. Signed-off-by: Haiying Wang Change-Id: I88013d2ee39b3620a4e97f3366a87664ec0ea9dc Reviewed-on: http://git.am.freescale.net:8181/37437 Tested-by: Review Code-CDREVIEW Reviewed-by: Roy Pledge Reviewed-by: Honghua Yin diff --git a/drivers/staging/fsl_qbman/qman_high.c b/drivers/staging/fsl_qbman/qman_high.c index b94bfb4..334d9ed 100644 --- a/drivers/staging/fsl_qbman/qman_high.c +++ b/drivers/staging/fsl_qbman/qman_high.c @@ -3517,6 +3517,7 @@ int qman_ceetm_lni_enable_shaper(struct qm_ceetm_lni *lni, int coupled, lni->er_token_rate.fraction; config_opts.shaper_config.crtbl = lni->cr_token_bucket_limit; config_opts.shaper_config.ertbl = lni->er_token_bucket_limit; + config_opts.shaper_config.mps = 60; return qman_ceetm_configure_mapping_shaper_tcfc(&config_opts); } EXPORT_SYMBOL(qman_ceetm_lni_enable_shaper); @@ -3540,6 +3541,7 @@ int qman_ceetm_lni_disable_shaper(struct qm_ceetm_lni *lni) */ config_opts.shaper_config.crtcr = 0xFFFFFF; config_opts.shaper_config.ertcr = 0xFFFFFF; + config_opts.shaper_config.mps = 60; lni->shaper_enable = 0; return qman_ceetm_configure_mapping_shaper_tcfc(&config_opts); } @@ -3583,6 +3585,7 @@ int qman_ceetm_lni_set_commit_rate(struct qm_ceetm_lni *lni, query_result.shaper_query.ertcr; config_opts.shaper_config.ertbl = query_result.shaper_query.ertbl; + config_opts.shaper_config.mps = query_result.shaper_query.mps; return qman_ceetm_configure_mapping_shaper_tcfc(&config_opts); } else { return 0; @@ -3678,7 +3681,7 @@ int qman_ceetm_lni_set_excess_rate(struct qm_ceetm_lni *lni, query_result.shaper_query.crtcr; config_opts.shaper_config.crtbl = query_result.shaper_query.crtbl; - + config_opts.shaper_config.mps = query_result.shaper_query.mps; return qman_ceetm_configure_mapping_shaper_tcfc(&config_opts); } else { return 0; diff --git a/include/linux/fsl_qman.h b/include/linux/fsl_qman.h index 2909cc5..991729e 100644 --- a/include/linux/fsl_qman.h +++ b/include/linux/fsl_qman.h @@ -789,7 +789,8 @@ struct qm_mcc_ceetm_mapping_shaper_tcfc_config { u32 ertcr:24; u16 crtbl; u16 ertbl; - u8 __reserved2[48]; + u8 mps; /* This will be hardcoded by driver with 60 */ + u8 __reserved2[47]; } __packed shaper_config; struct { u8 __reserved2[11]; @@ -1203,7 +1204,8 @@ struct qm_mcr_ceetm_mapping_shaper_tcfc_query { u32 ertcr:24; u16 crtbl; u16 ertbl; - u8 __reserved2[16]; + u8 mps; + u8 __reserved2[15]; u32 crat; u32 erat; u8 __reserved3[24]; -- cgit v0.10.2