diff options
author | Marian Chereji <marian.chereji@freescale.com> | 2013-07-10 13:17:08 (GMT) |
---|---|---|
committer | Fleming Andrew-AFLEMING <AFLEMING@freescale.com> | 2013-07-11 22:39:34 (GMT) |
commit | e5d63f8155c8b744662b0208f43cfeb502cacfc0 (patch) | |
tree | e2a21596bdcba1fedc397cd8fd750f1663dcaa23 /drivers/staging | |
parent | c0a8056e2ddf7c372d8693d8230083cc3421ca0d (diff) | |
download | linux-fsl-qoriq-e5d63f8155c8b744662b0208f43cfeb502cacfc0.tar.xz |
dpa_offload: Switch DPA Classifier from using fmd/crc64 to using lib/crc64
The DPA Classifier is computing a CRC64 ECMA by using the Frame
Manager driver. Because the CRC64 ECMA generic module was recently
accepted in linux/lib it will now use this CRC64 module instead of
the implementation from FMan driver.
Signed-off-by: Marian Chereji <marian.chereji@freescale.com>
Change-Id: I97acd884302d7ab53ec78b045dd5978da2bf904a
Reviewed-on: http://git.am.freescale.net:8181/3257
Reviewed-by: Fleming Andrew-AFLEMING <AFLEMING@freescale.com>
Tested-by: Fleming Andrew-AFLEMING <AFLEMING@freescale.com>
Diffstat (limited to 'drivers/staging')
-rw-r--r-- | drivers/staging/fsl_dpa_offload/Kconfig | 1 | ||||
-rw-r--r-- | drivers/staging/fsl_dpa_offload/dpa_classifier.c | 9 |
2 files changed, 6 insertions, 4 deletions
diff --git a/drivers/staging/fsl_dpa_offload/Kconfig b/drivers/staging/fsl_dpa_offload/Kconfig index fd00549..baeaab3 100644 --- a/drivers/staging/fsl_dpa_offload/Kconfig +++ b/drivers/staging/fsl_dpa_offload/Kconfig @@ -3,6 +3,7 @@ config FSL_DPA_OFFLOAD tristate "Freescale Datapath Offloading Driver" depends on FSL_FMAN select CRC8 + select CRC64_ECMA default n ---help--- The driver supports DPAA offloading capabilities. diff --git a/drivers/staging/fsl_dpa_offload/dpa_classifier.c b/drivers/staging/fsl_dpa_offload/dpa_classifier.c index ed6bea3..89aaa2e 100644 --- a/drivers/staging/fsl_dpa_offload/dpa_classifier.c +++ b/drivers/staging/fsl_dpa_offload/dpa_classifier.c @@ -39,6 +39,7 @@ #include <linux/crc8.h> +#include <linux/crc64_ecma.h> #include <linux/module.h> /* DPA offloading layer includes */ @@ -2539,7 +2540,7 @@ static int table_insert_entry_hash(struct dpa_cls_table *cls_table, struct dpa_cls_tbl_shadow_entry *shadow_entry = NULL; t_FmPcdCcKeyParams key_params; uint8_t shadow_table_index; - uint64_t hash_set_index; + u64 hash_set_index; uint8_t key_data[DPA_OFFLD_MAXENTRYKEYSIZE]; int j, hmd; struct dpa_cls_tbl_shadow_table *shadow_table; @@ -2613,11 +2614,11 @@ static int table_insert_entry_hash(struct dpa_cls_table *cls_table, if (errno < 0) return errno; - hash_set_index = crc64_init(); - hash_set_index = crc64_compute(key_data, + hash_set_index = crc64_ecma_seed(); + hash_set_index = crc64_ecma(key_data, cls_table->params.hash_params.key_size, hash_set_index); - hash_set_index = (uint64_t)(hash_set_index & cls_table->hash_mask) >> + hash_set_index = (u64)(hash_set_index & cls_table->hash_mask) >> (8 * (6 - cls_table->params.hash_params.hash_offs) + 4); BUG_ON(hash_set_index >= cls_table->int_cc_nodes_count); |