Audit: Review ROUTING_FPS_PER_PAGE 4096, and multiple uses of hard-coded 32 in routing_filter.c
@gapisback ci sta già lavorando.
Dal 6/4/2022.
Valutazione
Questa issue non è ancora stata valutata.
Descrizione
This issue was identified during code-walk thru of PR #230. There are these references in routing_filter.c, which need a better understanding, commenting in the file.
24 #define ROUTING_FPS_PER_PAGE 4096
During discussion, it appeared that 4096 is some sort of "upper-bound" on number of routing filters, but it wasn't clear whether this should be related in any way to page size [etc.]
399 MATRIX_ROWS * MATRIX_COLS + // matrix
400 ROUTING_FPS_PER_PAGE + // fp_buffer
401 ROUTING_FPS_PER_PAGE + // old_fp_buffer
402 ROUTING_FPS_PER_PAGE / 32; // encoding_buffer
413 old_fp_buffer = fp_buffer + ROUTING_FPS_PER_PAGE;
414 encoding_buffer = (uint64 *)(old_fp_buffer + ROUTING_FPS_PER_PAGE);
415 memset(encoding_buffer, 0xff, ROUTING_FPS_PER_PAGE / 32 * sizeof(uint32));
There are many more instances of hard-coded '32' ... and it's not clear what the math is all about here. E.g.
147 routing_get_index(uint32 fp,
148 size_t index_remainder_and_value_size)
149 {
150 return index_remainder_and_value_size == 32
151 ? 0 : fp >> index_remainder_and_value_size;
239 // ffs returns the index + 1 ALEX: I think that's what we want though.
240 bit_offset = __builtin_ffs(encoding_word) - 1;
241 *end = 32 * word + bit_offset;
446 for (uint32 new_fp_no = 0; new_fp_no < num_new_fp; new_fp_no++) {
447 new_fp_arr[new_fp_no] >>= 32 - cfg->fingerprint_size;
448 new_fp_arr[new_fp_no] <<= value_size;
698 platform_assert(cfg->fingerprint_size + value_size <= 32);
811 uint32 fp = hash(slice_data(key), slice_length(key), seed);
812 fp >>= 32 - cfg->fingerprint_size;
And we should find a way to give a semantic #define for 32, and use that consistently where applicable in this file.
- Lingua principale
- C
- Stelle
- 732
- Fork
- 68
- Metriche di merge delle PR
- Nessuna PR unita negli ultimi 30g
Preparare l'ambiente
- Include un Dockerfile o un file Docker Compose
- Nessun modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di vmware/splinterdb
-
Error On Running ExamplesAperta
Difficoltà 4/5 3-5 giorni Idoneità per principianti 25/100
vmware/splinterdb#600 · 5 commenti ·
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 30/100
vmware/splinterdb#597 ·
-
Is macOS support considered?Aperta
Difficoltà 5/5 Più di una settimana Idoneità per principianti 20/100
vmware/splinterdb#591 · 2 commenti ·
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 25/100
vmware/splinterdb#589 · 1 reazione ·
-
A segmentation fault in routing_filter_lookupForse di nuovo libera @ajhconway l’ha presa 1220 giorni fa e non c’è nessuna pull request aperta. Aperta
vmware/splinterdb#585 · 1 assegnatario ·
Tutte le issue di vmware/splinterdb
Issue simili
-
encoding.binary: bounds check guard is compiled away, so decode functions read past the sliceAperta
Difficoltà 2/5 Mezza giornata Idoneità per principianti 70/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 66/100
I maintainer di solito rispondono entro 5 giorni
-
constants.h: M_PI / M_PI_2 fallbacks cause -Wambiguous-macro when H3 is compiled as a Clang moduleAperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
I maintainer di solito rispondono entro 1 giorno
-
area:backend bug launch:p2 scope:core
Difficoltà 2/5 1-3 ore Idoneità per principianti 62/100
Chelis-Lang/chelis#3494 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
zephyrproject-rtos/zephyr#121740 · 1 commento ·
I maintainer di solito rispondono entro 2 giorni