diff options
author | Marian Chereji <marian.chereji@freescale.com> | 2013-09-24 15:20:39 (GMT) |
---|---|---|
committer | Rivera Jose-B46482 <German.Rivera@freescale.com> | 2013-09-27 13:43:33 (GMT) |
commit | 267ef5f07eff84a1a3bbc0763f784861e62e3260 (patch) | |
tree | 5f341f2191ed24d072e1a2b1a38dd2ab799bc5d6 /drivers | |
parent | 80df9264e8f24a84b6d4876e6ffe4c8ccf9a7258 (diff) | |
download | linux-fsl-qoriq-267ef5f07eff84a1a3bbc0763f784861e62e3260.tar.xz |
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 <marian.chereji@freescale.com>
Reviewed-on: http://git.am.freescale.net:8181/4911
Tested-by: Review Code-CDREVIEW <CDREVIEW@freescale.com>
Reviewed-by: Bulie Radu-Andrei-B37577 <Radu.Bulie@freescale.com>
Reviewed-by: Rivera Jose-B46482 <German.Rivera@freescale.com>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/staging/fsl_dpa_offload/dpa_classifier.c | 8 |
1 files changed, 6 insertions, 2 deletions
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)); |