From e5d63f8155c8b744662b0208f43cfeb502cacfc0 Mon Sep 17 00:00:00 2001 From: Marian Chereji Date: Wed, 10 Jul 2013 16:17:08 +0300 Subject: 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 Change-Id: I97acd884302d7ab53ec78b045dd5978da2bf904a Reviewed-on: http://git.am.freescale.net:8181/3257 Reviewed-by: Fleming Andrew-AFLEMING Tested-by: Fleming Andrew-AFLEMING 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 +#include #include /* 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); -- cgit v0.10.2