Commit 6699ec9
io_uring/zcrx: add a read limit to recvzc requests
Currently multishot recvzc requests have no read limit and will remain
active so as long as the socket remains open. But, there are sometimes a
need to do a fixed length read e.g. peeking at some data in the socket.
Add a length limit to recvzc requests `len`. A value of 0 means no limit
which is the previous behaviour. A positive value N specifies how many
bytes to read from the socket.
Data will still be posted in aux completions, as before. This could be
split across multiple frags. But the primary recvzc request will now
complete once N bytes have been read. The completion of the recvzc
request will have res and cflags both set to 0.
Signed-off-by: David Wei <dw@davidwei.uk>
Reviewed-by: Pavel Begunkov <asml.silence@gmail.com>
Link: https://lore.kernel.org/r/20250224041319.2389785-2-dw@davidwei.uk
[axboe: fixup io_zcrx_recv() for !CONFIG_NET]
Signed-off-by: Jens Axboe <axboe@kernel.dk>1 parent 92ade52 commit 6699ec9
3 files changed
+24
-9
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
94 | 94 | | |
95 | 95 | | |
96 | 96 | | |
| 97 | + | |
97 | 98 | | |
98 | 99 | | |
99 | 100 | | |
| |||
1241 | 1242 | | |
1242 | 1243 | | |
1243 | 1244 | | |
1244 | | - | |
| 1245 | + | |
1245 | 1246 | | |
1246 | 1247 | | |
1247 | 1248 | | |
| |||
1250 | 1251 | | |
1251 | 1252 | | |
1252 | 1253 | | |
1253 | | - | |
| 1254 | + | |
1254 | 1255 | | |
1255 | 1256 | | |
1256 | 1257 | | |
| |||
1270 | 1271 | | |
1271 | 1272 | | |
1272 | 1273 | | |
| 1274 | + | |
1273 | 1275 | | |
1274 | 1276 | | |
1275 | 1277 | | |
| |||
1280 | 1282 | | |
1281 | 1283 | | |
1282 | 1284 | | |
| 1285 | + | |
1283 | 1286 | | |
1284 | | - | |
| 1287 | + | |
| 1288 | + | |
| 1289 | + | |
| 1290 | + | |
| 1291 | + | |
| 1292 | + | |
| 1293 | + | |
| 1294 | + | |
1285 | 1295 | | |
1286 | 1296 | | |
1287 | 1297 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
817 | 817 | | |
818 | 818 | | |
819 | 819 | | |
| 820 | + | |
820 | 821 | | |
821 | 822 | | |
822 | 823 | | |
| |||
894 | 895 | | |
895 | 896 | | |
896 | 897 | | |
| 898 | + | |
897 | 899 | | |
898 | 900 | | |
899 | 901 | | |
900 | 902 | | |
901 | 903 | | |
902 | | - | |
| 904 | + | |
903 | 905 | | |
| 906 | + | |
904 | 907 | | |
905 | 908 | | |
906 | 909 | | |
907 | 910 | | |
908 | 911 | | |
909 | 912 | | |
910 | | - | |
| 913 | + | |
911 | 914 | | |
912 | 915 | | |
913 | 916 | | |
914 | 917 | | |
915 | 918 | | |
916 | 919 | | |
| 920 | + | |
| 921 | + | |
917 | 922 | | |
918 | 923 | | |
919 | 924 | | |
| |||
942 | 947 | | |
943 | 948 | | |
944 | 949 | | |
945 | | - | |
| 950 | + | |
946 | 951 | | |
947 | 952 | | |
948 | 953 | | |
| |||
951 | 956 | | |
952 | 957 | | |
953 | 958 | | |
954 | | - | |
| 959 | + | |
955 | 960 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
46 | 46 | | |
47 | 47 | | |
48 | 48 | | |
49 | | - | |
| 49 | + | |
50 | 50 | | |
51 | 51 | | |
52 | 52 | | |
| |||
61 | 61 | | |
62 | 62 | | |
63 | 63 | | |
64 | | - | |
| 64 | + | |
65 | 65 | | |
66 | 66 | | |
67 | 67 | | |
| |||
0 commit comments