Commit 5f183ac
committed
tests: runtime: Use nf_tables_newtable for module tests
nft_trans_alloc_gfp() is a static function that's called from multiple
locations. This means it can be partially inlined - inlined in some
places but not others. This makes the tests unreliable between different
kernel and compiler verisons.
Switch to nf_tables_newtable() which is used as a callback. The compiler
is forced to not inline this.
However, the offset on x86_64 needs to be adjusted. Dissassembly shows:
```
000000000000a7e0 <nf_tables_newtable>:
a7e0: f3 0f 1e fa endbr64
a7e4: e8 00 00 00 00 call a7e9 <nf_tables_newtable+0x9>
a7e9: 41 57 push %r15
a7eb: 41 56 push %r14
```
where 0xa7e4 is the first aligned instruction. 0xa7e4 - 0xa7e0 = 0x4, so
use that.
On aarch64, it seems 0x8 is still valid:
```
000000000000e080 <nf_tables_newtable>:
e080: d503201f nop
e084: d503201f nop
e088: d503233f paciasp
e08c: d10283ff sub sp, sp, #0xa0
e090: f800865e str x30, [x18], #0x8
```
where 0xe088 - 0xe080 = 0x8. So leave that alone.1 parent 3d243bd commit 5f183ac
2 files changed
+11
-9
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
30 | 30 | | |
31 | 31 | | |
32 | 32 | | |
33 | | - | |
| 33 | + | |
34 | 34 | | |
35 | 35 | | |
36 | 36 | | |
| |||
39 | 39 | | |
40 | 40 | | |
41 | 41 | | |
42 | | - | |
| 42 | + | |
43 | 43 | | |
44 | 44 | | |
45 | 45 | | |
| |||
48 | 48 | | |
49 | 49 | | |
50 | 50 | | |
51 | | - | |
| 51 | + | |
52 | 52 | | |
53 | | - | |
| 53 | + | |
54 | 54 | | |
55 | 55 | | |
56 | 56 | | |
57 | 57 | | |
58 | 58 | | |
59 | 59 | | |
60 | | - | |
| 60 | + | |
61 | 61 | | |
62 | | - | |
| 62 | + | |
63 | 63 | | |
64 | 64 | | |
65 | 65 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
179 | 179 | | |
180 | 180 | | |
181 | 181 | | |
182 | | - | |
| 182 | + | |
183 | 183 | | |
184 | 184 | | |
185 | 185 | | |
186 | 186 | | |
187 | 187 | | |
| 188 | + | |
| 189 | + | |
188 | 190 | | |
189 | 191 | | |
190 | | - | |
| 192 | + | |
191 | 193 | | |
192 | | - | |
| 194 | + | |
193 | 195 | | |
194 | 196 | | |
195 | 197 | | |
| |||
0 commit comments