Commit 80e24d2
bpf, sockmap: Test FIONREAD returns correct bytes in rx buffer with drops
When BPF program drops pkts the sockmap logic 'eats' the packet and
updates copied_seq. In the PASS case where the sk_buff is accepted
we update copied_seq from recvmsg path so we need a new test to
handle the drop case.
Original patch series broke this resulting in
test_sockmap_skb_verdict_fionread:PASS:ioctl(FIONREAD) error 0 nsec
test_sockmap_skb_verdict_fionread:FAIL:ioctl(FIONREAD) unexpected ioctl(FIONREAD): actual 1503041772 != expected 256
After updated patch with fix.
Signed-off-by: John Fastabend <john.fastabend@gmail.com>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Reviewed-by: Jakub Sitnicki <jakub@cloudflare.com>
Link: https://lore.kernel.org/bpf/20230523025618.113937-14-john.fastabend@gmail.com1 parent bb516f9 commit 80e24d2
File tree
2 files changed
+66
-13
lines changed- tools/testing/selftests/bpf
- prog_tests
- progs
2 files changed
+66
-13
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
| 14 | + | |
14 | 15 | | |
15 | 16 | | |
16 | 17 | | |
| |||
410 | 411 | | |
411 | 412 | | |
412 | 413 | | |
413 | | - | |
| 414 | + | |
414 | 415 | | |
| 416 | + | |
415 | 417 | | |
416 | | - | |
417 | | - | |
| 418 | + | |
| 419 | + | |
418 | 420 | | |
419 | 421 | | |
420 | | - | |
421 | | - | |
422 | | - | |
| 422 | + | |
| 423 | + | |
| 424 | + | |
| 425 | + | |
| 426 | + | |
| 427 | + | |
| 428 | + | |
| 429 | + | |
| 430 | + | |
| 431 | + | |
| 432 | + | |
| 433 | + | |
| 434 | + | |
| 435 | + | |
| 436 | + | |
| 437 | + | |
423 | 438 | | |
424 | | - | |
425 | | - | |
426 | 439 | | |
427 | 440 | | |
428 | 441 | | |
| |||
443 | 456 | | |
444 | 457 | | |
445 | 458 | | |
446 | | - | |
447 | | - | |
448 | | - | |
| 459 | + | |
| 460 | + | |
| 461 | + | |
| 462 | + | |
| 463 | + | |
| 464 | + | |
449 | 465 | | |
450 | 466 | | |
451 | 467 | | |
452 | 468 | | |
453 | 469 | | |
454 | 470 | | |
455 | 471 | | |
456 | | - | |
| 472 | + | |
| 473 | + | |
| 474 | + | |
| 475 | + | |
457 | 476 | | |
458 | 477 | | |
459 | 478 | | |
| |||
493 | 512 | | |
494 | 513 | | |
495 | 514 | | |
496 | | - | |
| 515 | + | |
| 516 | + | |
| 517 | + | |
497 | 518 | | |
Lines changed: 32 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
0 commit comments