From 267ef5f07eff84a1a3bbc0763f784861e62e3260 Mon Sep 17 00:00:00 2001 From: Marian Chereji Date: Tue, 24 Sep 2013 18:20:39 +0300 Subject: dpa_offload: Allow 0xff masks for HASH classifier table entries As key masks are not supported in HASH tables, the DPA Classifier was refusing to add an entry to a HASH table with a key that had any mask (mask pointer not NULL). This was changed so that the DPA Classifier can recognize a 0xff mask all over and ignore it. Any other (more complex) mask will still be refused. Change-Id: I0732d873fa5d10def4f2646c2bd248aadcffa736 Signed-off-by: Marian Chereji Reviewed-on: http://git.am.freescale.net:8181/4911 Tested-by: Review Code-CDREVIEW Reviewed-by: Bulie Radu-Andrei-B37577 Reviewed-by: Rivera Jose-B46482 diff --git a/drivers/staging/fsl_dpa_offload/dpa_classifier.c b/drivers/staging/fsl_dpa_offload/dpa_classifier.c index 5056b2e..3dc35bc 100644 --- a/drivers/staging/fsl_dpa_offload/dpa_classifier.c +++ b/drivers/staging/fsl_dpa_offload/dpa_classifier.c @@ -2567,8 +2567,12 @@ static int table_insert_entry_hash(struct dpa_cls_table *cls_table, } if (key->mask) { - log_err("Key masks are not supported by HASH tables.\n"); - return -EINVAL; + /* Only full 0xFF masks supported: */ + for (j = 0; j < key->size; j++) + if (key->mask[j] ^ 0xff) { + log_err("Only key masks 0xff all over are supported by HASH tables.\n"); + return -EINVAL; + } } memset(&key_params, 0, sizeof(t_FmPcdCcKeyParams)); -- cgit v0.10.2