summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHaiying Wang <Haiying.Wang@freescale.com>2015-06-04 19:49:39 (GMT)
committerHonghua Yin <Hong-Hua.Yin@freescale.com>2015-06-10 03:31:09 (GMT)
commitf488de6741d5ba805b9fe813d2ddf32368d3a888 (patch)
tree3bef762c9acb3e61129708c5423a145f190e3c2d
parent66e98353166bf120c4ca1b264b926b09b8d90d20 (diff)
downloadlinux-fsl-qoriq-f488de6741d5ba805b9fe813d2ddf32368d3a888.tar.xz
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 <Haiying.Wang@freescale.com> Change-Id: I88013d2ee39b3620a4e97f3366a87664ec0ea9dc Reviewed-on: http://git.am.freescale.net:8181/37437 Tested-by: Review Code-CDREVIEW <CDREVIEW@freescale.com> Reviewed-by: Roy Pledge <roy.pledge@freescale.com> Reviewed-by: Honghua Yin <Hong-Hua.Yin@freescale.com>
-rw-r--r--drivers/staging/fsl_qbman/qman_high.c5
-rw-r--r--include/linux/fsl_qman.h6
2 files changed, 8 insertions, 3 deletions
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];