Commit 8e3100f
io_uring/net: only import send_zc buffer once
io_send_zc() guards its call to io_send_zc_import() with if (!done_io)
in an attempt to avoid calling it redundantly on the same req. However,
if the initial non-blocking issue returns -EAGAIN, done_io will stay 0.
This causes the subsequent issue to unnecessarily re-import the buffer.
Add an explicit flag "imported" to io_sr_msg to track if its buffer has
already been imported. Clear the flag in io_send_zc_prep(). Call
io_send_zc_import() and set the flag in io_send_zc() if it is unset.
Signed-off-by: Caleb Sander Mateos <[email protected]>
Fixes: 54cdcca ("io_uring/net: switch io_send() and io_send_zc() to using io_async_msghdr")
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Jens Axboe <[email protected]>1 parent ef49027 commit 8e3100f
1 file changed
+4
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
77 | 77 | | |
78 | 78 | | |
79 | 79 | | |
| 80 | + | |
80 | 81 | | |
81 | 82 | | |
82 | 83 | | |
| |||
1306 | 1307 | | |
1307 | 1308 | | |
1308 | 1309 | | |
| 1310 | + | |
1309 | 1311 | | |
1310 | 1312 | | |
1311 | 1313 | | |
| |||
1451 | 1453 | | |
1452 | 1454 | | |
1453 | 1455 | | |
1454 | | - | |
| 1456 | + | |
| 1457 | + | |
1455 | 1458 | | |
1456 | 1459 | | |
1457 | 1460 | | |
| |||
0 commit comments