summaryrefslogtreecommitdiff
path: root/drivers/net/ethernet/freescale
diff options
context:
space:
mode:
authorMandy Lavi <mandy.lavi@freescale.com>2013-07-31 11:32:12 (GMT)
committerSchmitt Richard-B43082 <B43082@freescale.com>2013-08-08 20:34:31 (GMT)
commit35fbdcf1075faeac0fba5c15acbbab710d682237 (patch)
tree4e9e6d1f98e42952704a0f54f4c51365c3ebcf8e /drivers/net/ethernet/freescale
parentb5414961f740becc012f6c63592dc5be2894c84b (diff)
downloadlinux-fsl-qoriq-35fbdcf1075faeac0fba5c15acbbab710d682237.tar.xz
fmd: add ioctl support to both xxTableGetMissStatistics functions
FM_PCD_MatchTableGetMissStatistics and FM_PCD_HashTableGetMissStatistics Signed-off-by: Mandy Lavi <mandy.lavi@freescale.com> Change-Id: I56a02300f4603245344effc898ff9fdd137d8e4c Reviewed-on: http://git.am.freescale.net:8181/3905 Reviewed-by: Schmitt Richard-B43082 <B43082@freescale.com> Tested-by: Schmitt Richard-B43082 <B43082@freescale.com>
Diffstat (limited to 'drivers/net/ethernet/freescale')
-rw-r--r--drivers/net/ethernet/freescale/fman/src/wrapper/lnxwrp_ioctls_fm.c149
-rw-r--r--drivers/net/ethernet/freescale/fman/src/wrapper/lnxwrp_ioctls_fm_compat.c20
-rw-r--r--drivers/net/ethernet/freescale/fman/src/wrapper/lnxwrp_ioctls_fm_compat.h11
3 files changed, 178 insertions, 2 deletions
diff --git a/drivers/net/ethernet/freescale/fman/src/wrapper/lnxwrp_ioctls_fm.c b/drivers/net/ethernet/freescale/fman/src/wrapper/lnxwrp_ioctls_fm.c
index 3c372a3..f87529d 100644
--- a/drivers/net/ethernet/freescale/fman/src/wrapper/lnxwrp_ioctls_fm.c
+++ b/drivers/net/ethernet/freescale/fman/src/wrapper/lnxwrp_ioctls_fm.c
@@ -1946,6 +1946,155 @@ invalid_port_id:
XX_Free(param);
break;
}
+
+
+#if defined(CONFIG_COMPAT)
+ case FM_PCD_IOC_MATCH_TABLE_GET_MISS_STAT_COMPAT:
+#endif
+ case FM_PCD_IOC_MATCH_TABLE_GET_MISS_STAT:
+ {
+ ioc_fm_pcd_cc_tbl_get_miss_params_t param;
+
+#if defined(CONFIG_COMPAT)
+ if (compat)
+ {
+ ioc_compat_fm_pcd_cc_tbl_get_miss_params_t *compat_param;
+
+ compat_param = (ioc_compat_fm_pcd_cc_tbl_get_miss_params_t *) XX_Malloc(
+ sizeof(ioc_compat_fm_pcd_cc_tbl_get_miss_params_t));
+ if (!compat_param)
+ RETURN_ERROR(MINOR, E_NO_MEMORY, ("IOCTL FM PCD"));
+
+ memset(compat_param, 0, sizeof(ioc_compat_fm_pcd_cc_tbl_get_miss_params_t));
+ if (copy_from_user(compat_param,
+ (ioc_compat_fm_pcd_cc_tbl_get_miss_params_t *)compat_ptr(arg),
+ sizeof(ioc_compat_fm_pcd_cc_tbl_get_miss_params_t)))
+ {
+ XX_Free(compat_param);
+ RETURN_ERROR(MINOR, E_WRITE_FAILED, NO_MSG);
+ }
+
+ compat_copy_fm_pcd_cc_tbl_get_miss(compat_param, &param, COMPAT_US_TO_K);
+
+ XX_Free(compat_param);
+ }
+ else
+#endif
+ {
+ if (copy_from_user(&param, (ioc_fm_pcd_cc_tbl_get_miss_params_t *)arg,
+ sizeof(ioc_fm_pcd_cc_tbl_get_miss_params_t)))
+ RETURN_ERROR(MINOR, E_WRITE_FAILED, NO_MSG);
+ }
+
+
+ err = FM_PCD_MatchTableGetMissStatistics((t_Handle) param.id,
+ (t_FmPcdCcKeyStatistics *) &param.miss_statistics);
+
+#if defined(CONFIG_COMPAT)
+ if (compat)
+ {
+ ioc_compat_fm_pcd_cc_tbl_get_miss_params_t *compat_param;
+
+ compat_param = (ioc_compat_fm_pcd_cc_tbl_get_miss_params_t*) XX_Malloc(
+ sizeof(ioc_compat_fm_pcd_cc_tbl_get_miss_params_t));
+ if (!compat_param)
+ RETURN_ERROR(MINOR, E_NO_MEMORY, ("IOCTL FM PCD"));
+
+ memset(compat_param, 0, sizeof(ioc_compat_fm_pcd_cc_tbl_get_miss_params_t));
+ compat_copy_fm_pcd_cc_tbl_get_miss(compat_param, &param, COMPAT_K_TO_US);
+ if (copy_to_user((ioc_compat_fm_pcd_cc_tbl_get_miss_params_t*) compat_ptr(arg),
+ compat_param,
+ sizeof(ioc_compat_fm_pcd_cc_tbl_get_miss_params_t)))
+ RETURN_ERROR(MINOR, E_READ_FAILED, NO_MSG);
+
+ XX_Free(compat_param);
+ }
+ else
+#endif
+ {
+ if (copy_to_user((ioc_fm_pcd_hash_table_params_t *)arg,
+ &param,
+ sizeof(ioc_fm_pcd_cc_tbl_get_miss_params_t)))
+ RETURN_ERROR(MINOR, E_READ_FAILED, NO_MSG);
+ }
+
+ break;
+ }
+
+
+#if defined(CONFIG_COMPAT)
+ case FM_PCD_IOC_HASH_TABLE_GET_MISS_STAT_COMPAT:
+#endif
+ case FM_PCD_IOC_HASH_TABLE_GET_MISS_STAT:
+ {
+ ioc_fm_pcd_cc_tbl_get_miss_params_t param;
+
+#if defined(CONFIG_COMPAT)
+ if (compat)
+ {
+ ioc_compat_fm_pcd_cc_tbl_get_miss_params_t *compat_param;
+
+ compat_param = (ioc_compat_fm_pcd_cc_tbl_get_miss_params_t *) XX_Malloc(
+ sizeof(ioc_compat_fm_pcd_cc_tbl_get_miss_params_t));
+ if (!compat_param)
+ RETURN_ERROR(MINOR, E_NO_MEMORY, ("IOCTL FM PCD"));
+
+ memset(compat_param, 0, sizeof(ioc_compat_fm_pcd_cc_tbl_get_miss_params_t));
+ if (copy_from_user(compat_param,
+ (ioc_compat_fm_pcd_cc_tbl_get_miss_params_t *)compat_ptr(arg),
+ sizeof(ioc_compat_fm_pcd_cc_tbl_get_miss_params_t)))
+ {
+ XX_Free(compat_param);
+ RETURN_ERROR(MINOR, E_WRITE_FAILED, NO_MSG);
+ }
+
+ compat_copy_fm_pcd_cc_tbl_get_miss(compat_param, &param, COMPAT_US_TO_K);
+
+ XX_Free(compat_param);
+ }
+ else
+#endif
+ {
+ if (copy_from_user(&param, (ioc_fm_pcd_cc_tbl_get_miss_params_t *)arg,
+ sizeof(ioc_fm_pcd_cc_tbl_get_miss_params_t)))
+ RETURN_ERROR(MINOR, E_WRITE_FAILED, NO_MSG);
+ }
+
+
+ err = FM_PCD_HashTableGetMissStatistics((t_Handle) param.id,
+ (t_FmPcdCcKeyStatistics *) &param.miss_statistics);
+
+#if defined(CONFIG_COMPAT)
+ if (compat)
+ {
+ ioc_compat_fm_pcd_cc_tbl_get_miss_params_t *compat_param;
+
+ compat_param = (ioc_compat_fm_pcd_cc_tbl_get_miss_params_t*) XX_Malloc(
+ sizeof(ioc_compat_fm_pcd_cc_tbl_get_miss_params_t));
+ if (!compat_param)
+ RETURN_ERROR(MINOR, E_NO_MEMORY, ("IOCTL FM PCD"));
+
+ memset(compat_param, 0, sizeof(ioc_compat_fm_pcd_cc_tbl_get_miss_params_t));
+ compat_copy_fm_pcd_cc_tbl_get_miss(compat_param, &param, COMPAT_K_TO_US);
+ if (copy_to_user((ioc_compat_fm_pcd_cc_tbl_get_miss_params_t*) compat_ptr(arg),
+ compat_param,
+ sizeof(ioc_compat_fm_pcd_cc_tbl_get_miss_params_t)))
+ RETURN_ERROR(MINOR, E_READ_FAILED, NO_MSG);
+
+ XX_Free(compat_param);
+ }
+ else
+#endif
+ {
+ if (copy_to_user((ioc_fm_pcd_hash_table_params_t *)arg,
+ &param,
+ sizeof(ioc_fm_pcd_cc_tbl_get_miss_params_t)))
+ RETURN_ERROR(MINOR, E_READ_FAILED, NO_MSG);
+ }
+
+ break;
+ }
+
#if defined(CONFIG_COMPAT)
case FM_PCD_IOC_HASH_TABLE_SET_COMPAT:
#endif
diff --git a/drivers/net/ethernet/freescale/fman/src/wrapper/lnxwrp_ioctls_fm_compat.c b/drivers/net/ethernet/freescale/fman/src/wrapper/lnxwrp_ioctls_fm_compat.c
index 68142b6..3c1ac30 100644
--- a/drivers/net/ethernet/freescale/fman/src/wrapper/lnxwrp_ioctls_fm_compat.c
+++ b/drivers/net/ethernet/freescale/fman/src/wrapper/lnxwrp_ioctls_fm_compat.c
@@ -506,7 +506,7 @@ void compat_copy_fm_pcd_hash_table(
{
if (compat == COMPAT_US_TO_K)
{
- param-> max_num_of_keys = compat_param->max_num_of_keys;
+ param->max_num_of_keys = compat_param->max_num_of_keys;
param->statistics_mode = compat_param->statistics_mode;
param->kg_hash_shift = compat_param->kg_hash_shift;
param->hash_res_mask = compat_param->hash_res_mask;
@@ -516,7 +516,7 @@ void compat_copy_fm_pcd_hash_table(
}
else
{
- compat_param-> max_num_of_keys = param->max_num_of_keys;
+ compat_param->max_num_of_keys = param->max_num_of_keys;
compat_param->statistics_mode = param->statistics_mode;
compat_param->kg_hash_shift = param->kg_hash_shift;
compat_param->hash_res_mask = param->hash_res_mask;
@@ -844,6 +844,22 @@ void compat_copy_fm_port_vsp_alloc_params(
}
#endif /* (DPAA_VERSION >= 11) */
+void compat_copy_fm_pcd_cc_tbl_get_miss(
+ ioc_compat_fm_pcd_cc_tbl_get_miss_params_t *compat_param,
+ ioc_fm_pcd_cc_tbl_get_miss_params_t *param,
+ uint8_t compat)
+{
+ if (compat == COMPAT_US_TO_K)
+ {
+ param->id = compat_pcd_id2ptr(compat_param->id);
+ memcpy(&param->miss_statistics, &compat_param->miss_statistics, sizeof(ioc_fm_pcd_cc_key_statistics_t));
+ } else {
+ compat_param->id = compat_add_ptr2id(param->id, FM_MAP_TYPE_PCD_NODE);
+ memcpy(&compat_param->miss_statistics, &param->miss_statistics, sizeof(ioc_fm_pcd_cc_key_statistics_t));
+ }
+}
+
+
void compat_copy_fm_pcd_net_env(
ioc_compat_fm_pcd_net_env_params_t *compat_param,
ioc_fm_pcd_net_env_params_t *param,
diff --git a/drivers/net/ethernet/freescale/fman/src/wrapper/lnxwrp_ioctls_fm_compat.h b/drivers/net/ethernet/freescale/fman/src/wrapper/lnxwrp_ioctls_fm_compat.h
index f8655db..ae19b68 100644
--- a/drivers/net/ethernet/freescale/fman/src/wrapper/lnxwrp_ioctls_fm_compat.h
+++ b/drivers/net/ethernet/freescale/fman/src/wrapper/lnxwrp_ioctls_fm_compat.h
@@ -521,6 +521,12 @@ typedef struct ioc_compat_fm_ctrl_mon_counters_params_t {
compat_uptr_t p_mon;
} ioc_compat_fm_ctrl_mon_counters_params_t;
+typedef struct ioc_compat_fm_pcd_cc_tbl_get_miss_params_t {
+ compat_uptr_t id;
+ ioc_fm_pcd_cc_key_statistics_t miss_statistics;
+} ioc_compat_fm_pcd_cc_tbl_get_miss_params_t;
+
+
/* } pcd compat structures */
void compat_obj_delete(
@@ -568,6 +574,11 @@ void compat_copy_fm_pcd_cc_tree(
ioc_fm_pcd_cc_tree_params_t *param,
uint8_t compat);
+void compat_copy_fm_pcd_cc_tbl_get_miss(
+ ioc_compat_fm_pcd_cc_tbl_get_miss_params_t *compat_param,
+ ioc_fm_pcd_cc_tbl_get_miss_params_t *param,
+ uint8_t compat);
+
void compat_fm_pcd_prs_sw(
ioc_compat_fm_pcd_prs_sw_params_t *compat_param,
ioc_fm_pcd_prs_sw_params_t *param,