1c24ce29df9a50e5c164162dbffeb3600a1391fe
[deb_dpdk.git] / debian / patches / dpdk-dev-ppc-enable-5-7-table-fix-verification-on-hash-bucket-header-alignme.patch
1 From: Gowrishankar Muthukrishnan <gowrishankar.m@linux.vnet.ibm.com>
2 Date: Thu, 8 Sep 2016 22:18:11 +0530
3 Subject: [PATCH 5/7] table: fix verification on hash bucket header alignment
4
5 In powerpc systems, rte table hash structs rte_bucket_4_8, rte_bucket_4_16 and
6 rte_bucket_4_32 are not cache aligned and hence verification on same would fail.
7 Instead of checking alignment on cpu cacheline, it could equally be tested as
8 multiple of 64 bytes.
9
10 Signed-off-by: Gowrishankar Muthukrishnan <gowrishankar.m@linux.vnet.ibm.com>
11 Acked-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>
12
13 Origin: Upstream, commit:43f15e28377f8cc2f8622b458a249efa006c637a
14 Author: Gowrishankar Muthukrishnan <gowrishankar.m@linux.vnet.ibm.com>
15 Last-Update: 2016-09-21
16 ---
17  lib/librte_table/rte_table_hash_key16.c | 4 ++--
18  lib/librte_table/rte_table_hash_key32.c | 4 ++--
19  lib/librte_table/rte_table_hash_key8.c  | 4 ++--
20  3 files changed, 6 insertions(+), 6 deletions(-)
21
22 diff --git a/lib/librte_table/rte_table_hash_key16.c b/lib/librte_table/rte_table_hash_key16.c
23 index b7e000f..08d4d77 100644
24 --- a/lib/librte_table/rte_table_hash_key16.c
25 +++ b/lib/librte_table/rte_table_hash_key16.c
26 @@ -130,7 +130,7 @@ rte_table_hash_create_key16_lru(void *params,
27         /* Check input parameters */
28         if ((check_params_create_lru(p) != 0) ||
29                 ((sizeof(struct rte_table_hash) % RTE_CACHE_LINE_SIZE) != 0) ||
30 -               ((sizeof(struct rte_bucket_4_16) % RTE_CACHE_LINE_SIZE) != 0))
31 +               ((sizeof(struct rte_bucket_4_16) % 64) != 0))
32                 return NULL;
33         n_entries_per_bucket = 4;
34         key_size = 16;
35 @@ -344,7 +344,7 @@ rte_table_hash_create_key16_ext(void *params,
36         /* Check input parameters */
37         if ((check_params_create_ext(p) != 0) ||
38                 ((sizeof(struct rte_table_hash) % RTE_CACHE_LINE_SIZE) != 0) ||
39 -               ((sizeof(struct rte_bucket_4_16) % RTE_CACHE_LINE_SIZE) != 0))
40 +               ((sizeof(struct rte_bucket_4_16) % 64) != 0))
41                 return NULL;
42  
43         n_entries_per_bucket = 4;
44 diff --git a/lib/librte_table/rte_table_hash_key32.c b/lib/librte_table/rte_table_hash_key32.c
45 index a7aba49..161f6b7 100644
46 --- a/lib/librte_table/rte_table_hash_key32.c
47 +++ b/lib/librte_table/rte_table_hash_key32.c
48 @@ -129,7 +129,7 @@ rte_table_hash_create_key32_lru(void *params,
49         /* Check input parameters */
50         if ((check_params_create_lru(p) != 0) ||
51                 ((sizeof(struct rte_table_hash) % RTE_CACHE_LINE_SIZE) != 0) ||
52 -               ((sizeof(struct rte_bucket_4_32) % RTE_CACHE_LINE_SIZE) != 0)) {
53 +               ((sizeof(struct rte_bucket_4_32) % 64) != 0)) {
54                 return NULL;
55         }
56         n_entries_per_bucket = 4;
57 @@ -337,7 +337,7 @@ rte_table_hash_create_key32_ext(void *params,
58         /* Check input parameters */
59         if ((check_params_create_ext(p) != 0) ||
60                 ((sizeof(struct rte_table_hash) % RTE_CACHE_LINE_SIZE) != 0) ||
61 -               ((sizeof(struct rte_bucket_4_32) % RTE_CACHE_LINE_SIZE) != 0))
62 +               ((sizeof(struct rte_bucket_4_32) % 64) != 0))
63                 return NULL;
64  
65         n_entries_per_bucket = 4;
66 diff --git a/lib/librte_table/rte_table_hash_key8.c b/lib/librte_table/rte_table_hash_key8.c
67 index e2e2bdc..b04f60d 100644
68 --- a/lib/librte_table/rte_table_hash_key8.c
69 +++ b/lib/librte_table/rte_table_hash_key8.c
70 @@ -125,7 +125,7 @@ rte_table_hash_create_key8_lru(void *params, int socket_id, uint32_t entry_size)
71         /* Check input parameters */
72         if ((check_params_create_lru(p) != 0) ||
73                 ((sizeof(struct rte_table_hash) % RTE_CACHE_LINE_SIZE) != 0) ||
74 -               ((sizeof(struct rte_bucket_4_8) % RTE_CACHE_LINE_SIZE) != 0)) {
75 +               ((sizeof(struct rte_bucket_4_8) % 64) != 0)) {
76                 return NULL;
77         }
78         n_entries_per_bucket = 4;
79 @@ -332,7 +332,7 @@ rte_table_hash_create_key8_ext(void *params, int socket_id, uint32_t entry_size)
80         /* Check input parameters */
81         if ((check_params_create_ext(p) != 0) ||
82                 ((sizeof(struct rte_table_hash) % RTE_CACHE_LINE_SIZE) != 0) ||
83 -               ((sizeof(struct rte_bucket_4_8) % RTE_CACHE_LINE_SIZE) != 0))
84 +               ((sizeof(struct rte_bucket_4_8) % 64) != 0))
85                 return NULL;
86  
87         n_entries_per_bucket = 4;
88 -- 
89 1.9.1
90